/* * call-seq: * playing? -> true or false * * True if the Sound is currently playing (not paused or stopped). * See also #paused? and #stopped?. * */ static VALUE rg_sound_playingp( VALUE self ) { RG_Sound *sound; Data_Get_Struct(self, RG_Sound, sound); int channel = sound->channel; /* Make sure the sound actually belongs to the channel */ if( _rg_sound_channel_check(sound) ) { /* Return true if it's playing, but not paused. */ if( Mix_Playing(channel) && !Mix_Paused(channel) ) { return Qtrue; } else { return Qfalse; } } else { return Qfalse; } }