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;

      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;
      GstFormat fmt = GST_FORMAT_TIME;
      gint64 pos;
      if (!gst_element_query_position (music, &fmt, &pos))
            position = 0;
            position = (int) (pos/GST_MSECOND);

      return position;

Generated by  Doxygen 1.6.0   Back to index