From bf8e0d2662328085a74159eb6d11b98a81a296f4 Mon Sep 17 00:00:00 2001 From: Jeremy Bullock Date: Sat, 25 Apr 2020 01:30:38 -0600 Subject: [PATCH] Light and Screen Control --- toonz/sources/stopmotion/stopmotion.cpp | 224 ++++++--- toonz/sources/stopmotion/stopmotion.h | 38 +- .../stopmotion/stopmotioncontroller.cpp | 465 +++++++++++++----- .../sources/stopmotion/stopmotioncontroller.h | 50 +- 4 files changed, 574 insertions(+), 203 deletions(-) diff --git a/toonz/sources/stopmotion/stopmotion.cpp b/toonz/sources/stopmotion/stopmotion.cpp index f93df237..234567f7 100644 --- a/toonz/sources/stopmotion/stopmotion.cpp +++ b/toonz/sources/stopmotion/stopmotion.cpp @@ -328,7 +328,7 @@ StopMotion::StopMotion() { m_timer = new QTimer(this); m_reviewTimer = new QTimer(this); m_reviewTimer->setSingleShot(true); - m_intervalTimer = new QTimer(this); + m_intervalTimer = new QTimer(this); m_countdownTimer = new QTimer(this); // Make the interval timer single-shot. When the capture finished, restart @@ -344,7 +344,7 @@ StopMotion::StopMotion() { m_fullScreen2 = new QDialog(); m_fullScreen2->setModal(false); m_fullScreen2->setStyleSheet("background-color:black;"); - if (m_screenCount == 3) { + if (m_screenCount > 2) { m_fullScreen3 = new QDialog(); m_fullScreen3->setModal(false); m_fullScreen3->setStyleSheet("background-color:black;"); @@ -369,7 +369,7 @@ StopMotion::StopMotion() { ret = ret && connect(frameHandle, SIGNAL(isPlayingStatusChanged()), this, SLOT(onPlaybackChanged())); ret = ret && connect(m_intervalTimer, SIGNAL(timeout()), this, - SLOT(onIntervalCaptureTimerTimeout())); + SLOT(onIntervalCaptureTimerTimeout())); assert(ret); ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene(); @@ -465,7 +465,7 @@ void StopMotion::disconnectAllCameras() { m_liveViewStatus = LiveViewClosed; setTEnvCameraName(""); - m_isTimeLapse = false; + m_isTimeLapse = false; m_intervalStarted = false; m_intervalTimer->stop(); m_countdownTimer->stop(); @@ -554,6 +554,120 @@ void StopMotion::setBlackCapture(bool on) { //----------------------------------------------------------------- +void StopMotion::setScreen1Color(TPixel32 color) { + m_screen1Color = color; + emit(screen1ColorChanged(color)); +} + +//----------------------------------------------------------------- + +void StopMotion::setScreen2Color(TPixel32 color) { + m_screen2Color = color; + emit(screen2ColorChanged(color)); +} + +//----------------------------------------------------------------- + +void StopMotion::setScreen3Color(TPixel32 color) { + m_screen3Color = color; + emit(screen3ColorChanged(color)); +} + +//----------------------------------------------------------------- + +void StopMotion::setScreen1UseOverlay(bool on) { + m_useScreen1Overlay = on; + emit(screen1OverlayChanged(on)); +} + +//----------------------------------------------------------------- + +void StopMotion::setScreen2UseOverlay(bool on) { + m_useScreen2Overlay = on; + emit(screen2OverlayChanged(on)); +} + +//----------------------------------------------------------------- + +void StopMotion::setScreen3UseOverlay(bool on) { + m_useScreen3Overlay = on; + emit(screen3OverlayChanged(on)); +} + +//----------------------------------------------------------------- + +void StopMotion::showOverlays() { + if (getBlackCapture()) { + m_fullScreen1->setStyleSheet("background-color: rgb(0,0,0);"); + if (m_screenCount > 1) { + m_fullScreen2->setStyleSheet("background-color: rgb(0,0,0);"); + } + if (m_screenCount > 2) { + m_fullScreen3->setStyleSheet("background-color: rgb(0,0,0);"); + } + } else { + QString style1 = QString("background-color: rgb(%1,%2,%3);") + .arg(m_screen1Color.r) + .arg(m_screen1Color.g) + .arg(m_screen1Color.b); + m_fullScreen1->setStyleSheet(style1); + if (m_screenCount > 1) { + QString style2 = QString("background-color: rgb(%1,%2,%3);") + .arg(m_screen2Color.r) + .arg(m_screen2Color.g) + .arg(m_screen2Color.b); + m_fullScreen2->setStyleSheet(style2); + } + if (m_screenCount > 2) { + QString style3 = QString("background-color: rgb(%1,%2,%3);") + .arg(m_screen3Color.r) + .arg(m_screen3Color.g) + .arg(m_screen3Color.b); + m_fullScreen3->setStyleSheet(style3); + } + } + bool shown = false; + if ((getBlackCapture() || m_useScreen1Overlay) && !m_isTimeLapse) { + m_fullScreen1->showFullScreen(); + m_fullScreen1->setGeometry(QApplication::desktop()->screenGeometry(0)); + shown = true; + } + if (m_screenCount > 1 && (getBlackCapture() || m_useScreen2Overlay) && + !m_isTimeLapse) { + m_fullScreen2->showFullScreen(); + m_fullScreen2->setGeometry(QApplication::desktop()->screenGeometry(1)); + shown = true; + } + if (m_screenCount > 2 && (getBlackCapture() || m_useScreen3Overlay) && + !m_isTimeLapse) { + m_fullScreen3->showFullScreen(); + m_fullScreen3->setGeometry(QApplication::desktop()->screenGeometry(2)); + shown = true; + } + + if (shown) { + // this allows the full screen qdialogs to go full screen before + // taking a photo + qApp->processEvents(QEventLoop::AllEvents, 1500); + } +} + +//----------------------------------------------------------------- + +void StopMotion::hideOverlays() { + if ((getBlackCapture() || m_useScreen1Overlay)) { + m_fullScreen1->hide(); + } + if (m_screenCount > 1 && (getBlackCapture() || m_useScreen2Overlay)) { + m_fullScreen2->hide(); + } + if (m_screenCount > 2 && (getBlackCapture() || m_useScreen3Overlay)) { + m_fullScreen3->hide(); + } +} + +//----------------------------------------------------------------- + void StopMotion::setPlaceOnXSheet(bool on) { m_placeOnXSheet = on; StopMotionPlaceOnXSheet = int(on); @@ -660,65 +774,63 @@ void StopMotion::setDrawBeneathLevels(bool on) { //----------------------------------------------------------------- void StopMotion::toggleInterval(bool on) { - m_isTimeLapse = on; - emit(intervalToggled(on)); + m_isTimeLapse = on; + emit(intervalToggled(on)); } //----------------------------------------------------------------- void StopMotion::startInterval() { - if (m_liveViewStatus > 1) { - m_intervalTimer->start(m_intervalTime * 1000); - if (m_intervalTime != 0) m_countdownTimer->start(100); - m_intervalStarted = true; - emit(intervalStarted()); - } - else { - DVGui::warning(tr("Please start live view before using time lapse.")); - m_intervalStarted = false; - emit(intervalStopped()); - } + if (m_liveViewStatus > 1) { + m_intervalTimer->start(m_intervalTime * 1000); + if (m_intervalTime != 0) m_countdownTimer->start(100); + m_intervalStarted = true; + emit(intervalStarted()); + } else { + DVGui::warning(tr("Please start live view before using time lapse.")); + m_intervalStarted = false; + emit(intervalStopped()); + } } //----------------------------------------------------------------- void StopMotion::stopInterval() { - m_intervalTimer->stop(); - m_countdownTimer->stop(); - m_intervalStarted = false; - emit(intervalStopped()); + m_intervalTimer->stop(); + m_countdownTimer->stop(); + m_intervalStarted = false; + emit(intervalStopped()); } //----------------------------------------------------------------- void StopMotion::setIntervalAmount(int value) { - m_intervalTime = value; - emit(intervalAmountChanged(value)); + m_intervalTime = value; + emit(intervalAmountChanged(value)); } //----------------------------------------------------------------- void StopMotion::onIntervalCaptureTimerTimeout() { - if (m_liveViewStatus > 0) { - captureImage(); - } - else { - DVGui::warning(tr("Please start live view before using time lapse.")); - m_intervalStarted = false; - emit(intervalStopped()); - } + if (m_liveViewStatus > 0) { + captureImage(); + } else { + DVGui::warning(tr("Please start live view before using time lapse.")); + m_intervalStarted = false; + emit(intervalStopped()); + } } //----------------------------------------------------------------- void StopMotion::restartInterval() { - // restart interval timer for capturing next frame (it is single shot) - if (m_isTimeLapse && m_intervalStarted) { - m_intervalTimer->start(m_intervalTime * 1000); - // restart the count down as well (for aligning the timing. It is not - // single shot) - if (m_intervalTime != 0) m_countdownTimer->start(100); - } + // restart interval timer for capturing next frame (it is single shot) + if (m_isTimeLapse && m_intervalStarted) { + m_intervalTimer->start(m_intervalTime * 1000); + // restart the count down as well (for aligning the timing. It is not + // single shot) + if (m_intervalTime != 0) m_countdownTimer->start(100); + } } //----------------------------------------------------------------- @@ -1408,17 +1520,7 @@ void StopMotion::onReviewTimeout() { //----------------------------------------------------------------------------- bool StopMotion::importImage() { - if (getBlackCapture()) { - m_fullScreen1->hide(); - - if (m_screenCount > 1) { - m_fullScreen2->hide(); - - if (m_screenCount == 3) { - m_fullScreen3->hide(); - } - } - } + hideOverlays(); TApp *app = TApp::instance(); ToonzScene *scene = app->getCurrentScene()->getScene(); @@ -1740,6 +1842,9 @@ void StopMotion::captureImage() { tr("Cannot capture webcam image unless live view is active.")); return; } + + showOverlays(); + if (getReviewTime() > 0 && !m_isTimeLapse) { m_timer->stop(); if (m_liveViewStatus > LiveViewClosed) { @@ -1752,22 +1857,7 @@ void StopMotion::captureImage() { importImage(); return; } - if (getBlackCapture() && !m_isTimeLapse) { - m_fullScreen1->showFullScreen(); - m_fullScreen1->setGeometry(QApplication::desktop()->screenGeometry(0)); - if (m_screenCount > 1) { - m_fullScreen2->showFullScreen(); - m_fullScreen2->setGeometry(QApplication::desktop()->screenGeometry(1)); - - if (m_screenCount == 3) { - m_fullScreen3->showFullScreen(); - m_fullScreen3->setGeometry(QApplication::desktop()->screenGeometry(2)); - } - } - // this allows the full screen qdialogs to go full screen before - // taking a photo - qApp->processEvents(QEventLoop::AllEvents, 1500); - } + showOverlays(); if (getReviewTime() > 0 && !m_isTimeLapse) { m_timer->stop(); @@ -2735,7 +2825,9 @@ void StopMotion::changeCameras(int index) { m_liveViewDpi = TPointD(0.0, 0.0); m_hasLineUpImage = false; m_hasLiveViewImage = false; - stopInterval(); + if (m_isTimeLapse && m_intervalStarted) { + stopInterval(); + } emit(liveViewStopped()); emit(liveViewChanged(false)); refreshFrameInfo(); diff --git a/toonz/sources/stopmotion/stopmotion.h b/toonz/sources/stopmotion/stopmotion.h index 21b403ed..1789a221 100644 --- a/toonz/sources/stopmotion/stopmotion.h +++ b/toonz/sources/stopmotion/stopmotion.h @@ -92,14 +92,19 @@ private: m_serialDevices; QDialog *m_fullScreen1, *m_fullScreen2, *m_fullScreen3; - int m_screenCount; bool m_useMjpg = true; bool m_useNumpadShortcuts = false; bool m_numpadForStyleSwitching = true; bool m_turnOnRewind = false; + bool m_useScreen1Overlay = false; + bool m_useScreen2Overlay = false; + bool m_useScreen3Overlay = false; + QTimer* m_reviewTimer; - + TPixel32 m_screen1Color, m_screen2Color, + m_screen3Color = TPixel32(0, 0, 0, 255); + std::map m_oldActionMap; // Webcam Properties @@ -162,9 +167,10 @@ public: QString m_tempFile; QTimer* m_timer; QList m_webcamResolutions; - int m_intervalTime = 10; + int m_intervalTime = 10; + int m_screenCount = 1; bool m_intervalStarted = false; - QTimer* m_intervalTimer, * m_countdownTimer; + QTimer *m_intervalTimer, *m_countdownTimer; // Canon Public Properties bool m_pickLiveViewZoom = false; @@ -239,14 +245,28 @@ public: void nextName(); void previousName(); QStringList getAvailableSerialPorts(); + + // motion control bool setSerialPort(QString port); void sendSerialData(); + + // time lapse void toggleInterval(bool on); void startInterval(); void stopInterval(); void setIntervalAmount(int value); void restartInterval(); + // light and screens + void setScreen1Color(TPixel32 color); + void setScreen2Color(TPixel32 color); + void setScreen3Color(TPixel32 color); + void setScreen1UseOverlay(bool on); + void setScreen2UseOverlay(bool on); + void setScreen3UseOverlay(bool on); + void showOverlays(); + void hideOverlays(); + QString getFrameInfoText() { return m_frameInfoText; } QString getInfoColorName() { return m_infoColorName; } QString getFrameInfoToolTip() { return m_frameInfoToolTip; } @@ -422,10 +442,20 @@ signals: void useDirectShowSignal(bool); void reviewTimeChangedSignal(int); void updateCameraList(QString); + + // time lapse void intervalToggled(bool); void intervalStarted(); void intervalStopped(); void intervalAmountChanged(int); + + // light and screens + void screen1ColorChanged(TPixel32); + void screen2ColorChanged(TPixel32); + void screen3ColorChanged(TPixel32); + void screen1OverlayChanged(bool); + void screen2OverlayChanged(bool); + void screen3OverlayChanged(bool); }; #endif // STOPMOTION_H \ No newline at end of file diff --git a/toonz/sources/stopmotion/stopmotioncontroller.cpp b/toonz/sources/stopmotion/stopmotioncontroller.cpp index e6e0625b..384b6d10 100644 --- a/toonz/sources/stopmotion/stopmotioncontroller.cpp +++ b/toonz/sources/stopmotion/stopmotioncontroller.cpp @@ -182,12 +182,14 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { m_tabBar->addSimpleTab(tr("Controls")); m_tabBar->addSimpleTab(tr("Settings")); m_tabBar->addSimpleTab(tr("Options")); - // m_tabBar->addSimpleTab(tr("Control")); + m_tabBar->addSimpleTab(tr("Light")); + m_tabBar->addSimpleTab(tr("Motion")); m_tabBarContainer = new TabBarContainter(this); - m_mainControlsPage = new QFrame(); - m_cameraSettingsPage = new QFrame(); - m_optionsPage = new QFrame(); - // m_controlPage = new QFrame(); + m_mainControlsPage = new QFrame(this); + m_cameraSettingsPage = new QFrame(this); + m_optionsPage = new QFrame(this); + m_motionPage = new QFrame(this); + m_lightPage = new QFrame(this); // ********************** // Make Control Page @@ -222,12 +224,9 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { // (frame 10 is displayed as "1" with this option) int startFrame = Preferences::instance()->isShowFrameNumberWithLettersEnabled() ? 10 : 1; - m_frameNumberEdit = new FrameNumberLineEdit(this, startFrame); - m_frameInfoLabel = new QLabel("", this); - m_fileTypeCombo = new QComboBox(this); - m_fileFormatOptionButton = new QPushButton(tr("Options"), this); - m_fileFormatOptionButton->setFixedHeight(28); - m_fileFormatOptionButton->setStyleSheet("padding: 0 2;"); + m_frameNumberEdit = new FrameNumberLineEdit(this, startFrame); + m_frameInfoLabel = new QLabel("", this); + m_xSheetFrameNumberEdit = new DVGui::IntLineEdit(this, 1, 1); m_saveInFileFld = new DVGui::FileField(this, m_saveInFolderPopup->getParentPath()); @@ -241,9 +240,16 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { m_previousXSheetFrameButton = new QToolButton(this); m_onionOpacityFld = new DVGui::IntField(this); m_captureButton = new QPushButton(tr("Capture"), this); + + // choosing the file type is disabled for simplicty + // too many options can be a bad thing + // m_fileTypeCombo = new QComboBox(this); + // m_fileFormatOptionButton = new QPushButton(tr("Options"), this); + // m_fileFormatOptionButton->setFixedHeight(28); + // m_fileFormatOptionButton->setStyleSheet("padding: 0 2;"); // QPushButton *subfolderButton = new QPushButton(tr("Subfolder"), this); - m_fileTypeCombo->addItems({"jpg", "png", "tga", "tif"}); - m_fileTypeCombo->setCurrentIndex(0); + // m_fileTypeCombo->addItems({"jpg", "png", "tga", "tif"}); + // m_fileTypeCombo->setCurrentIndex(0); fileFrame->setObjectName("CleanupSettingsFrame"); m_frameNumberEdit->setObjectName("LargeSizedText"); @@ -398,16 +404,16 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { levelLay->setColumnStretch(1, 1); fileLay->addLayout(levelLay, 0); - QHBoxLayout *fileTypeLay = new QHBoxLayout(); - fileTypeLay->setMargin(0); - fileTypeLay->setSpacing(3); - { - fileTypeLay->addWidget(new QLabel(tr("File Type:"), this), 0); - fileTypeLay->addWidget(m_fileTypeCombo, 1); - fileTypeLay->addSpacing(10); - fileTypeLay->addWidget(m_fileFormatOptionButton); - } - fileLay->addLayout(fileTypeLay, 0); + // QHBoxLayout *fileTypeLay = new QHBoxLayout(); + // fileTypeLay->setMargin(0); + // fileTypeLay->setSpacing(3); + //{ + // fileTypeLay->addWidget(new QLabel(tr("File Type:"), this), 0); + // fileTypeLay->addWidget(m_fileTypeCombo, 1); + // fileTypeLay->addSpacing(10); + // fileTypeLay->addWidget(m_fileFormatOptionButton); + //} + // fileLay->addLayout(fileTypeLay, 0); QHBoxLayout *saveInLay = new QHBoxLayout(); saveInLay->setMargin(0); @@ -553,7 +559,6 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { // Make Options Page QGroupBox *webcamBox = new QGroupBox(tr("Webcam Options"), this); QGroupBox *dslrBox = new QGroupBox(tr("DSLR Options"), this); - QGroupBox *controlBox = new QGroupBox(tr("Motion Control"), this); QGroupBox *timerFrame = new QGroupBox(tr("Time Lapse"), this); m_timerCB = new QCheckBox(tr("Use time lapse"), this); m_timerIntervalFld = new DVGui::IntField(this); @@ -569,7 +574,6 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { m_subsamplingFld = new DVGui::IntField(this); m_subsamplingFld->setRange(1, 30); m_subsamplingFld->setDisabled(true); - m_blackScreenForCapture = new QCheckBox(this); m_placeOnXSheetCB = new QCheckBox(this); m_placeOnXSheetCB->setToolTip(tr("Place the frame in the XSheet")); @@ -581,9 +585,6 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { m_useNumpadCB = new QCheckBox(this); m_drawBeneathCB = new QCheckBox(this); - m_controlDeviceCombo = new QComboBox(this); - m_controlDeviceCombo->addItems(m_stopMotion->getAvailableSerialPorts()); - m_liveViewOnAllFramesCB = new QCheckBox(this); QVBoxLayout *optionsOutsideLayout = new QVBoxLayout; QGridLayout *optionsLayout = new QGridLayout; @@ -591,12 +592,8 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { optionsLayout->setMargin(5); QGridLayout *webcamLayout = new QGridLayout; QGridLayout *dslrLayout = new QGridLayout; - QGridLayout *controlLayout = new QGridLayout; QGridLayout *checkboxLayout = new QGridLayout; - dslrLayout->addWidget(m_blackScreenForCapture, 0, 0, Qt::AlignRight); - dslrLayout->addWidget(new QLabel(tr("Black Screen for Capture")), 0, 1, - Qt::AlignLeft); dslrLayout->addWidget(m_useScaledFullSizeImages, 1, 0, Qt::AlignRight); dslrLayout->addWidget(new QLabel(tr("Use Reduced Resolution Images")), 1, 1, Qt::AlignLeft); @@ -615,13 +612,6 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { webcamBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); optionsOutsideLayout->addWidget(webcamBox, Qt::AlignCenter); - controlLayout->addWidget(new QLabel(tr("Port: ")), 0, 0, Qt::AlignRight); - controlLayout->addWidget(m_controlDeviceCombo, 0, 1, Qt::AlignLeft); - controlLayout->setColumnStretch(1, 30); - controlBox->setLayout(controlLayout); - controlBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); - optionsOutsideLayout->addWidget(controlBox, Qt::AlignCenter); - QGridLayout *timerLay = new QGridLayout(); timerLay->setMargin(8); timerLay->setHorizontalSpacing(3); @@ -641,16 +631,18 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { checkboxLayout->addWidget(m_placeOnXSheetCB, 0, 0, 1, 1, Qt::AlignRight); checkboxLayout->addWidget(new QLabel(tr("Place on XSheet")), 0, 1, Qt::AlignLeft); - checkboxLayout->addWidget(m_useNumpadCB, 1, 0, Qt::AlignRight); - checkboxLayout->addWidget( - new QLabel(tr("Use Numpad Shortcuts When Active")), 1, 1, - Qt::AlignLeft); - checkboxLayout->addWidget(m_liveViewOnAllFramesCB, 2, 0, Qt::AlignRight); - checkboxLayout->addWidget(new QLabel(tr("Show Live View on All Frames")), 2, - 1, Qt::AlignLeft); - checkboxLayout->addWidget(m_drawBeneathCB, 3, 0, Qt::AlignRight); + checkboxLayout->addWidget(m_drawBeneathCB, 1, 0, Qt::AlignRight); checkboxLayout->addWidget(new QLabel(tr("Show Camera Below Other Levels")), - 3, 1, Qt::AlignLeft); + 1, 1, Qt::AlignLeft); + + checkboxLayout->addWidget(m_useNumpadCB, 2, 0, Qt::AlignRight); + checkboxLayout->addWidget( + new QLabel(tr("Use Numpad Shortcuts When Active")), 2, 1, + Qt::AlignLeft); + checkboxLayout->addWidget(m_liveViewOnAllFramesCB, 3, 0, Qt::AlignRight); + checkboxLayout->addWidget(new QLabel(tr("Show Live View on All Frames")), 3, + 1, Qt::AlignLeft); + checkboxLayout->setColumnStretch(1, 30); optionsOutsideLayout->addLayout(checkboxLayout, Qt::AlignLeft); @@ -667,24 +659,101 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { m_optionsPage->setLayout(optionsOutsideLayout); - // QVBoxLayout *controlOutsideLayout = new QVBoxLayout; - // QGridLayout* controlInsideLayout = new QGridLayout; + m_blackScreenForCapture = new QCheckBox(this); + QVBoxLayout *lightOutsideLayout = new QVBoxLayout; + m_testLightsButton = new QPushButton(tr("Test"), this); + m_testLightsButton->setMaximumWidth(150); + m_testLightsButton->setFixedHeight(28); + m_testLightsButton->setSizePolicy(QSizePolicy::Maximum, + QSizePolicy::Maximum); + m_testLightsButton->setStyleSheet("padding: 2px;"); + m_lightTestTimer = new QTimer(this); + m_lightTestTimer->setSingleShot(true); + m_screen1ColorFld = new DVGui::ColorField( + this, false, TPixel32(0, 0, 0, 255), 40, true, 60); + m_screen1OverlayCB = new QCheckBox(this); + m_screen1OverlayLabel = new QLabel(tr("Enable Overlay"), this); - // m_controlBaudRateCombo = new QComboBox(this); + m_screen2ColorFld = new DVGui::ColorField( + this, false, TPixel32(0, 0, 0, 255), 40, true, 60); + m_screen2OverlayCB = new QCheckBox(this); + m_screen2OverlayLabel = new QLabel(tr("Enable Overlay"), this); - // controlInsideLayout->addWidget(m_controlDeviceCombo, 0, 0, 1, 2, - // Qt::AlignCenter); - // controlInsideLayout->addWidget(m_controlBaudRateCombo, 1, 0, 1, 2, - // Qt::AlignCenter); - // controlOutsideLayout->addLayout(controlInsideLayout); - // m_controlPage->setLayout(controlOutsideLayout); + m_screen3ColorFld = new DVGui::ColorField( + this, false, TPixel32(0, 0, 0, 255), 40, true, 60); + m_screen3OverlayCB = new QCheckBox(this); + m_screen3OverlayLabel = new QLabel(tr("Enable Overlay"), this); + + QGridLayout *lightTopLayout = new QGridLayout; + lightTopLayout->addWidget(m_blackScreenForCapture, 0, 0, Qt::AlignRight); + lightTopLayout->addWidget(new QLabel(tr("Blackout all Screens")), 0, 1, + Qt::AlignLeft); + lightTopLayout->setColumnStretch(1, 30); + lightOutsideLayout->addLayout(lightTopLayout); + + m_screen1Box = new QGroupBox(tr("Screen 1"), this); + QGridLayout *screen1Layout = new QGridLayout; + screen1Layout->addWidget(m_screen1OverlayCB, 0, 0, Qt::AlignRight); + screen1Layout->addWidget(m_screen1OverlayLabel, 0, 1, Qt::AlignLeft); + screen1Layout->addWidget(m_screen1ColorFld, 1, 0, 1, 2, Qt::AlignLeft); + screen1Layout->setColumnStretch(1, 30); + m_screen1Box->setLayout(screen1Layout); + m_screen1Box->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); + lightOutsideLayout->addWidget(m_screen1Box, Qt::AlignCenter); + + m_screen2Box = new QGroupBox(tr("Screen 2"), this); + QGridLayout *screen2Layout = new QGridLayout; + screen2Layout->addWidget(m_screen2OverlayCB, 0, 0, Qt::AlignRight); + screen2Layout->addWidget(m_screen2OverlayLabel, 0, 1, Qt::AlignLeft); + screen2Layout->addWidget(m_screen2ColorFld, 1, 0, 1, 2, Qt::AlignLeft); + screen2Layout->setColumnStretch(1, 30); + m_screen2Box->setLayout(screen2Layout); + m_screen2Box->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); + lightOutsideLayout->addWidget(m_screen2Box, Qt::AlignCenter); + + m_screen3Box = new QGroupBox(tr("Screen 3"), this); + QGridLayout *screen3Layout = new QGridLayout; + screen3Layout->addWidget(m_screen3OverlayCB, 0, 0, Qt::AlignRight); + screen3Layout->addWidget(m_screen3OverlayLabel, 0, 1, Qt::AlignLeft); + screen3Layout->addWidget(m_screen3ColorFld, 1, 0, 1, 2, Qt::AlignLeft); + screen3Layout->setColumnStretch(1, 30); + m_screen3Box->setLayout(screen3Layout); + m_screen3Box->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); + lightOutsideLayout->addWidget(m_screen3Box, Qt::AlignCenter); + + QHBoxLayout *testLayout = new QHBoxLayout; + testLayout->addWidget(m_testLightsButton, Qt::AlignHCenter); + lightOutsideLayout->addLayout(testLayout); + lightOutsideLayout->addStretch(); + m_lightPage->setLayout(lightOutsideLayout); + + if (m_stopMotion->m_screenCount < 3) m_screen3Box->hide(); + if (m_stopMotion->m_screenCount < 2) m_screen2Box->hide(); + + QVBoxLayout *motionOutsideLayout = new QVBoxLayout; + // QGridLayout* motionInsideLayout = new QGridLayout; + m_controlDeviceCombo = new QComboBox(this); + m_controlDeviceCombo->addItems(m_stopMotion->getAvailableSerialPorts()); + + QGroupBox *motionBox = new QGroupBox(tr("Motion Control"), this); + QGridLayout *motionLayout = new QGridLayout; + motionLayout->addWidget(new QLabel(tr("Port: ")), 0, 0, Qt::AlignRight); + motionLayout->addWidget(m_controlDeviceCombo, 0, 1, Qt::AlignLeft); + motionLayout->setColumnStretch(1, 30); + motionBox->setLayout(motionLayout); + motionBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum); + motionOutsideLayout->addWidget(motionBox, Qt::AlignCenter); + motionOutsideLayout->addStretch(); + + // motionOutsideLayout->addLayout(motionInsideLayout); + m_motionPage->setLayout(motionOutsideLayout); QScrollArea *mainArea = makeChooserPageWithoutScrollBar(m_mainControlsPage); QScrollArea *settingsArea = makeChooserPageWithoutScrollBar(m_cameraSettingsPage); QScrollArea *optionsArea = makeChooserPageWithoutScrollBar(m_optionsPage); - // QScrollArea* controlArea = - // makeChooserPageWithoutScrollBar(m_controlPage); + QScrollArea *lightArea = makeChooserPageWithoutScrollBar(m_lightPage); + QScrollArea *motionArea = makeChooserPageWithoutScrollBar(m_motionPage); mainArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); settingsArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); @@ -694,7 +763,8 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { m_stackedChooser->addWidget(mainArea); m_stackedChooser->addWidget(settingsArea); m_stackedChooser->addWidget(optionsArea); - // m_stackedChooser->addWidget(controlArea); + m_stackedChooser->addWidget(lightArea); + m_stackedChooser->addWidget(motionArea); m_stackedChooser->setFocusPolicy(Qt::NoFocus); QFrame *opacityFrame = new QFrame(); @@ -757,8 +827,8 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { if (m_captureFilterSettingsBtn) ret = ret && connect(m_captureFilterSettingsBtn, SIGNAL(pressed()), this, SLOT(onCaptureFilterSettingsBtnPressed())); - ret = ret && connect(m_fileFormatOptionButton, SIGNAL(pressed()), this, - SLOT(onFileFormatOptionButtonPressed())); + // ret = ret && connect(m_fileFormatOptionButton, SIGNAL(pressed()), this, + // SLOT(onFileFormatOptionButtonPressed())); ret = ret && connect(m_levelNameEdit, SIGNAL(levelNameEdited()), this, SLOT(onLevelNameEdited())); ret = ret && @@ -789,8 +859,8 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { // SLOT(openSaveInFolderPopup())); ret = ret && connect(m_saveInFileFld, SIGNAL(pathChanged()), this, SLOT(onSaveInPathEdited())); - ret = ret && connect(m_fileTypeCombo, SIGNAL(activated(int)), this, - SLOT(onFileTypeActivated())); + // ret = ret && connect(m_fileTypeCombo, SIGNAL(activated(int)), this, + // SLOT(onFileTypeActivated())); ret = ret && connect(m_frameNumberEdit, SIGNAL(editingFinished()), this, SLOT(onFrameNumberChanged())); ret = ret && connect(m_xSheetFrameNumberEdit, SIGNAL(editingFinished()), this, @@ -801,8 +871,8 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { SLOT(onFilePathChanged(QString))); ret = ret && connect(m_stopMotion, SIGNAL(levelNameChanged(QString)), this, SLOT(onLevelNameChanged(QString))); - ret = ret && connect(m_stopMotion, SIGNAL(fileTypeChanged(QString)), this, - SLOT(onFileTypeChanged(QString))); + // ret = ret && connect(m_stopMotion, SIGNAL(fileTypeChanged(QString)), this, + // SLOT(onFileTypeChanged(QString))); ret = ret && connect(m_stopMotion, SIGNAL(frameInfoTextChanged(QString)), this, SLOT(onFrameInfoTextChanged(QString))); ret = ret && connect(m_stopMotion, SIGNAL(xSheetFrameNumberChanged(int)), @@ -952,6 +1022,39 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { ret = ret && connect(m_stopMotion, SIGNAL(newWebcamResolutionSelected(int)), this, SLOT(onNewWebcamResolutionSelected(int))); + // Lighting Connections + ret = ret && + connect(m_screen1ColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)), + this, SLOT(setScreen1Color(const TPixel32 &, bool))); + ret = ret && + connect(m_screen2ColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)), + this, SLOT(setScreen2Color(const TPixel32 &, bool))); + ret = ret && + connect(m_screen3ColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)), + this, SLOT(setScreen3Color(const TPixel32 &, bool))); + ret = ret && connect(m_screen1OverlayCB, SIGNAL(toggled(bool)), this, + SLOT(onScreen1OverlayToggled(bool))); + ret = ret && connect(m_screen2OverlayCB, SIGNAL(toggled(bool)), this, + SLOT(onScreen2OverlayToggled(bool))); + ret = ret && connect(m_screen3OverlayCB, SIGNAL(toggled(bool)), this, + SLOT(onScreen3OverlayToggled(bool))); + ret = ret && connect(m_lightTestTimer, SIGNAL(timeout()), this, + SLOT(onTestLightsTimeout())); + ret = ret && connect(m_testLightsButton, SIGNAL(pressed()), this, + SLOT(onTestLightsPressed())); + ret = ret && connect(m_stopMotion, SIGNAL(screen1ColorChanged(TPixel32)), + this, SLOT(onScreen1ColorChanged(TPixel32))); + ret = ret && connect(m_stopMotion, SIGNAL(screen2ColorChanged(TPixel32)), + this, SLOT(onScreen2ColorChanged(TPixel32))); + ret = ret && connect(m_stopMotion, SIGNAL(screen3ColorChanged(TPixel32)), + this, SLOT(onScreen3ColorChanged(TPixel32))); + ret = ret && connect(m_stopMotion, SIGNAL(screen1OverlayChanged(bool)), this, + SLOT(onScreen1OverlayChanged(bool))); + ret = ret && connect(m_stopMotion, SIGNAL(screen2OverlayChanged(bool)), this, + SLOT(onScreen2OverlayChanged(bool))); + ret = ret && connect(m_stopMotion, SIGNAL(screen3OverlayChanged(bool)), this, + SLOT(onScreen3OverlayChanged(bool))); + // Serial Port Connections ret = ret && connect(m_controlDeviceCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(serialPortChanged(int))); @@ -960,19 +1063,19 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { ret = ret && connect(m_timerCB, SIGNAL(toggled(bool)), this, SLOT(onIntervalTimerCBToggled(bool))); ret = ret && connect(m_timerIntervalFld, SIGNAL(valueChanged(bool)), this, - SLOT(onIntervalSliderValueChanged(bool))); + SLOT(onIntervalSliderValueChanged(bool))); ret = ret && connect(m_stopMotion, SIGNAL(intervalAmountChanged(int)), this, - SLOT(onIntervalAmountChanged(int))); + SLOT(onIntervalAmountChanged(int))); ret = ret && connect(m_stopMotion, SIGNAL(intervalToggled(bool)), this, - SLOT(onIntervalToggled(bool))); + SLOT(onIntervalToggled(bool))); ret = ret && connect(m_stopMotion, SIGNAL(intervalStarted()), this, - SLOT(onIntervalStarted())); + SLOT(onIntervalStarted())); ret = ret && connect(m_stopMotion, SIGNAL(intervalStopped()), this, - SLOT(onIntervalStopped())); + SLOT(onIntervalStopped())); ret = ret && connect(m_stopMotion->m_intervalTimer, SIGNAL(timeout()), this, SLOT(onIntervalCaptureTimerTimeout())); - ret = ret && - connect(m_stopMotion->m_countdownTimer, SIGNAL(timeout()), this, SLOT(onIntervalCountDownTimeout())); + ret = ret && connect(m_stopMotion->m_countdownTimer, SIGNAL(timeout()), this, + SLOT(onIntervalCountDownTimeout())); assert(ret); @@ -987,12 +1090,22 @@ StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) { m_liveViewOnAllFramesCB->setChecked(m_stopMotion->getAlwaysLiveView()); m_blackScreenForCapture->setChecked( m_stopMotion->getBlackCapture() == true ? true : false); + if (m_stopMotion->getBlackCapture()) { + m_screen1Box->setDisabled(true); + m_screen2Box->setDisabled(true); + m_screen3Box->setDisabled(true); + } m_postCaptureReviewFld->setValue(m_stopMotion->getReviewTime()); refreshCameraList(QString("")); onSceneSwitched(); m_stopMotion->setToNextNewLevel(); m_saveInFileFld->setPath(m_stopMotion->getFilePath()); + +#ifndef _WIN32 + m_directShowCB->hide(); + m_directShowLabel->hide(); +#endif } //----------------------------------------------------------------------------- @@ -1041,7 +1154,112 @@ void StopMotionController::onBlackScreenForCaptureChanged(int checked) { //----------------------------------------------------------------------------- void StopMotionController::onBlackCaptureSignal(bool on) { + m_blackScreenForCapture->blockSignals(true); m_blackScreenForCapture->setChecked(on); + m_screen1Box->setDisabled(on); + m_screen2Box->setDisabled(on); + m_screen3Box->setDisabled(on); + m_blackScreenForCapture->blockSignals(false); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::setScreen1Color(const TPixel32 &bgColor, + bool isDragging) { + m_stopMotion->setScreen1Color(bgColor); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::setScreen2Color(const TPixel32 &bgColor, + bool isDragging) { + m_stopMotion->setScreen2Color(bgColor); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::setScreen3Color(const TPixel32 &bgColor, + bool isDragging) { + m_stopMotion->setScreen3Color(bgColor); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen1OverlayToggled(bool on) { + m_stopMotion->setScreen1UseOverlay(on); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen2OverlayToggled(bool on) { + m_stopMotion->setScreen2UseOverlay(on); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen3OverlayToggled(bool on) { + m_stopMotion->setScreen3UseOverlay(on); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen1ColorChanged(TPixel32 color) { + m_screen1ColorFld->blockSignals(true); + m_screen1ColorFld->setColor(color); + m_screen1ColorFld->blockSignals(false); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen2ColorChanged(TPixel32 color) { + m_screen2ColorFld->blockSignals(true); + m_screen2ColorFld->setColor(color); + m_screen2ColorFld->blockSignals(false); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen3ColorChanged(TPixel32 color) { + m_screen3ColorFld->blockSignals(true); + m_screen3ColorFld->setColor(color); + m_screen3ColorFld->blockSignals(false); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen1OverlayChanged(bool on) { + m_screen1OverlayCB->blockSignals(true); + m_screen1OverlayCB->setChecked(on); + m_screen1OverlayCB->blockSignals(false); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen2OverlayChanged(bool on) { + m_screen2OverlayCB->blockSignals(true); + m_screen2OverlayCB->setChecked(on); + m_screen2OverlayCB->blockSignals(false); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onScreen3OverlayChanged(bool on) { + m_screen3OverlayCB->blockSignals(true); + m_screen3OverlayCB->setChecked(on); + m_screen3OverlayCB->blockSignals(false); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onTestLightsPressed() { + m_stopMotion->showOverlays(); + m_lightTestTimer->start(2000); +} + +//----------------------------------------------------------------------------- + +void StopMotionController::onTestLightsTimeout() { + m_stopMotion->hideOverlays(); } //----------------------------------------------------------------------------- @@ -1159,11 +1377,11 @@ void StopMotionController::onLevelNameChanged(QString levelName) { m_levelNameEdit->setText(levelName); } -//----------------------------------------------------------------------------- - -void StopMotionController::onFileTypeChanged(QString fileType) { - m_fileTypeCombo->setCurrentText(fileType); -} +////----------------------------------------------------------------------------- +// +// void StopMotionController::onFileTypeChanged(QString fileType) { +// m_fileTypeCombo->setCurrentText(fileType); +//} //----------------------------------------------------------------------------- @@ -1601,17 +1819,17 @@ void StopMotionController::onCaptureFilterSettingsBtnPressed() { } } -//----------------------------------------------------------------------------- - -void StopMotionController::onFileFormatOptionButtonPressed() { - if (m_fileTypeCombo->currentIndex() == 0) return; - // Tentatively use the preview output settings - ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene(); - if (!scene) return; - TOutputProperties *prop = scene->getProperties()->getPreviewProperties(); - std::string ext = m_fileTypeCombo->currentText().toStdString(); - openFormatSettingsPopup(this, ext, prop->getFileFormatProperties(ext)); -} +////----------------------------------------------------------------------------- +// +// void StopMotionController::onFileFormatOptionButtonPressed() { +// if (m_fileTypeCombo->currentIndex() == 0) return; +// // Tentatively use the preview output settings +// ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene(); +// if (!scene) return; +// TOutputProperties *prop = scene->getProperties()->getPreviewProperties(); +// std::string ext = m_fileTypeCombo->currentText().toStdString(); +// openFormatSettingsPopup(this, ext, prop->getFileFormatProperties(ext)); +//} //----------------------------------------------------------------------------- @@ -2096,11 +2314,11 @@ void StopMotionController::onCaptureButtonClicked(bool on) { if (m_timerCB->isChecked()) { // start interval capturing if (on) { - m_stopMotion->startInterval(); + m_stopMotion->startInterval(); } // stop interval capturing else { - m_stopMotion->stopInterval(); + m_stopMotion->stopInterval(); } } // capture immediately @@ -2112,13 +2330,13 @@ void StopMotionController::onCaptureButtonClicked(bool on) { //----------------------------------------------------------------------------- void StopMotionController::onIntervalTimerCBToggled(bool on) { - m_stopMotion->toggleInterval(on); + m_stopMotion->toggleInterval(on); } //----------------------------------------------------------------------------- void StopMotionController::onIntervalSliderValueChanged(bool on) { - m_stopMotion->setIntervalAmount(m_timerIntervalFld->getValue()); + m_stopMotion->setIntervalAmount(m_timerIntervalFld->getValue()); } //----------------------------------------------------------------------------- @@ -2133,47 +2351,48 @@ void StopMotionController::onIntervalCaptureTimerTimeout() { void StopMotionController::onIntervalCountDownTimeout() { m_captureButton->setText(QString::number( - m_stopMotion->m_intervalTimer->isActive() ? (m_stopMotion->m_intervalTimer->remainingTime() / 1000 + 1) - : 0)); + m_stopMotion->m_intervalTimer->isActive() + ? (m_stopMotion->m_intervalTimer->remainingTime() / 1000 + 1) + : 0)); } //----------------------------------------------------------------------------- void StopMotionController::onIntervalAmountChanged(int value) { - m_timerIntervalFld->blockSignals(true); - m_timerIntervalFld->setValue(value); - m_timerIntervalFld->blockSignals(false); + m_timerIntervalFld->blockSignals(true); + m_timerIntervalFld->setValue(value); + m_timerIntervalFld->blockSignals(false); } //----------------------------------------------------------------------------- void StopMotionController::onIntervalToggled(bool on) { - m_timerCB->blockSignals(true); - m_timerIntervalFld->setEnabled(on); - m_captureButton->setCheckable(on); - if (on) - m_captureButton->setText(tr("Start Capturing")); - else - m_captureButton->setText(tr("Capture")); - m_timerCB->blockSignals(false); + m_timerCB->blockSignals(true); + m_timerIntervalFld->setEnabled(on); + m_captureButton->setCheckable(on); + if (on) + m_captureButton->setText(tr("Start Capturing")); + else + m_captureButton->setText(tr("Capture")); + m_timerCB->blockSignals(false); } //----------------------------------------------------------------------------- void StopMotionController::onIntervalStarted() { - m_captureButton->setText(tr("Stop Capturing")); - m_timerCB->setDisabled(true); - m_timerIntervalFld->setDisabled(true); - m_captureButton->blockSignals(true); - m_captureButton->setChecked(true); - m_captureButton->blockSignals(false); + m_captureButton->setText(tr("Stop Capturing")); + m_timerCB->setDisabled(true); + m_timerIntervalFld->setDisabled(true); + m_captureButton->blockSignals(true); + m_captureButton->setChecked(true); + m_captureButton->blockSignals(false); } //----------------------------------------------------------------------------- void StopMotionController::onIntervalStopped() { - m_captureButton->setText(tr("Start Capturing")); - m_timerCB->setDisabled(false); - m_timerIntervalFld->setDisabled(false); - m_captureButton->blockSignals(true); - m_captureButton->setChecked(false); - m_captureButton->blockSignals(false); + m_captureButton->setText(tr("Start Capturing")); + m_timerCB->setDisabled(false); + m_timerIntervalFld->setDisabled(false); + m_captureButton->blockSignals(true); + m_captureButton->setChecked(false); + m_captureButton->blockSignals(false); } //----------------------------------------------------------------------------- @@ -2190,11 +2409,11 @@ void StopMotionController::openSaveInFolderPopup() { } } -//----------------------------------------------------------------------------- - -void StopMotionController::onFileTypeActivated() { - m_stopMotion->setFileType(m_fileTypeCombo->currentText()); -} +////----------------------------------------------------------------------------- +// +// void StopMotionController::onFileTypeActivated() { +// m_stopMotion->setFileType(m_fileTypeCombo->currentText()); +//} //----------------------------------------------------------------------------- diff --git a/toonz/sources/stopmotion/stopmotioncontroller.h b/toonz/sources/stopmotion/stopmotioncontroller.h index a597a469..b9605aa2 100644 --- a/toonz/sources/stopmotion/stopmotioncontroller.h +++ b/toonz/sources/stopmotion/stopmotioncontroller.h @@ -10,6 +10,7 @@ // TnzQt includes #include "toonzqt/tabbar.h" #include "toonzqt/gutil.h" +#include "toonzqt/colorfield.h" // Qt includes #include @@ -48,6 +49,7 @@ class QPushButton; class QTabWidget; class QToolBar; class QTimer; +class QGroupBox; //============================================================================= // StopMotionController @@ -65,29 +67,32 @@ class StopMotionController final : public QWidget { QFrame *m_mainControlsPage; QFrame *m_cameraSettingsPage; QFrame *m_optionsPage; - // QFrame* m_controlPage; + QFrame *m_motionPage; + QFrame *m_lightPage; QStackedWidget *m_stackedChooser; - TabBarContainter *m_tabBarContainer; //!< Tabs container for style types. + TabBarContainter *m_tabBarContainer; //!< Tabs container for pages QPushButton *m_toggleLiveViewButton, *m_setToCurrentXSheetFrameButton; - QPushButton *m_fileFormatOptionButton, *m_captureButton, *m_zoomButton, + QPushButton *m_captureButton, *m_zoomButton, // *m_fileFormatOptionButton, *m_pickZoomButton, *m_focusNearButton, *m_focusFarButton, *m_focusNear2Button, *m_focusNear3Button, *m_focusFar2Button, - *m_focusFar3Button, *m_captureFilterSettingsBtn; + *m_focusFar3Button, *m_captureFilterSettingsBtn, *m_testLightsButton; QHBoxLayout *m_focusAndZoomLayout; QLabel *m_frameInfoLabel, *m_cameraSettingsLabel, *m_cameraModeLabel, *m_resolutionLabel, *m_directShowLabel, *m_cameraStatusLabel, - *m_apertureLabel, *m_kelvinValueLabel, *m_isoLabel, *m_shutterSpeedLabel; + *m_apertureLabel, *m_kelvinValueLabel, *m_isoLabel, *m_shutterSpeedLabel, + *m_screen1OverlayLabel, *m_screen2OverlayLabel, *m_screen3OverlayLabel; QToolButton *m_previousLevelButton, *m_previousFrameButton, *m_previousXSheetFrameButton; QSlider *m_apertureSlider, *m_shutterSpeedSlider, *m_isoSlider, *m_kelvinSlider; - QComboBox *m_cameraListCombo, *m_fileTypeCombo, *m_exposureCombo, + QComboBox *m_cameraListCombo, *m_exposureCombo, // *m_fileTypeCombo, *m_whiteBalanceCombo, *m_resolutionCombo, *m_imageQualityCombo, *m_pictureStyleCombo, *m_controlDeviceCombo; LevelNameLineEdit *m_levelNameEdit; QCheckBox *m_blackScreenForCapture, *m_useScaledFullSizeImages, *m_placeOnXSheetCB, *m_directShowCB, *m_liveViewOnAllFramesCB, - *m_useMjpgCB, *m_useNumpadCB, *m_drawBeneathCB, *m_timerCB; + *m_useMjpgCB, *m_useNumpadCB, *m_drawBeneathCB, *m_timerCB, + *m_screen1OverlayCB, *m_screen2OverlayCB, *m_screen3OverlayCB; DVGui::FileField *m_saveInFileFld; DVGui::IntLineEdit *m_xSheetFrameNumberEdit; FrameNumberLineEdit *m_frameNumberEdit; @@ -95,6 +100,11 @@ class StopMotionController final : public QWidget { *m_subsamplingFld; PencilTestSaveInFolderPopup *m_saveInFolderPopup; DVGui::IntField *m_timerIntervalFld; + DVGui::ColorField *m_screen1ColorFld, *m_screen2ColorFld, *m_screen3ColorFld; + QGroupBox *m_screen1Box; + QGroupBox *m_screen2Box; + QGroupBox *m_screen3Box; + QTimer *m_lightTestTimer; public: StopMotionController(QWidget *parent = 0); @@ -116,7 +126,7 @@ protected slots: void onCameraListComboActivated(int index); void onResolutionComboActivated(const QString &itemText); void onCaptureFilterSettingsBtnPressed(); - void onFileFormatOptionButtonPressed(); + // void onFileFormatOptionButtonPressed(); void onLevelNameEdited(); void onNextName(); void onPreviousName(); @@ -124,7 +134,7 @@ protected slots: void onPreviousFrame(); void onNextNewLevel(); void onLastFrame(); - void onFileTypeActivated(); + // void onFileTypeActivated(); void onFrameNumberChanged(); void onXSheetFrameNumberChanged(); void onFrameCaptured(QImage &image); @@ -147,7 +157,11 @@ protected slots: void onPreviousXSheetFrame(); void onNextXSheetFrame(); void setToCurrentXSheetFrame(); + + // motion control void serialPortChanged(int); + + // time lapse void onIntervalTimerCBToggled(bool); void onIntervalSliderValueChanged(bool); void onIntervalCaptureTimerTimeout(); @@ -157,6 +171,22 @@ protected slots: void onIntervalStarted(); void onIntervalStopped(); + // lights and screens + void setScreen1Color(const TPixel32 &value, bool isDragging); + void setScreen2Color(const TPixel32 &value, bool isDragging); + void setScreen3Color(const TPixel32 &value, bool isDragging); + void onScreen1OverlayToggled(bool); + void onScreen2OverlayToggled(bool); + void onScreen3OverlayToggled(bool); + void onTestLightsPressed(); + void onTestLightsTimeout(); + void onScreen1ColorChanged(TPixel32); + void onScreen2ColorChanged(TPixel32); + void onScreen3ColorChanged(TPixel32); + void onScreen1OverlayChanged(bool); + void onScreen2OverlayChanged(bool); + void onScreen3OverlayChanged(bool); + // canon stuff void onApertureChanged(int index); void onShutterSpeedChanged(int index); @@ -201,7 +231,7 @@ protected slots: void onSubsamplingChanged(int); void onFilePathChanged(QString); void onLevelNameChanged(QString); - void onFileTypeChanged(QString); + // void onFileTypeChanged(QString); void onXSheetFrameNumberChanged(int); void onFrameNumberChanged(int); void onFrameInfoTextChanged(QString);