Exemplo n.º 1
0
qint64 QWmpPlayerControl::duration() const
{
    double duration = 0.;

    IWMPMedia *media = 0;
    if (m_controls && m_controls->get_currentItem(&media) == S_OK) {
        media->get_duration(&duration);
        media->Release();
    }

    return duration * 1000;
}
Exemplo n.º 2
0
QMediaTimeRange QWmpPlayerControl::availablePlaybackRanges() const
{
    QMediaTimeRange ranges;

    IWMPMedia *media = 0;
    if (m_controls && m_controls->get_currentItem(&media) == S_OK) {
        double duration = 0;
        media->get_duration(&duration);
        media->Release();

        if(duration > 0)
            ranges.addInterval(0, duration * 1000);
    }

    return ranges;
}
Exemplo n.º 3
0
int CWmp_scrobbler::GetTrackLength()
{
	double dDuration = -1;

	IWMPMedia* pMedia = NULL;
	
	if(m_spCore)
	{
		m_spCore->get_currentMedia(&pMedia);
		
		if(pMedia != NULL)
		{
			pMedia->get_duration(&dDuration);
		}
	}

	return (int)dDuration;
}