BbCameraMediaRecorderControl::BbCameraMediaRecorderControl(BbCameraSession *session, QObject *parent) : QMediaRecorderControl(parent) , m_session(session) { connect(m_session, SIGNAL(videoStateChanged(QMediaRecorder::State)), this, SIGNAL(stateChanged(QMediaRecorder::State))); connect(m_session, SIGNAL(videoStatusChanged(QMediaRecorder::Status)), this, SIGNAL(statusChanged(QMediaRecorder::Status))); connect(m_session, SIGNAL(durationChanged(qint64)), this, SIGNAL(durationChanged(qint64))); connect(m_session, SIGNAL(actualLocationChanged(QUrl)), this, SIGNAL(actualLocationChanged(QUrl))); connect(m_session, SIGNAL(videoError(int,QString)), this, SIGNAL(error(int,QString))); }
BuzzerLive::BuzzerLive() { soundPlayer = new QMediaPlayer(); inWin = false; buzzDir = new QDir("media/buzzer/sounds/"); mp3Files = buzzDir->entryList(QDir::Files); textTimeout = new QTimer; textTimeout->setInterval(3000); connect(textTimeout, SIGNAL(timeout()), this, SLOT(killText())); dTeamName = new QLabel(); dTeamName->setWordWrap(true); dTeamName->setAlignment(Qt::AlignCenter); dTeamName->setStyleSheet("margin: 0; padding: 0; background-color: black; color: white; font: 100pt;"); videoPlayer = new QMediaPlayer(); videoWidget = new QVideoWidget(); videoPlayer->setVideoOutput(videoWidget); connect(videoPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this , SLOT(videoStateChanged(QMediaPlayer::State))); connect(videoPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this , SLOT(videoStatusChanged(QMediaPlayer::MediaStatus))); layout = new QStackedLayout(); layout->addWidget(dTeamName); layout->addWidget(videoWidget); layout->setCurrentWidget(dTeamName); connect(layout, SIGNAL(currentChanged(int)), this, SLOT(checkVideoHidden(int))); setLayout(layout); }