Logo Search packages:      
Sourcecode: ultrastar-ng version File versions  Download package

bool CAudio::isPlaying ( void   ) 

This method returns wether or not the track is playing

Definition at line 156 of file audio.cpp.

References getLength(), and getPosition().

Referenced by isPaused(), playMusic(), playPreview(), seek(), and togglePause().

{
#ifdef USE_LIBXINE_AUDIO
        xine_event_t *event; 
        while((event = xine_event_get(event_queue))) {
            switch(event->type) {
                case XINE_EVENT_UI_PLAYBACK_FINISHED:
                    xine_playing = 0;
                    break;
            }
            xine_event_free(event);
        }
        if(xine_playing) {
            return true;
      } else {
            return false;
      }
#endif
#ifdef USE_GSTREAMER_AUDIO
      // If the length cannot be computed, we assume that the song is playing
      // (happening in the first fex seconds)
      if( getLength()==0 )
            return true;

      // If we are not in the last second, then we are not at the end of the song 
      if( getLength() - getPosition() > 1000 )
            return true;
      else
            return false;
#endif
      return true;
}


Generated by  Doxygen 1.6.0   Back to index