コード例 #1
0
void PresentationAudioWidget::slotPlayerStateChanged(QMediaPlayer::State state)
{
    switch (state)
    {
        case QMediaPlayer::StoppedState:
            m_playButton->setEnabled(true);
            setGUIPlay(true);

            if (d->mediaObject->mediaStatus() == QMediaPlayer::LoadingMedia)
            {
                if (d->stopCalled)
                {
                    d->stopCalled = false;
                }
                else
                {
                    slotPlay();
                    checkSkip();
                }
            }
            break;

        case QMediaPlayer::PlayingState:
            setGUIPlay(false);
            checkSkip();
            break;

        default:
            break;
    }
}
コード例 #2
0
void PlaybackWidget::slotStop()
{
    m_mediaObject->stop();
    m_stopCalled = true;
    m_currIndex  = 0;
    m_mediaObject->setCurrentSource(static_cast<QUrl>(m_urlList[m_currIndex]));
    checkSkip();
    setGUIPlay(false);
    setZeroTime();
}
コード例 #3
0
void PresentationAudioWidget::slotStop()
{
    d->mediaObject->stop();
    d->stopCalled = true;
    d->currIndex  = 0;
    d->mediaObject->setMedia(d->urlList[d->currIndex]);
    checkSkip();
    setGUIPlay(false);
    setZeroTime();
}
コード例 #4
0
void PresentationAudioWidget::slotPlay()
{
    if (d->mediaObject->state() == QMediaPlayer::PlayingState || d->mediaObject->mediaStatus() == QMediaPlayer::BufferingMedia)
    {
        d->mediaObject->pause();
        setGUIPlay(true);
        d->canHide = false;
        emit signalPause();
        return;
    }

    if (d->mediaObject->state() == QMediaPlayer::PausedState || d->mediaObject->state() == QMediaPlayer::StoppedState)
    {
        d->mediaObject->play();
        setGUIPlay(false);
        d->canHide = true;
        emit signalPlay();
    }
}
コード例 #5
0
void PlaybackWidget::slotPlay()
{
    if ( m_mediaObject->state() == Phonon::PlayingState ||
         m_mediaObject->state() == Phonon::BufferingState )
    {
        m_mediaObject->pause();
        setGUIPlay(true);
        m_canHide = false;
        emit signalPause();
        return;
    }

    if ( m_mediaObject->state() == Phonon::PausedState ||
         m_mediaObject->state() == Phonon::StoppedState )
    {
        m_mediaObject->play();
        setGUIPlay(false);
        m_canHide = true;
        emit signalPlay();
    }
}
コード例 #6
0
void PlaybackWidget::slotMediaStateChanged(Phonon::State newstate, Phonon::State oldstate)
{
    switch (newstate)
    {

        case Phonon::StoppedState :
            m_playButton->setEnabled(true);
            setGUIPlay(true);

            if ( oldstate == Phonon::LoadingState )
            {
                if ( m_stopCalled ) m_stopCalled = false;
                else
                {
                    slotPlay();
                    checkSkip();
                }
            }

            break;

        case Phonon::ErrorState :
            slotError();
            break;

        case Phonon::PlayingState :
            setGUIPlay(false);
            checkSkip();
            break;

        case Phonon::PausedState :
            break;

        case Phonon::LoadingState :
            break;

        case Phonon::BufferingState :
            break;
    }
}