Exemplo n.º 1
0
void VideoItem::createPanel()
{
    _panel = new VideoControlPanel(this);
    _panel->setParentItem(this);
    setPanelPosition();

    _panel->setVolume(_player->volume());
    // _panel->show();
    _panel->hide();

    connect (this, SIGNAL(playMedia()),
             _panel, SLOT(on_play()));
    connect (this, SIGNAL(pauseMedia()),
             _panel, SLOT(on_pause()));
    connect (this, SIGNAL(stopMedia()),
             _panel, SLOT(on_stop()));

    connect (_panel, SIGNAL(positionChanged(qint64)),
             _player, SLOT(setPosition(qint64)));
    connect (_panel, SIGNAL(playClicked()),
             _player, SLOT(play()));
    connect (_panel, SIGNAL(pauseClicked()),
             _player, SLOT(pause()));
    connect (_panel, SIGNAL(volumeChanged(int)),
             _player, SLOT(setVolume(int)));
}
Exemplo n.º 2
0
void TvrUiWidget::on_actionOpen_triggered(){

    if(getRecordingState() || getRecordingPausedState()
        || getPlayingState() || getPlayingPausedState()){
        stopMedia();
    }

    if(!getFileSavedState()){
            if(isLRAvailable()){
                showSaveFileDlg();
            }
    }

    setLastRecording(false);

    if(showOpenFileDlg()){
        pd = g_new0(player_data, 1);
        tvr_init_player(pd, fileNameO.toStdString().c_str());
        g_timeout_add(1000, (GSourceFunc)tvr_parse_stream_length, pd);
        setFileOpenedState(true);
        t->start(1000);
        playMedia();
    }

}
Exemplo n.º 3
0
void TvrUiWidget::on_actionSaveAs_triggered(){

    if(getRecordingState() || getRecordingPausedState()
        || getPlayingState() || getPlayingPausedState()){
        stopMedia();
    }
    if(isLRAvailable()){
        checkFileAndSave();
    }
        showSaveMessageDlg();
        setStoppedState(false);
        setButtonStatus(true, false, false, false, false, true);
}
Exemplo n.º 4
0
void VideoItem::on_stateChanged(QMediaPlayer::State state)
{
    // qDebug () << "on media state changed: " << state;
    if (state == QMediaPlayer::PlayingState) {
        //_panel->show();
        emit playMedia();
    }
    else if (state == QMediaPlayer::PausedState) {
        emit pauseMedia();
    }
    else if (state == QMediaPlayer::StoppedState) {
        emit stopMedia();
    }
}
Exemplo n.º 5
0
void TvrUiWidget::playMedia(){


        statusLabelEdit->setText("Playing ...");

        setPlayingPausedState(false);
        setPlayingState(true);

        setButtonStatus(false, false, true, true, true, true);

        if(tvr_play_player_pipeline(pd) == GST_MESSAGE_EOS){
                stopMedia();
        }

}
Exemplo n.º 6
0
void TvrUiWidget::on_actionNew_triggered(){

        if(getRecordingState() || getRecordingPausedState()
            || getPlayingState() || getPlayingPausedState()){
            stopMedia();
        }

        if(!getFileSavedState()){
                if(isLRAvailable()){
                    showSaveFileDlg();
                }
        }
        setLastRecording(false);

        if(getFileSavedState()){
                setButtonStatus(true, false, false, false, false, true);
        }
}
Exemplo n.º 7
0
/*!
    End the current session.
*/
void MediaSessionClient::end()
{
    stopMedia();
    d->clear();
}
Exemplo n.º 8
0
void TvrUiWidget::on_actionStop_triggered(){
        t->stop();
        stopMedia();
}
Exemplo n.º 9
0
void TvrUiWidget::on_actionExit_triggered(){

        stopMedia();
        QApplication::quit();

}