PlayerWidget::PlayerWidget(QWidget *parent) : QWidget(parent), ui(new Ui::PlayerWidget()){ ui->setupUi(this); //load the designer form PLAYER = new QMediaPlayer(this); PLAYER->setVolume(100); PLAYER->setNotifyInterval(1000); //1 second interval (just needs to be a rough estimate) PLAYLIST = new QMediaPlaylist(this); PLAYLIST->setPlaybackMode(QMediaPlaylist::Sequential); PLAYER->setPlaylist(PLAYLIST); configMenu = new QMenu(this); ui->tool_config->setMenu(configMenu); addMenu = new QMenu(this); ui->tool_add->setMenu(addMenu); updatinglists = false; //start off as false LoadIcons(); playerStateChanged(); //update button visibility currentSongChanged(); //Connect all the signals/slots //connect(infoTimer, SIGNAL(timeout()), this, SLOT(rotateTrackInfo()) ); connect(PLAYER, SIGNAL(positionChanged(qint64)),this, SLOT(updateProgress(qint64)) ); connect(PLAYER, SIGNAL(durationChanged(qint64)), this, SLOT(updateMaxProgress(qint64)) ); connect(PLAYLIST, SIGNAL(mediaChanged(int, int)), this, SLOT(playlistChanged()) ); connect(PLAYER, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(playerStateChanged()) ); connect(PLAYLIST, SIGNAL(currentMediaChanged(const QMediaContent&)), this, SLOT(currentSongChanged()) ); connect(ui->combo_playlist, SIGNAL(currentIndexChanged(int)), this, SLOT(userlistSelectionChanged()) ); connect(ui->tool_play, SIGNAL(clicked()), this, SLOT(playClicked()) ); connect(ui->tool_pause, SIGNAL(clicked()), this, SLOT(pauseClicked()) ); connect(ui->tool_stop, SIGNAL(clicked()), this, SLOT(stopClicked()) ); connect(ui->tool_next, SIGNAL(clicked()), this, SLOT(nextClicked()) ); connect(ui->tool_prev, SIGNAL(clicked()), this, SLOT(prevClicked()) ); }
void PlayerController::setView(AbstractPlayerView *view) { if (m_view == view) return; if (m_view) { m_view->disconnect(this); } m_view = view; if (m_view) { connect(m_view, SIGNAL(playClicked()), SLOT(play())); connect(m_view, SIGNAL(pauseClicked()), SLOT(pause())); connect(m_view, SIGNAL(stopClicked()), SLOT(stop())); connect(m_view, SIGNAL(nextClicked()), SLOT(next())); connect(m_view, SIGNAL(previousClicked()), SLOT(previous())); connect(m_view, SIGNAL(shuffleClicked()), SLOT(toggleShuffle())); connect(m_view, SIGNAL(muteClicked()), SLOT(toggleMute())); connect(m_view, SIGNAL(repeatClicked()), SLOT(toggleRepeat())); connect(m_view, SIGNAL(volumeChanged(qreal)), SLOT(setVolume(qreal))); connect(m_view, SIGNAL(songSelected(int)), SLOT(play(int))); } initializeView(); }
ProgressWidget::ProgressWidget(qint64 directorySizeInBytes, QDialog *parent) : QDialog(parent) , mActionState(RUNNING) , mDirectorySizeInBytes(directorySizeInBytes) , mBytesProcessed(0) { setWindowTitle("Search"); setModal(true); mProgressBar = new QProgressBar(); mProgressBar->setMaximum(100); mProgressBar->setMinimumWidth(200); mProgressBar->setAlignment(Qt::AlignCenter); mProgressBar->setValue(0); mPauseOrContinueButton = new QPushButton("&Pause"); mCancelButton = new QPushButton("&Cancel"); QHBoxLayout* hLayout = new QHBoxLayout(); hLayout->addWidget(mPauseOrContinueButton); hLayout->addWidget(mCancelButton); hLayout->setSpacing(6); hLayout->setContentsMargins(11, 11, 11, 11); QVBoxLayout* vLayout = new QVBoxLayout(); vLayout->addWidget(mProgressBar); vLayout->addLayout(hLayout); connect(mPauseOrContinueButton, SIGNAL(clicked()), SLOT(pauseClicked())); connect(mCancelButton, SIGNAL(clicked()), SLOT(cancelClicked())); setLayout(vLayout); resize(300, 100); }
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))); }
//! Construtor TerraMEPlayerDialog::TerraMEPlayerDialog(Services* manager, QWidget* parent, Qt::WFlags f) : QDialog(parent, f) { setupUi(this); _manager = manager; _currentAnalysisImageIndex = 0; _imageCountLabel->setText(""); _imageFileFilter.append("terrama2_*.png"); //Este filtro deve ser igual ao usado para gerar as imagens das analises TerraME (ver AnalysisRule.cpp) _imageCountText = tr("Imagem: %1 / %2"); connect(_terraMEAnalysisListWidget, SIGNAL(currentRowChanged(int)), SLOT(analysisSelected(int))); connect(_datetimeListWidget, SIGNAL(currentRowChanged(int)), SLOT(datetimeSelected(int))); connect(_previousBtn, SIGNAL(clicked()), SLOT(showPreviousImage())); connect(_nextBtn, SIGNAL(clicked()), SLOT(showNextImage())); connect(_rewindBtn, SIGNAL(clicked()), SLOT(rewindClicked())); connect(_forwardBtn, SIGNAL(clicked()), SLOT(forwardClicked())); connect(_pauseBtn, SIGNAL(clicked()), SLOT(pauseClicked())); connect(&_changeResultTimer, SIGNAL(timeout()), this, SLOT(changeResultSlot())); _changeResultTimer.setSingleShot(false); reloadInterface(); }
void PlaylistControl::mouseReleaseEvent(QMouseEvent *me) { QPoint pt = me->pos(); if(QRect(4*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit previousClicked(); else if(QRect(12*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit playClicked(); else if(QRect(21*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit pauseClicked(); else if(QRect(31*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit stopClicked(); else if(QRect(40*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit nextClicked(); else if(QRect(49*m_ratio,m_ratio,7*m_ratio,7*m_ratio).contains(pt)) emit ejectClicked(); }
void PhMediaPanel::onPlayPause() { if(_clock) { if(_clock->rate()) _clock->setRate(0); else _clock->setRate(1); } else _playing = !_playing; updatePlayingState(); if(_playing) emit playClicked(); else emit pauseClicked(); }
void HTML5FullScreenVideoHandler::enterFullScreen(QMediaPlayer *player) { if (!player) return; m_videoWidget = new HTML5VideoWidget(); if (!m_videoWidget) return; m_videoWidget->setDuration(player->duration() / 1000); CAknAppUi* appUi = dynamic_cast<CAknAppUi*>(CEikonEnv::Static()->AppUi()); if (appUi) { m_savedOrientation = appUi->Orientation(); appUi->SetOrientationL(CAknAppUi::EAppUiOrientationLandscape); } m_mediaPlayer = player; connect(m_mediaPlayer, SIGNAL(positionChanged(qint64)), m_videoWidget, SLOT(onPositionChanged(qint64))); connect(m_mediaPlayer, SIGNAL(durationChanged(qint64)), m_videoWidget, SLOT(setDuration(qint64))); connect(m_mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), this, SLOT(onPlayerStateChanged(QMediaPlayer::State))); connect(m_mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(onPlayerError(QMediaPlayer::Error))); connect(m_mediaPlayer, SIGNAL(mediaStatusChanged(QMediaPlayer::MediaStatus)), this, SLOT(onMediaStatusChanged(QMediaPlayer::MediaStatus))); connect(m_videoWidget, SIGNAL(positionChangedByUser(qint64)), m_mediaPlayer, SLOT(setPosition(qint64))); connect(m_videoWidget, SIGNAL(closeClicked()), this, SIGNAL(fullScreenClosed())); connect(m_videoWidget, SIGNAL(muted(bool)), m_mediaPlayer, SLOT(setMuted(bool))); connect(m_videoWidget, SIGNAL(volumeChanged(int)), m_mediaPlayer, SLOT(setVolume(int))); connect(m_videoWidget, SIGNAL(pauseClicked()), m_mediaPlayer, SLOT(pause())); connect(m_videoWidget, SIGNAL(playClicked()), m_mediaPlayer, SLOT(play())); m_mediaPlayer->setVideoOutput(m_videoWidget); m_videoWidget->setVolume(m_mediaPlayer->volume()); m_videoWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); m_videoWidget->showFullScreen(); m_fullScreen = true; // Handle current Media Status and Media Player error. onMediaStatusChanged(m_mediaPlayer->mediaStatus()); onPlayerError(m_mediaPlayer->error()); }
void MainWindow::initiateWindowWidgets() { okButton->setEnabledPixmap(QPixmap("images/button/ok.png")); okButton->setDisabledPixmap(QPixmap("images/button/ok-disabled.png")); connect(okButton, SIGNAL(clicked()), this, SLOT(okClicked())); cancelButton->setEnabledPixmap(QPixmap("images/button/cancel.png")); cancelButton->setDisabledPixmap( QPixmap("images/button/cancel-disabled.png")); connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked())); abandonButton->setEnabledPixmap(QPixmap("images/button/discard.png")); abandonButton->setDisabledPixmap( QPixmap("images/button/discard-disabled.png")); connect(abandonButton, SIGNAL(clicked()), this, SLOT(abandonClicked())); quitButton->setEnabledPixmap(QPixmap("images/button/close.png")); quitButton->setDisabledPixmap(QPixmap("images/button/close.png")); quitButton->setPressedPixmap(QPixmap("images/button/close-pressed.png")); connect(quitButton, SIGNAL(clicked()), this, SLOT(close())); aboutButton->setEnabledPixmap(QPixmap("images/button/enabled-big.png")); aboutButton->setDisabledPixmap(QPixmap("images/button/disabled-big.png")); aboutButton->setPressedPixmap(QPixmap("images/button/pressed-big.png")); bigPauseButton->setEnabledPixmap( QPixmap("images/button/enabled-large.png")); bigPauseButton->setDisabledPixmap( QPixmap("images/button/disabled-large.png")); bigPauseButton->setPressedPixmap( QPixmap("images/button/pressed-large.png")); connect(bigPauseButton, SIGNAL(clicked()), pauseButton, SLOT(click())); helpButton->setEnabledPixmap(QPixmap("images/button/enabled-large.png")); helpButton->setDisabledPixmap(QPixmap("images/button/disabled-large.png")); helpButton->setPressedPixmap(QPixmap("images/button/pressed-large.png")); tipBox = new MessageBox(this); tipBox->hide(); pauseBox = new MessageBox(this); pauseBox->hide(); cardContainer = new CardContainer(this); cardContainer->hide(); wujiangChooseBox = new WujiangChooseBox(this); wujiangChooseBox->hide(); guanxingBox = new GuanxingBox(this); guanxingBox->hide(); zhuangbeiLabel = new ZhuangbeiLabel(this); zhuangbeiLabel->hide(); aboutFrame = new AboutFrame(this); aboutFrame->hide(); connect(aboutButton, SIGNAL(clicked()), aboutFrame, SLOT(showAboutInfo())); helpBox = new HelpBox(this); helpBox->hide(); connect(helpButton, SIGNAL(clicked()), helpBox, SLOT(displayHelp())); wugufengdengBox = new WugufengdengBox(this); wugufengdengBox->hide(); fanjianBox = new FanjianBox(this); fanjianBox->hide(); cardViewer = new CardViewer(this); cardViewer->hide(); gameOverBox = new GameOverBox(this); gameOverBox->hide(); cardDeckLabel->hide(); blockingFrameMovingAnimation = new QPropertyAnimation(this); blockingFrameMovingAnimation->setPropertyName("pos"); blockingFrameMovingAnimation->setDuration( GUIStaticData::blockingFrameMovingDuration); debugCheckBox->hide(); debugTabWidget->hide(); testWidget->hide(); connect(pauseButton, SIGNAL(clicked()), this, SLOT(pauseClicked())); checkButtons(); }
LTWindow::LTWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::LTWindow), eventData(EventData::getInstance()) { ui->setupUi(this); currDriver = -1; streamReader = new DataStreamReader(this); prefs = new PreferencesDialog(this); settings = new QSettings(F1LTCore::iniFile(), QSettings::IniFormat, this); loginDialog = new LoginDialog(this); ltFilesManagerDialog = new LTFilesManagerDialog(this); trackRecordsDialog = new TrackRecordsDialog(this); saw = new SessionAnalysisWidget(); stw = new SessionTimesWidget(); driverTrackerWidget = new DriverTrackerWidget(); aboutDialog = new AboutDialog(this); updatesCheckerDialog = new UpdatesCheckerDialog(this); // ui->trackStatusWidget->setupItems(); connect(streamReader, SIGNAL(tryAuthorize()), this, SLOT(tryAuthorize())); connect(streamReader, SIGNAL(authorized(QString)), this, SLOT(authorized(QString))); connect(streamReader, SIGNAL(eventDataChanged(const DataUpdates&)), this, SLOT(eventDataChanged(const DataUpdates&))); connect(streamReader, SIGNAL(driverDataChanged(int, const DataUpdates&)), this, SLOT(driverDataChanged(int, const DataUpdates&))); connect(streamReader, SIGNAL(dataChanged(const DataUpdates&)), this, SLOT(dataChanged(const DataUpdates&))); connect(streamReader, SIGNAL(sessionStarted()), this, SLOT(sessionStarted())); connect(streamReader, SIGNAL(authorizationError()), this, SLOT(authorizationError())); connect(streamReader, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError))); connect(streamReader, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(error(QNetworkReply::NetworkError))); connect(streamReader, SIGNAL(noLiveSession(bool, QString)), this, SLOT(showNoSessionBoard(bool, QString))); connect(updatesCheckerDialog, SIGNAL(newVersionAvailable()), this, SLOT(onNewVersionAvailable())); sessionTimer = new SessionTimer(this); connect(sessionTimer, SIGNAL(updateWeather()), this, SLOT(updateWeather())); connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), &ImagesFactory::getInstance(), SLOT(reloadGraphics())); connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), &ColorsManager::getInstance(), SLOT(calculateDefaultDriverColors())); connect(&SeasonData::getInstance(), SIGNAL(seasonDataChanged()), saw, SLOT(setupColors())); connect(prefs, SIGNAL(driversColorsChanged()), saw, SLOT(setupColors())); eventRecorder = new EventRecorder(sessionTimer, this); eventPlayer = new EventPlayer(this); delayWidget = new DelayWidget(this); connect(delayWidget, SIGNAL(delayChanged(int, int)), streamReader, SLOT(setDelay(int, int))); connect(delayWidget, SIGNAL(delayChanged(int, int)), sessionTimer, SLOT(setDelay(int, int))); connect(sessionTimer, SIGNAL(synchronizingTimer(bool)), delayWidget, SLOT(synchronizingTimer(bool))); connect(sessionTimer, SIGNAL(synchronizingTimer(bool)), driverTrackerWidget, SLOT(pauseTimer(bool))); connect(ui->messageBoardWidget, SIGNAL(connectClicked()), this, SLOT(on_actionConnect_triggered())); connect(ui->messageBoardWidget, SIGNAL(playClicked()), this, SLOT(on_actionOpen_triggered())); connect(ui->messageBoardWidget, SIGNAL(loadClicked()), this, SLOT(on_actionLT_files_data_base_triggered())); loadSettings(); ColorsManager::getInstance().calculateDefaultDriverColors(); saw->setupColors(); delayWidgetAction = ui->mainToolBar->addWidget(delayWidget); delayWidgetAction->setVisible(true); eventPlayerAction = ui->mainToolBar->addWidget(eventPlayer); eventPlayerAction->setVisible(false); recording = false; playing = false; connectionProgress = new QProgressDialog(this); connect(sessionTimer, SIGNAL(timeout()), this, SLOT(timeout())); connect(eventRecorder, SIGNAL(recordingStopped()), this, SLOT(autoStopRecording())); connect(eventPlayer, SIGNAL(playClicked(int)), this, SLOT(eventPlayerPlayClicked(int))); connect(eventPlayer, SIGNAL(pauseClicked()), this, SLOT(eventPlayerPauseClicked())); connect(eventPlayer, SIGNAL(rewindToStartClicked()), this, SLOT(eventPlayerRewindToStartClicked())); connect(eventPlayer, SIGNAL(forwardToEndClicked()), this, SLOT(eventPlayerForwardToEndClicked())); connect(eventPlayer, SIGNAL(rewindClicked()), this, SLOT(eventPlayerRewindClicked())); connect(eventPlayer, SIGNAL(stopClicked()), this, SLOT(eventPlayerStopClicked())); connect(eventPlayer, SIGNAL(nextPackets(QVector<Packet>)), streamReader, SLOT(parsePackets(QVector<Packet>))); connect(ui->ltWidget, SIGNAL(driverSelected(int)), ui->driverDataWidget, SLOT(printDriverData(int))); connect(ui->ltWidget, SIGNAL(driverDoubleClicked(int)), this, SLOT(ltWidgetDriverSelected(int))); ui->messageBoardWidget->setVisible(false); QStringList args = qApp->arguments(); if (args.size() > 1) { if (eventPlayer->loadFromFile(args.at(1)) == false) { QMessageBox::critical(this, "Error opening file!", "Could not open specified file, or the file is corrupted."); connectToServer(); return; } setWindowTitle("FILT - " + args.at(1)); ui->actionRecord->setVisible(false); ui->actionStop_recording->setVisible(false); eventPlayerAction->setVisible(true); delayWidgetAction->setVisible(false); playing = true; eventPlayer->startPlaying(); } else { if (settings->value("ui/auto_connect").toBool()) connectToServer(); else { ui->messageBoardWidget->showStartupBoard(); showSessionBoard(true); } } }