void JokerWindow::on_actionPreferences_triggered() { hideMediaPanel(); int oldSynchroProtocol = _settings->synchroProtocol(); QString oldLTCInputDevice = _settings->ltcInputDevice(); PreferencesDialog dlg(_settings); dlg.exec(); if((oldSynchroProtocol != _settings->synchroProtocol()) || (oldLTCInputDevice != _settings->ltcInputDevice())) { PHDEBUG << "Set protocol:" << _settings->synchroProtocol(); setupSyncProtocol(); } fadeInMediaPanel(); }
void JokerWindow::on_actionPreferences_triggered() { hideMediaPanel(); int oldSynchroProtocol = _settings->synchroProtocol(); #ifdef USE_LTC QString oldLtcInputPort = _settings->ltcInputPort(); #endif // USE_LTC #ifdef USE_MIDI QString oldMtcInputPort = _settings->mtcInputPort(); QString oldMtcVirtualInputPort = _settings->mtcVirtualInputPort(); bool oldMtcInputUseExistingPort = _settings->mtcInputUseExistingPort(); bool oldSendMmcMessage = _settings->sendMmcMessage(); QString oldMmcOutputPort = _settings->mmcOutputPort(); #endif // USE_MIDI PreferencesDialog dlg(_settings); if(dlg.exec() == QDialog::Accepted) { if((oldSynchroProtocol != _settings->synchroProtocol()) #ifdef USE_LTC || (oldLtcInputPort != _settings->ltcInputPort()) #endif // USE_LTC #ifdef USE_MIDI || (oldMtcInputPort != _settings->mtcInputPort()) || (oldMtcVirtualInputPort != _settings->mtcVirtualInputPort()) || (oldMtcInputUseExistingPort != _settings->mtcInputUseExistingPort()) || (oldSendMmcMessage != _settings->sendMmcMessage()) || (oldMmcOutputPort != _settings->mmcOutputPort()) #endif // USE_MIDI ) { PHDEBUG << "Set protocol:" << _settings->synchroProtocol(); setupSyncProtocol(); } #ifdef USE_MIDI _mtcReader.force24as2398(_settings->mtcForce24as2398()); #endif // USE_MIDI } fadeInMediaPanel(); }
JokerWindow::JokerWindow(JokerSettings *settings) : PhDocumentWindow(settings), ui(new Ui::JokerWindow), _settings(settings), _strip(settings), _videoEngine(settings), _doc(_strip.doc()), _sonySlave(PhTimeCodeType25, settings), _mtcReader(PhTimeCodeType25), _ltcReader(settings), _mediaPanelAnimation(&_mediaPanel, "windowOpacity"), _firstDoc(true), _resizingStrip(false), _numberOfDraw(0) { // Setting up UI ui->setupUi(this); // Due to translation, Qt might not be able to link automatically the menu ui->actionPreferences->setMenuRole(QAction::PreferencesRole); ui->actionAbout->setMenuRole(QAction::AboutRole); connect(ui->actionFullscreen, SIGNAL(triggered()), this, SLOT(toggleFullScreen())); ui->videoStripView->setGraphicSettings(_settings); // Initialize the property dialog _propertyDialog.setDoc(_doc); _propertyDialog.setVideoEngine(&_videoEngine); // Initialize the synchronizer _synchronizer.setStripClock(_strip.clock()); _synchronizer.setVideoClock(_videoEngine.clock()); connect(&_sonySlave, &PhSonySlaveController::videoSync, this, &JokerWindow::onVideoSync); setupSyncProtocol(); // Setting up the media panel _mediaPanel.setClock(_doc->videoTimeCodeType(), _strip.clock()); #warning /// @todo move to CSS file _mediaPanel.setStyleSheet( "* {" " color: white;" " }" " PhMediaPanel { " " background: qlineargradient(x1: 1, y1: 0, x2: 1, y2: 1, stop: 0 rgb(40,40,40), stop: 1 black);" " border-style: solid; " " border-width: 4px; " " border-radius: 3px; " " border-color: white; " " } " " QPushButton, QComboBox{ " " background: grey; " " border-style: outset; " " border-width: 2px; " " border-radius: 5px; " " border-color: white; " " } " " QLabel#_timecodeLabel{ " " padding: 10px; " " } " ); this->setFocus(); if(_settings->stripTestMode()) { #warning /// @todo do we warn the user that test mode is on? ui->actionTest_mode->setChecked(true); } #warning /// @todo move to PhDocumentWindow // This is for the drag and drop feature setAcceptDrops(true); ui->actionDisplay_the_cuts->setChecked(_settings->displayCuts()); ui->actionInvert_colors->setChecked(_settings->invertColor()); ui->actionShow_ruler->setChecked(_settings->displayRuler()); ui->actionHide_the_rythmo->setChecked(_settings->hideStrip()); _mediaPanel.show(); _mediaPanelState = MediaPanelVisible; // Trigger a timer that will fade off the media panel after 3 seconds this->connect(&_mediaPanelTimer, SIGNAL(timeout()), this, SLOT(fadeOutMediaPanel())); _mediaPanelTimer.start(3000); this->connect(ui->videoStripView, &PhGraphicView::beforePaint, this, &JokerWindow::timeCounter); this->connect(ui->videoStripView, &PhGraphicView::beforePaint, _strip.clock(), &PhClock::tick); this->connect(ui->videoStripView, &PhGraphicView::paint, this, &JokerWindow::onPaint); _videoLogo.setFilename(QCoreApplication::applicationDirPath() + PATH_TO_RESSOURCES + "/phonations.png"); }
JokerWindow::JokerWindow(JokerSettings *settings) : PhEditableDocumentWindow(settings), ui(new Ui::JokerWindow), _settings(settings), _strip(settings), _doc(_strip.doc()), #ifdef USE_VIDEO _videoEngine(settings), #endif _synchronizer(settings), #ifdef USE_SONY _sonySlave(settings), #endif #ifdef USE_LTC _ltcReader(settings), #endif #ifdef USE_MIDI _mtcReader(PhTimeCodeType25), _mtcWriter(PhTimeCodeType25), #endif _mediaPanelState(MediaPanelHidden), _mediaPanelAnimation(&_mediaPanel, "windowOpacity"), _firstDoc(true), _resizingStrip(false) { // Setting up UI ui->setupUi(this); // Due to translation, Qt might not be able to link automatically the menu ui->actionPreferences->setMenuRole(QAction::PreferencesRole); ui->actionAbout->setMenuRole(QAction::AboutRole); connect(ui->actionFullscreen, &QAction::triggered, this, &JokerWindow::toggleFullScreen); ui->videoStripView->setGraphicSettings(_settings); // Initialize the synchronizer _synchronizer.setStripClock(_strip.clock()); // Initialize the property dialog _propertyDialog.setDoc(_doc); #ifdef USE_VIDEO _propertyDialog.setVideoEngine(&_videoEngine); _synchronizer.setVideoClock(_videoEngine.clock()); #else ui->actionOpen_Video->setEnabled(false); ui->actionClose_video->setEnabled(false); ui->actionDeinterlace_video->setEnabled(false); ui->actionForce_16_9_ratio->setEnabled(false); ui->actionUse_native_video_size->setEnabled(false); #endif #ifdef USE_SONY connect(&_sonySlave, &PhSonySlaveController::videoSync, this, &JokerWindow::onVideoSync); #endif #ifdef USE_MIDI _mtcReader.force24as2398(_settings->mtcForce24as2398()); #endif // USE_MIDI setupSyncProtocol(); // Setting up the media panel _mediaPanel.setClock(_doc->videoTimeCodeType(), _strip.clock()); #warning /// @todo move to CSS file _mediaPanel.setStyleSheet( "* {" " color: white;" " }" " PhMediaPanel { " " background: qlineargradient(x1: 1, y1: 0, x2: 1, y2: 1, stop: 0 rgb(40,40,40), stop: 1 black);" " border-style: solid; " " border-width: 4px; " " border-radius: 3px; " " border-color: white; " " } " " QPushButton, QComboBox{ " " background: grey; " " border-style: outset; " " border-width: 2px; " " border-radius: 5px; " " border-color: white; " " } " " QLabel#_timecodeLabel{ " " padding: 10px; " " } " ); ui->actionDisplay_the_control_panel->setChecked(_settings->displayControlPanel()); fadeInMediaPanel(); // Trigger a timer that will fade off the media panel after 3 seconds this->connect(&_mediaPanelTimer, &QTimer::timeout, this, &JokerWindow::fadeOutMediaPanel); _mediaPanelTimer.start(3000); this->setFocus(); ui->actionDisplay_the_information_panel->setChecked(_settings->displayNextText()); #warning /// @todo do we warn the user that test mode is on? ui->actionTest_mode->setChecked(_settings->stripTestMode()); #warning /// @todo move to PhDocumentWindow // This is for the drag and drop feature setAcceptDrops(true); ui->actionLoop->setChecked(_settings->syncLooping()); ui->actionInvert_colors->setChecked(_settings->invertColor()); ui->actionHide_the_rythmo->setChecked(_settings->hideStrip()); ui->actionDisplay_the_cuts->setChecked(_settings->displayCuts()); ui->actionDisplay_the_vertical_scale->setChecked(_settings->displayVerticalScale()); on_actionDisplay_feet_triggered(_settings->displayFeet()); this->connect(ui->videoStripView, &PhGraphicView::beforePaint, this, &JokerWindow::timeCounter); this->connect(ui->videoStripView, &PhGraphicView::beforePaint, _strip.clock(), &PhClock::elapse); this->connect(ui->videoStripView, &PhGraphicView::paint, this, &JokerWindow::onPaint); _videoLogo.setFilename(QCoreApplication::applicationDirPath() + PATH_TO_RESSOURCES + "/phonations.png"); }