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

int CAudio::getPosition ( void   ) 

This method returns the current position into the playing track. If the position cannot be computed, 0 is returned.

Definition at line 199 of file audio.cpp.

Referenced by isPlaying(), and seek().

{
      int position = 0;

#ifdef USE_LIBXINE_AUDIO
      int pos_stream;
      int length_time;
      int pos_time;

      if (xine_get_pos_length(stream, &pos_stream, &pos_time, &length_time)) {
            position = pos_time;
      } else {
      position = 0;
      }
#endif
#ifdef USE_GSTREAMER_AUDIO
      GstFormat fmt = GST_FORMAT_TIME;
      gint64 pos;
      if (!gst_element_query_position (music, &fmt, &pos))
            position = 0;
      else
            position = (int) (pos/GST_MSECOND);
#endif

      return position;
}


Generated by  Doxygen 1.6.0   Back to index