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

int CAudio::getLength ( void   ) 

This method returns the length of the current track stored in the length varialble. If the length variable hasn't be already computed (for any reason) it is computed again.

Definition at line 131 of file audio.cpp.

Referenced by isPlaying(), and seek().

      if( length == LENGTH_ERROR ) {
            int pos_stream;
            int pos_time;
            if( !xine_get_pos_length(stream, &pos_stream, &pos_time, &length) )
                  length = LENGTH_ERROR;
            GstFormat fmt = GST_FORMAT_TIME;
            gint64 len;
            if (!gst_element_query_duration (music, &fmt, &len))
                  length = LENGTH_ERROR;
                  length = (int) (len/GST_MSECOND);

      if( length == LENGTH_ERROR )
            return 0;
            return length;

Generated by  Doxygen 1.6.0   Back to index