Jeremy Bullock f15907
#include "stopmotioncontroller.h"
Jeremy Bullock f15907
Jeremy Bullock f15907
// TnzLib includes
Jeremy Bullock f15907
#include "toonz/levelset.h"
Jeremy Bullock f15907
#include "toonz/preferences.h"
Jeremy Bullock f15907
#include "toonz/sceneproperties.h"
Jeremy Bullock f15907
#include "toonz/toonzscene.h"
Jeremy Bullock f15907
#include "toonz/tcamera.h"
Jeremy Bullock f15907
#include "toonz/tcolumnhandle.h"
Jeremy Bullock f15907
#include "toonz/tframehandle.h"
Jeremy Bullock f15907
#include "toonz/tscenehandle.h"
Jeremy Bullock f15907
#include "toonz/txshcell.h"
Jeremy Bullock f15907
#include "toonz/txsheethandle.h"
Jeremy Bullock f15907
#include "toonz/txshlevelhandle.h"
Jeremy Bullock f15907
#include "toonz/txshsimplelevel.h"
Jeremy Bullock f15907
#include "toonz/tstageobjecttree.h"
Jeremy Bullock f15907
Jeremy Bullock f15907
// TnzCore includes
Jeremy Bullock f15907
#include "filebrowsermodel.h"
Jeremy Bullock f15907
#include "formatsettingspopups.h"
Jeremy Bullock f15907
#include "tapp.h"
Jeremy Bullock f15907
#include "tenv.h"
Jeremy Bullock f15907
#include "tlevel_io.h"
Jeremy Bullock f15907
#include "toutputproperties.h"
Jeremy Bullock f15907
#include "tsystem.h"
Jeremy Bullock f15907
Jeremy Bullock f15907
// TnzQt includes
Jeremy Bullock f15907
#include "toonzqt/filefield.h"
Jeremy Bullock f15907
#include "toonzqt/intfield.h"
Jeremy Bullock f15907
#include "toonzqt/menubarcommand.h"
Jeremy Bullock f15907
Jeremy Bullock f15907
// Qt includes
Jeremy Bullock f15907
#include <qaction></qaction>
Jeremy Bullock f15907
#include <qapplication></qapplication>
Jeremy Bullock f15907
#include <qcamerainfo></qcamerainfo>
Jeremy Bullock f15907
#include <qcheckbox></qcheckbox>
Jeremy Bullock f15907
#include <qcombobox></qcombobox>
Jeremy Bullock f15907
#include <qcommonstyle></qcommonstyle>
Jeremy Bullock f15907
#include <qdesktopwidget></qdesktopwidget>
Jeremy Bullock f15907
#include <qgridlayout></qgridlayout>
Jeremy Bullock f15907
#include <qgroupbox></qgroupbox>
Jeremy Bullock f15907
#include <qhboxlayout></qhboxlayout>
Jeremy Bullock f15907
#include <qkeyevent></qkeyevent>
Jeremy Bullock f15907
#include <qlabel></qlabel>
Jeremy Bullock f15907
#include <qlineedit></qlineedit>
Jeremy Bullock f15907
#include <qmouseevent></qmouseevent>
Jeremy Bullock f15907
#include <qpushbutton></qpushbutton>
Jeremy Bullock f15907
#include <qslider></qslider>
Jeremy Bullock f15907
#include <qsplitter></qsplitter>
Jeremy Bullock f15907
#include <qstackedwidget></qstackedwidget>
Jeremy Bullock f15907
#include <qstring></qstring>
Jeremy Bullock f15907
#include <qtimer></qtimer>
Jeremy Bullock f15907
#include <qtoolbutton></qtoolbutton>
Jeremy Bullock f15907
#include <qtooltip></qtooltip>
Jeremy Bullock f15907
Jeremy Bullock f15907
#ifdef _WIN32
Jeremy Bullock f15907
#include <dshow.h></dshow.h>
Jeremy Bullock f15907
#endif
Jeremy Bullock f15907
Jeremy Bullock f15907
namespace {
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
#ifdef _WIN32
Jeremy Bullock f15907
void openCaptureFilterSettings(const QWidget *parent,
Jeremy Bullock f15907
                               const QString &cameraName) {
Jeremy Bullock f15907
  HRESULT hr;
Jeremy Bullock f15907
Jeremy Bullock f15907
  ICreateDevEnum *createDevEnum = NULL;
Jeremy Bullock f15907
  IEnumMoniker *enumMoniker     = NULL;
Jeremy Bullock f15907
  IMoniker *moniker             = NULL;
Jeremy Bullock f15907
Jeremy Bullock f15907
  IBaseFilter *deviceFilter;
Jeremy Bullock f15907
Jeremy Bullock f15907
  ISpecifyPropertyPages *specifyPropertyPages;
Jeremy Bullock f15907
  CAUUID cauuid;
Jeremy Bullock f15907
  // set parent's window handle in order to make the dialog modal
Jeremy Bullock f15907
  HWND ghwndApp = (HWND)(parent->winId());
Jeremy Bullock f15907
Jeremy Bullock f15907
  // initialize COM
Jeremy Bullock f15907
  CoInitialize(NULL);
Jeremy Bullock f15907
Jeremy Bullock f15907
  // get device list
Jeremy Bullock f15907
  CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER,
Jeremy Bullock f15907
                   IID_ICreateDevEnum, (PVOID *)&createDevEnum);
Jeremy Bullock f15907
Jeremy Bullock f15907
  // create EnumMoniker
Jeremy Bullock f15907
  createDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory,
Jeremy Bullock f15907
                                       &enumMoniker, 0);
Jeremy Bullock f15907
  if (enumMoniker == NULL) {
Jeremy Bullock f15907
    // if no connected devices found
Jeremy Bullock f15907
    return;
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
Jeremy Bullock f15907
  // reset EnumMoniker
Jeremy Bullock f15907
  enumMoniker->Reset();
Jeremy Bullock f15907
Jeremy Bullock f15907
  // find target camera
Jeremy Bullock f15907
  ULONG fetched      = 0;
Jeremy Bullock f15907
  bool isCameraFound = false;
Jeremy Bullock f15907
  while (hr = enumMoniker->Next(1, &moniker, &fetched), hr == S_OK) {
Jeremy Bullock f15907
    // get friendly name (= device name) of the camera
Jeremy Bullock f15907
    IPropertyBag *pPropertyBag;
Jeremy Bullock f15907
    moniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropertyBag);
Jeremy Bullock f15907
    VARIANT var;
Jeremy Bullock f15907
    var.vt = VT_BSTR;
Jeremy Bullock f15907
    VariantInit(&var);
Jeremy Bullock f15907
Jeremy Bullock f15907
    pPropertyBag->Read(L"FriendlyName", &var, 0);
Jeremy Bullock f15907
Jeremy Bullock f15907
    QString deviceName = QString::fromWCharArray(var.bstrVal);
Jeremy Bullock f15907
Jeremy Bullock f15907
    VariantClear(&var);
Jeremy Bullock f15907
Jeremy Bullock f15907
    if (deviceName == cameraName) {
Jeremy Bullock f15907
      // bind monkier to the filter
Jeremy Bullock f15907
      moniker->BindToObject(0, 0, IID_IBaseFilter, (void **)&deviceFilter);
Jeremy Bullock f15907
Jeremy Bullock f15907
      // release moniker etc.
Jeremy Bullock f15907
      moniker->Release();
Jeremy Bullock f15907
      enumMoniker->Release();
Jeremy Bullock f15907
      createDevEnum->Release();
Jeremy Bullock f15907
Jeremy Bullock f15907
      isCameraFound = true;
Jeremy Bullock f15907
      break;
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
Jeremy Bullock f15907
  // if no matching camera found
Jeremy Bullock f15907
  if (!isCameraFound) return;
Jeremy Bullock f15907
Jeremy Bullock f15907
  // open capture filter popup
Jeremy Bullock f15907
  hr = deviceFilter->QueryInterface(IID_ISpecifyPropertyPages,
Jeremy Bullock f15907
                                    (void **)&specifyPropertyPages);
Jeremy Bullock f15907
  if (hr == S_OK) {
Jeremy Bullock f15907
    hr = specifyPropertyPages->GetPages(&cauuid);
Jeremy Bullock f15907
Jeremy Bullock f15907
    hr = OleCreatePropertyFrame(ghwndApp, 30, 30, NULL, 1,
Jeremy Bullock f15907
                                (IUnknown **)&deviceFilter, cauuid.cElems,
Jeremy Bullock f15907
                                (GUID *)cauuid.pElems, 0, 0, NULL);
Jeremy Bullock f15907
Jeremy Bullock f15907
    CoTaskMemFree(cauuid.pElems);
Jeremy Bullock f15907
    specifyPropertyPages->Release();
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
}
Jeremy Bullock f15907
#endif
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
QScrollArea *makeChooserPage(QWidget *chooser) {
Jeremy Bullock f15907
  QScrollArea *scrollArea = new QScrollArea();
Jeremy Bullock f15907
  scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
Jeremy Bullock f15907
  scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
Jeremy Bullock f15907
  scrollArea->setWidgetResizable(true);
Jeremy Bullock f15907
  scrollArea->setWidget(chooser);
Jeremy Bullock f15907
  return scrollArea;
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
QScrollArea *makeChooserPageWithoutScrollBar(QWidget *chooser) {
Jeremy Bullock f15907
  QScrollArea *scrollArea = new QScrollArea();
Jeremy Bullock f15907
  scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
Jeremy Bullock f15907
  scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
Jeremy Bullock f15907
  scrollArea->setWidgetResizable(true);
Jeremy Bullock f15907
  scrollArea->setWidget(chooser);
Jeremy Bullock f15907
  return scrollArea;
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
}  // namespace
Jeremy Bullock f15907
Jeremy Bullock f15907
//*****************************************************************************
Jeremy Bullock f15907
//    StopMotionController  implementation
Jeremy Bullock f15907
//*****************************************************************************
Jeremy Bullock f15907
Jeremy Bullock f15907
StopMotionController::StopMotionController(QWidget *parent) : QWidget(parent) {
Jeremy Bullock f15907
  m_stopMotion = StopMotion::instance();
Jeremy Bullock f15907
  m_tabBar     = new DVGui::TabBar(this);
Jeremy Bullock f15907
  m_tabBar->setDrawBase(false);
Jeremy Bullock f15907
  m_tabBar->setObjectName("StopMotionTabBar");
Jeremy Bullock f15907
  m_tabBar->addSimpleTab(tr("Controls"));
Jeremy Bullock f15907
  m_tabBar->addSimpleTab(tr("Settings"));
Jeremy Bullock f15907
  m_tabBar->addSimpleTab(tr("Options"));
Jeremy Bullock f15907
  m_tabBarContainer    = new TabBarContainter(this);
Jeremy Bullock f15907
  m_mainControlsPage   = new QFrame();
Jeremy Bullock f15907
  m_cameraSettingsPage = new QFrame();
Jeremy Bullock f15907
  m_optionsPage        = new QFrame();
Jeremy Bullock f15907
Jeremy Bullock f15907
  // **********************
Jeremy Bullock f15907
  // Make Control Page
Jeremy Bullock f15907
  // **********************
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_saveInFolderPopup = new PencilTestSaveInFolderPopup(this);
Jeremy Bullock f15907
  m_cameraListCombo   = new QComboBox(this);
Jeremy Bullock f15907
  m_resolutionCombo   = new QComboBox(this);
Jeremy Bullock f15907
  m_resolutionCombo->setFixedWidth(fontMetrics().width("0000 x 0000") + 25);
Jeremy Bullock f15907
  m_resolutionLabel                 = new QLabel(tr("Resolution: "), this);
Jeremy Bullock f15907
  QPushButton *refreshCamListButton = new QPushButton(tr("Refresh"), this);
Jeremy Bullock f15907
  refreshCamListButton->setFixedHeight(28);
Jeremy Bullock f15907
  refreshCamListButton->setStyleSheet("padding: 0 2;");
Jeremy Bullock f15907
  QGroupBox *fileFrame = new QGroupBox(tr("File"), this);
Jeremy Bullock f15907
  m_levelNameEdit      = new LevelNameLineEdit(this);
Jeremy Bullock f15907
Jeremy Bullock f15907
#ifdef _WIN32
Jeremy Bullock f15907
  m_captureFilterSettingsBtn = new QPushButton(this);
Jeremy Bullock f15907
#else
Jeremy Bullock f15907
  m_captureFilterSettingsBtn = 0;
Jeremy Bullock f15907
#endif
Jeremy Bullock f15907
  if (m_captureFilterSettingsBtn) {
Jeremy Bullock f15907
    m_captureFilterSettingsBtn->setObjectName("GearButton");
Jeremy Bullock f15907
    m_captureFilterSettingsBtn->setFixedSize(28, 28);
Jeremy Bullock f15907
    m_captureFilterSettingsBtn->setIconSize(QSize(15, 15));
Jeremy Bullock f15907
    m_captureFilterSettingsBtn->setToolTip(tr("Webcam Settings..."));
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
Jeremy Bullock f15907
  // set the start frame 10 if the option in preferences
Jeremy Bullock f15907
  // "Show ABC Appendix to the Frame Number in Xsheet Cell" is active.
Jeremy Bullock f15907
  // (frame 10 is displayed as "1" with this option)
Jeremy Bullock f15907
  int startFrame =
Jeremy Bullock f15907
      Preferences::instance()->isShowFrameNumberWithLettersEnabled() ? 10 : 1;
Jeremy Bullock f15907
  m_frameNumberEdit        = new FrameNumberLineEdit(this, startFrame);
Jeremy Bullock f15907
  m_frameInfoLabel         = new QLabel("", this);
Jeremy Bullock f15907
  m_fileTypeCombo          = new QComboBox(this);
Jeremy Bullock f15907
  m_fileFormatOptionButton = new QPushButton(tr("Options"), this);
Jeremy Bullock f15907
  m_fileFormatOptionButton->setFixedHeight(28);
Jeremy Bullock f15907
  m_fileFormatOptionButton->setStyleSheet("padding: 0 2;");
Jeremy Bullock f15907
  m_xSheetFrameNumberEdit = new DVGui::IntLineEdit(this, 1, 1);
Jeremy Bullock f15907
  m_saveInFileFld =
Jeremy Bullock f15907
      new DVGui::FileField(this, m_saveInFolderPopup->getParentPath());
Jeremy Bullock f15907
  QToolButton *nextLevelButton       = new QToolButton(this);
Jeremy Bullock f15907
  m_previousLevelButton              = new QToolButton(this);
Jeremy Bullock f15907
  QPushButton *nextOpenLevelButton   = new QPushButton(this);
Jeremy Bullock f15907
  QToolButton *nextFrameButton       = new QToolButton(this);
Jeremy Bullock f15907
  m_previousFrameButton              = new QToolButton(this);
Jeremy Bullock f15907
  QPushButton *lastFrameButton       = new QPushButton(this);
Jeremy Bullock f15907
  QToolButton *nextXSheetFrameButton = new QToolButton(this);
Jeremy Bullock f15907
  m_previousXSheetFrameButton        = new QToolButton(this);
Jeremy Bullock f15907
  m_onionOpacityFld                  = new DVGui::IntField(this);
Jeremy Bullock f15907
  m_captureButton                    = new QPushButton(tr("Capture"), this);
Jeremy Bullock f15907
  // QPushButton *subfolderButton = new QPushButton(tr("Subfolder"), this);
Jeremy Bullock f15907
  m_fileTypeCombo->addItems({"jpg", "png", "tga", "tif"});
Jeremy Bullock f15907
  m_fileTypeCombo->setCurrentIndex(0);
Jeremy Bullock f15907
Jeremy Bullock f15907
  fileFrame->setObjectName("CleanupSettingsFrame");
Jeremy Bullock f15907
  m_frameNumberEdit->setObjectName("LargeSizedText");
Jeremy Bullock f15907
  m_frameInfoLabel->setAlignment(Qt::AlignRight);
Jeremy Bullock f15907
  nextLevelButton->setFixedSize(24, 24);
Jeremy Bullock f15907
  nextLevelButton->setArrowType(Qt::RightArrow);
Jeremy Bullock f15907
  nextLevelButton->setToolTip(tr("Next Level"));
Jeremy Bullock f15907
  nextOpenLevelButton->setText(tr("Next New"));
Jeremy Bullock f15907
  nextOpenLevelButton->setFixedHeight(28);
Jeremy Bullock f15907
  nextOpenLevelButton->setStyleSheet("padding: 0 2;");
Jeremy Bullock f15907
  nextOpenLevelButton->setSizePolicy(QSizePolicy::Maximum,
Jeremy Bullock f15907
                                     QSizePolicy::Maximum);
Jeremy Bullock f15907
  m_previousLevelButton->setFixedSize(24, 24);
Jeremy Bullock f15907
  m_previousLevelButton->setArrowType(Qt::LeftArrow);
Jeremy Bullock f15907
  m_previousLevelButton->setToolTip(tr("Previous Level"));
Jeremy Bullock f15907
  nextFrameButton->setFixedSize(24, 24);
Jeremy Bullock f15907
  nextFrameButton->setArrowType(Qt::RightArrow);
Jeremy Bullock f15907
  nextFrameButton->setToolTip(tr("Next Frame"));
Jeremy Bullock f15907
  lastFrameButton->setText(tr("Last Frame"));
Jeremy Bullock f15907
  lastFrameButton->setFixedHeight(28);
Jeremy Bullock f15907
  lastFrameButton->setStyleSheet("padding: 0 2;");
Jeremy Bullock f15907
  lastFrameButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
Jeremy Bullock f15907
  m_previousFrameButton->setFixedSize(24, 24);
Jeremy Bullock f15907
  m_previousFrameButton->setArrowType(Qt::LeftArrow);
Jeremy Bullock f15907
  m_previousFrameButton->setToolTip(tr("Previous Frame"));
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_xSheetFrameNumberEdit->setObjectName("LargeSizedText");
Jeremy Bullock f15907
  nextXSheetFrameButton->setFixedSize(24, 24);
Jeremy Bullock f15907
  nextXSheetFrameButton->setArrowType(Qt::RightArrow);
Jeremy Bullock f15907
  nextXSheetFrameButton->setToolTip(tr("Next XSheet Frame"));
Jeremy Bullock f15907
  m_previousXSheetFrameButton->setFixedSize(24, 24);
Jeremy Bullock f15907
  m_previousXSheetFrameButton->setArrowType(Qt::LeftArrow);
Jeremy Bullock f15907
  m_previousXSheetFrameButton->setToolTip(tr("Previous XSheet Frame"));
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_setToCurrentXSheetFrameButton = new QPushButton(this);
Jeremy Bullock f15907
  m_setToCurrentXSheetFrameButton->setText(tr("Current Frame"));
Jeremy Bullock f15907
  m_setToCurrentXSheetFrameButton->setFixedHeight(28);
Jeremy Bullock f15907
  m_setToCurrentXSheetFrameButton->setSizePolicy(QSizePolicy::Maximum,
Jeremy Bullock f15907
                                                 QSizePolicy::Maximum);
Jeremy Bullock f15907
  m_setToCurrentXSheetFrameButton->setStyleSheet("padding: 2px;");
Jeremy Bullock f15907
  m_setToCurrentXSheetFrameButton->setToolTip(
Jeremy Bullock f15907
      tr("Set to the Current Playhead Location"));
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_onionOpacityFld->setRange(0, 100);
Jeremy Bullock f15907
  m_onionOpacityFld->setValue(100);
Jeremy Bullock f15907
  m_onionOpacityFld->setDisabled(false);
Jeremy Bullock f15907
  m_toggleLiveViewButton = new QPushButton(tr("Start Live View"));
Jeremy Bullock f15907
  m_toggleLiveViewButton->setObjectName("LargeSizedText");
Jeremy Bullock f15907
  m_toggleLiveViewButton->setFixedHeight(35);
Jeremy Bullock f15907
  m_captureButton->setObjectName("LargeSizedText");
Jeremy Bullock f15907
  m_captureButton->setFixedHeight(35);
Jeremy Bullock f15907
  QCommonStyle style;
Jeremy Bullock f15907
  m_captureButton->setIcon(style.standardIcon(QStyle::SP_DialogOkButton));
Jeremy Bullock f15907
  m_captureButton->setIconSize(QSize(20, 20));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // subfolderButton->setObjectName("SubfolderButton");
Jeremy Bullock f15907
  // subfolderButton->setIconSize(QSize(15, 15));
Jeremy Bullock f15907
  m_saveInFileFld->setMaximumWidth(380);
Jeremy Bullock f15907
  m_levelNameEdit->setMaximumWidth(380);
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_saveInFolderPopup->hide();
Jeremy Bullock f15907
  m_zoomButton = new QPushButton(tr("Zoom"), this);
Jeremy Bullock f15907
  m_zoomButton->setFixedHeight(28);
Jeremy Bullock f15907
  m_zoomButton->setStyleSheet("padding: 0 2;");
Jeremy Bullock f15907
  m_zoomButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
Jeremy Bullock f15907
  m_pickZoomButton = new QPushButton(tr("Pick Zoom"), this);
Jeremy Bullock f15907
  m_pickZoomButton->setStyleSheet("padding: 0 2;");
Jeremy Bullock f15907
  m_pickZoomButton->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum);
Jeremy Bullock f15907
  m_pickZoomButton->setFixedHeight(28);
Jeremy Bullock f15907
  m_focusNearButton = new QPushButton(tr("<"), this);
Jeremy Bullock f15907
  m_focusNearButton->setFixedSize(32, 28);
Jeremy Bullock f15907
  m_focusFarButton = new QPushButton(tr(">"), this);
Jeremy Bullock f15907
  m_focusFarButton->setFixedSize(32, 28);
Jeremy Bullock f15907
  m_focusNear2Button = new QPushButton(tr("<<"), this);
Jeremy Bullock f15907
  m_focusNear2Button->setFixedSize(32, 28);
Jeremy Bullock f15907
  m_focusFar2Button = new QPushButton(tr(">>"), this);
Jeremy Bullock f15907
  m_focusFar2Button->setFixedSize(32, 28);
Jeremy Bullock f15907
  m_focusNear3Button = new QPushButton(tr("<<<"), this);
Jeremy Bullock f15907
  m_focusNear3Button->setFixedSize(32, 28);
Jeremy Bullock f15907
  m_focusFar3Button = new QPushButton(tr(">>>"), this);
Jeremy Bullock f15907
  m_focusFar3Button->setFixedSize(32, 28);
Jeremy Bullock f15907
  //*****//****
Jeremy Bullock f15907
Jeremy Bullock f15907
  QVBoxLayout *controlLayout = new QVBoxLayout();
Jeremy Bullock f15907
  controlLayout->setSpacing(0);
Jeremy Bullock f15907
  controlLayout->setMargin(5);
Jeremy Bullock f15907
Jeremy Bullock f15907
  {
Jeremy Bullock f15907
    {
Jeremy Bullock f15907
      QGridLayout *camLay = new QGridLayout();
Jeremy Bullock f15907
      camLay->setMargin(0);
Jeremy Bullock f15907
      camLay->setSpacing(3);
Jeremy Bullock f15907
      {
Jeremy Bullock f15907
        camLay->addWidget(new QLabel(tr("Camera:"), this), 0, 0,
Jeremy Bullock f15907
                          Qt::AlignRight);
Jeremy Bullock f15907
        camLay->addWidget(m_cameraListCombo, 0, 1, Qt::AlignLeft);
Jeremy Bullock f15907
        camLay->addWidget(refreshCamListButton, 0, 2, Qt::AlignLeft);
Jeremy Bullock f15907
        if (m_captureFilterSettingsBtn) {
Jeremy Bullock f15907
          camLay->addWidget(m_captureFilterSettingsBtn, 0, 3, Qt::AlignLeft);
Jeremy Bullock f15907
          camLay->addWidget(m_resolutionLabel, 1, 0, Qt::AlignRight);
Jeremy Bullock f15907
          camLay->addWidget(m_resolutionCombo, 1, 1, 1, 3, Qt::AlignLeft);
Jeremy Bullock f15907
          camLay->setColumnStretch(3, 30);
Jeremy Bullock f15907
        } else {
Jeremy Bullock f15907
          camLay->addWidget(m_resolutionLabel, 1, 0, Qt::AlignRight);
Jeremy Bullock f15907
          camLay->addWidget(m_resolutionCombo, 1, 1, 1, 2, Qt::AlignLeft);
Jeremy Bullock f15907
          camLay->setColumnStretch(2, 30);
Jeremy Bullock f15907
        }
Jeremy Bullock f15907
      }
Jeremy Bullock f15907
      controlLayout->addLayout(camLay, 0);
Jeremy Bullock f15907
Jeremy Bullock f15907
      QVBoxLayout *fileLay = new QVBoxLayout();
Jeremy Bullock f15907
      fileLay->setMargin(8);
Jeremy Bullock f15907
      fileLay->setSpacing(5);
Jeremy Bullock f15907
      {
Jeremy Bullock f15907
        QGridLayout *levelLay = new QGridLayout();
Jeremy Bullock f15907
        levelLay->setMargin(0);
Jeremy Bullock f15907
        levelLay->setHorizontalSpacing(3);
Jeremy Bullock f15907
        levelLay->setVerticalSpacing(5);
Jeremy Bullock f15907
        {
Jeremy Bullock f15907
          levelLay->addWidget(new QLabel(tr("Name:"), this), 0, 0,
Jeremy Bullock f15907
                              Qt::AlignRight);
Jeremy Bullock f15907
          QHBoxLayout *nameLay = new QHBoxLayout();
Jeremy Bullock f15907
          nameLay->setMargin(0);
Jeremy Bullock f15907
          nameLay->setSpacing(2);
Jeremy Bullock f15907
          {
Jeremy Bullock f15907
            nameLay->addWidget(m_previousLevelButton, 0);
Jeremy Bullock f15907
            nameLay->addWidget(m_levelNameEdit, 1);
Jeremy Bullock f15907
            nameLay->addWidget(nextLevelButton, 0);
Jeremy Bullock f15907
            nameLay->addWidget(nextOpenLevelButton, 0);
Jeremy Bullock f15907
          }
Jeremy Bullock f15907
          levelLay->addLayout(nameLay, 0, 1);
Jeremy Bullock f15907
Jeremy Bullock f15907
          levelLay->addWidget(new QLabel(tr("Frame:"), this), 1, 0,
Jeremy Bullock f15907
                              Qt::AlignRight);
Jeremy Bullock f15907
Jeremy Bullock f15907
          QHBoxLayout *frameLay = new QHBoxLayout();
Jeremy Bullock f15907
          frameLay->setMargin(0);
Jeremy Bullock f15907
          frameLay->setSpacing(2);
Jeremy Bullock f15907
          {
Jeremy Bullock f15907
            frameLay->addWidget(m_previousFrameButton, 0);
Jeremy Bullock f15907
            frameLay->addWidget(m_frameNumberEdit, 1);
Jeremy Bullock f15907
            frameLay->addWidget(nextFrameButton, 0);
Jeremy Bullock f15907
            frameLay->addWidget(lastFrameButton, 0);
Jeremy Bullock f15907
            frameLay->addWidget(m_frameInfoLabel, 1, Qt::AlignVCenter);
Jeremy Bullock f15907
          }
Jeremy Bullock f15907
          levelLay->addLayout(frameLay, 1, 1);
Jeremy Bullock f15907
        }
Jeremy Bullock f15907
        levelLay->setColumnStretch(0, 0);
Jeremy Bullock f15907
        levelLay->setColumnStretch(1, 1);
Jeremy Bullock f15907
        fileLay->addLayout(levelLay, 0);
Jeremy Bullock f15907
Jeremy Bullock f15907
        QHBoxLayout *fileTypeLay = new QHBoxLayout();
Jeremy Bullock f15907
        fileTypeLay->setMargin(0);
Jeremy Bullock f15907
        fileTypeLay->setSpacing(3);
Jeremy Bullock f15907
        {
Jeremy Bullock f15907
          fileTypeLay->addWidget(new QLabel(tr("File Type:"), this), 0);
Jeremy Bullock f15907
          fileTypeLay->addWidget(m_fileTypeCombo, 1);
Jeremy Bullock f15907
          fileTypeLay->addSpacing(10);
Jeremy Bullock f15907
          fileTypeLay->addWidget(m_fileFormatOptionButton);
Jeremy Bullock f15907
        }
Jeremy Bullock f15907
        fileLay->addLayout(fileTypeLay, 0);
Jeremy Bullock f15907
Jeremy Bullock f15907
        QHBoxLayout *saveInLay = new QHBoxLayout();
Jeremy Bullock f15907
        saveInLay->setMargin(0);
Jeremy Bullock f15907
        saveInLay->setSpacing(3);
Jeremy Bullock f15907
        {
Jeremy Bullock f15907
          saveInLay->addWidget(new QLabel(tr("Save In:"), this), 0);
Jeremy Bullock f15907
          saveInLay->addWidget(m_saveInFileFld, 1);
Jeremy Bullock f15907
        }
Jeremy Bullock f15907
        fileLay->addLayout(saveInLay, 0);
Jeremy Bullock f15907
        // fileLay->addWidget(subfolderButton, 0);
Jeremy Bullock f15907
      }
Jeremy Bullock f15907
      fileFrame->setLayout(fileLay);
Jeremy Bullock f15907
      controlLayout->addWidget(fileFrame, 0);
Jeremy Bullock f15907
Jeremy Bullock f15907
      QGridLayout *displayLay = new QGridLayout();
Jeremy Bullock f15907
      displayLay->setMargin(8);
Jeremy Bullock f15907
      displayLay->setHorizontalSpacing(3);
Jeremy Bullock f15907
      displayLay->setVerticalSpacing(5);
Jeremy Bullock f15907
      {
Jeremy Bullock f15907
        displayLay->addWidget(new QLabel(tr("XSheet Frame:"), this), 0, 0,
Jeremy Bullock f15907
                              Qt::AlignRight);
Jeremy Bullock f15907
        QHBoxLayout *xsheetLay = new QHBoxLayout();
Jeremy Bullock f15907
        xsheetLay->setMargin(0);
Jeremy Bullock f15907
        xsheetLay->setSpacing(2);
Jeremy Bullock f15907
        {
Jeremy Bullock f15907
          xsheetLay->addWidget(m_previousXSheetFrameButton, Qt::AlignLeft);
Jeremy Bullock f15907
          xsheetLay->addWidget(m_xSheetFrameNumberEdit, Qt::AlignLeft);
Jeremy Bullock f15907
          xsheetLay->addWidget(nextXSheetFrameButton, Qt::AlignLeft);
Jeremy Bullock f15907
          xsheetLay->addWidget(m_setToCurrentXSheetFrameButton,
Jeremy Bullock f15907
                               Qt::AlignCenter);
Jeremy Bullock f15907
          xsheetLay->addStretch(50);
Jeremy Bullock f15907
        }
Jeremy Bullock f15907
        displayLay->addLayout(xsheetLay, 0, 1);
Jeremy Bullock f15907
      }
Jeremy Bullock f15907
      displayLay->setColumnStretch(0, 0);
Jeremy Bullock f15907
      displayLay->setColumnStretch(1, 1);
Jeremy Bullock f15907
      controlLayout->addLayout(displayLay, 0);
Jeremy Bullock f15907
      controlLayout->addStretch(1);
Jeremy Bullock f15907
      controlLayout->addSpacing(5);
Jeremy Bullock f15907
      controlLayout->addStretch(1);
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_mainControlsPage->setLayout(controlLayout);
Jeremy Bullock f15907
Jeremy Bullock f15907
    // Make Settings Page
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_isoCombo            = new QComboBox(this);
Jeremy Bullock f15907
    m_shutterSpeedCombo   = new QComboBox(this);
Jeremy Bullock f15907
    m_exposureCombo       = new QComboBox(this);
Jeremy Bullock f15907
    m_apertureCombo       = new QComboBox(this);
Jeremy Bullock f15907
    m_whiteBalanceCombo   = new QComboBox(this);
Jeremy Bullock f15907
    m_kelvinCombo         = new QComboBox(this);
Jeremy Bullock f15907
    m_imageQualityCombo   = new QComboBox(this);
Jeremy Bullock f15907
    m_pictureStyleCombo   = new QComboBox(this);
Jeremy Bullock f15907
    m_cameraSettingsLabel = new QLabel(tr("Camera Model"), this);
Jeremy Bullock f15907
    m_cameraModeLabel     = new QLabel(tr("Camera Mode"), this);
Jeremy Bullock f15907
    m_kelvinLabel         = new QLabel(tr("Temperature: "), this);
Jeremy Bullock f15907
    m_isoCombo->setFixedWidth(fontMetrics().width("000000") + 25);
Jeremy Bullock f15907
    m_shutterSpeedCombo->setFixedWidth(fontMetrics().width("000000") + 25);
Jeremy Bullock f15907
    m_apertureCombo->setFixedWidth(fontMetrics().width("000000") + 25);
Jeremy Bullock f15907
    m_exposureCombo->setFixedWidth(fontMetrics().width("000000") + 25);
Jeremy Bullock f15907
    QVBoxLayout *settingsLayout = new QVBoxLayout;
Jeremy Bullock f15907
    settingsLayout->setSpacing(0);
Jeremy Bullock f15907
    settingsLayout->setMargin(5);
Jeremy Bullock f15907
Jeremy Bullock f15907
    QGridLayout *settingsGridLayout = new QGridLayout;
Jeremy Bullock f15907
    {
Jeremy Bullock f15907
      settingsGridLayout->setMargin(0);
Jeremy Bullock f15907
      settingsGridLayout->setSpacing(3);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_cameraSettingsLabel, 0, 0, 1, 2,
Jeremy Bullock f15907
                                    Qt::AlignCenter);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_cameraModeLabel, 1, 0, 1, 2,
Jeremy Bullock f15907
                                    Qt::AlignCenter);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(new QLabel(tr("Shutter Speed: ")), 2, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_shutterSpeedCombo, 2, 1, Qt::AlignLeft);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(new QLabel(tr("Iso: ")), 3, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_isoCombo, 3, 1, Qt::AlignLeft);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(new QLabel(tr("Aperture: ")), 4, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_apertureCombo, 4, 1, Qt::AlignLeft);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(new QLabel(tr("Exposure: ")), 5, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_exposureCombo, 5, 1, Qt::AlignLeft);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(new QLabel(tr("Image Quality: ")), 6, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_imageQualityCombo, 6, 1, Qt::AlignLeft);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(new QLabel(tr("Picture Style: ")), 7, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_pictureStyleCombo, 7, 1, Qt::AlignLeft);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(new QLabel(tr("White Balance: ")), 8, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_whiteBalanceCombo, 8, 1, Qt::AlignLeft);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_kelvinLabel, 9, 0, Qt::AlignRight);
Jeremy Bullock f15907
      settingsGridLayout->addWidget(m_kelvinCombo, 9, 1, Qt::AlignLeft);
Jeremy Bullock f15907
Jeremy Bullock f15907
      settingsGridLayout->setColumnStretch(1, 30);
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
    settingsLayout->addLayout(settingsGridLayout, 0);
Jeremy Bullock f15907
    m_focusAndZoomLayout = new QHBoxLayout;
Jeremy Bullock f15907
    m_focusAndZoomLayout->addStretch();
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_focusNear3Button, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_focusNear2Button, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_focusNearButton, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_zoomButton, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_pickZoomButton, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_focusFarButton, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_focusFar2Button, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addWidget(m_focusFar3Button, Qt::AlignCenter);
Jeremy Bullock f15907
    m_focusAndZoomLayout->addStretch();
Jeremy Bullock f15907
    // settingsLayout->addStretch();
Jeremy Bullock f15907
    settingsLayout->addLayout(m_focusAndZoomLayout);
Jeremy Bullock f15907
    settingsLayout->addStretch();
Jeremy Bullock f15907
    m_cameraSettingsPage->setLayout(settingsLayout);
Jeremy Bullock f15907
Jeremy Bullock f15907
    // Make Options Page
Jeremy Bullock f15907
    QGroupBox *webcamBox   = new QGroupBox(tr("Webcam Options"), this);
Jeremy Bullock f15907
    QGroupBox *dslrBox     = new QGroupBox(tr("DSLR Options"), this);
Jeremy Bullock f15907
    m_postCaptureReviewFld = new DVGui::IntField(this);
Jeremy Bullock f15907
    m_postCaptureReviewFld->setRange(0, 10);
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_subsamplingFld = new DVGui::IntField(this);
Jeremy Bullock f15907
    m_subsamplingFld->setRange(1, 30);
Jeremy Bullock f15907
    m_subsamplingFld->setDisabled(true);
Jeremy Bullock f15907
    m_blackScreenForCapture = new QCheckBox(this);
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_placeOnXSheetCB = new QCheckBox(this);
Jeremy Bullock f15907
    m_placeOnXSheetCB->setToolTip(tr("Place the frame in the XSheet"));
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_useScaledFullSizeImages = new QCheckBox(this);
Jeremy Bullock f15907
    m_directShowLabel = new QLabel(tr("Use Direct Show Webcam Drivers"), this);
Jeremy Bullock f15907
    m_directShowCB    = new QCheckBox(this);
Jeremy Bullock f15907
    m_useMjpgCB       = new QCheckBox(this);
Jeremy Bullock f15907
    m_useNumpadCB     = new QCheckBox(this);
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_liveViewOnAllFramesCB           = new QCheckBox(this);
Jeremy Bullock f15907
    QVBoxLayout *optionsOutsideLayout = new QVBoxLayout;
Jeremy Bullock f15907
    QGridLayout *optionsLayout        = new QGridLayout;
Jeremy Bullock f15907
    optionsLayout->setSpacing(3);
Jeremy Bullock f15907
    optionsLayout->setMargin(5);
Jeremy Bullock f15907
    QGridLayout *webcamLayout   = new QGridLayout;
Jeremy Bullock f15907
    QGridLayout *dslrLayout     = new QGridLayout;
Jeremy Bullock f15907
    QGridLayout *checkboxLayout = new QGridLayout;
Jeremy Bullock f15907
Jeremy Bullock f15907
    dslrLayout->addWidget(m_blackScreenForCapture, 0, 0, Qt::AlignRight);
Jeremy Bullock f15907
    dslrLayout->addWidget(new QLabel(tr("Black Screen for Capture")), 0, 1,
Jeremy Bullock f15907
                          Qt::AlignLeft);
Jeremy Bullock f15907
    dslrLayout->addWidget(m_useScaledFullSizeImages, 1, 0, Qt::AlignRight);
Jeremy Bullock f15907
    dslrLayout->addWidget(new QLabel(tr("Use Reduced Resolution Images")), 1, 1,
Jeremy Bullock f15907
                          Qt::AlignLeft);
Jeremy Bullock f15907
    dslrLayout->setColumnStretch(1, 30);
Jeremy Bullock f15907
    dslrBox->setLayout(dslrLayout);
Jeremy Bullock f15907
    dslrBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
Jeremy Bullock f15907
    optionsOutsideLayout->addWidget(dslrBox, Qt::AlignCenter);
Jeremy Bullock f15907
Jeremy Bullock f15907
    webcamLayout->addWidget(m_directShowCB, 0, 0, Qt::AlignRight);
Jeremy Bullock f15907
    webcamLayout->addWidget(m_directShowLabel, 0, 1, Qt::AlignLeft);
Jeremy Bullock f15907
    webcamLayout->addWidget(m_useMjpgCB, 1, 0, Qt::AlignRight);
Jeremy Bullock f15907
    webcamLayout->addWidget(new QLabel(tr("Use MJPG with Webcam")), 1, 1,
Jeremy Bullock f15907
                            Qt::AlignLeft);
Jeremy Bullock f15907
    webcamLayout->setColumnStretch(1, 30);
Jeremy Bullock f15907
    webcamBox->setLayout(webcamLayout);
Jeremy Bullock f15907
    webcamBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
Jeremy Bullock f15907
    optionsOutsideLayout->addWidget(webcamBox, Qt::AlignCenter);
Jeremy Bullock f15907
Jeremy Bullock f15907
    checkboxLayout->addWidget(m_placeOnXSheetCB, 0, 0, 1, 1, Qt::AlignRight);
Jeremy Bullock f15907
    checkboxLayout->addWidget(new QLabel(tr("Place on XSheet")), 0, 1,
Jeremy Bullock f15907
                              Qt::AlignLeft);
Jeremy Bullock f15907
    checkboxLayout->addWidget(m_useNumpadCB, 1, 0, Qt::AlignRight);
Jeremy Bullock f15907
    checkboxLayout->addWidget(
Jeremy Bullock f15907
        new QLabel(tr("Use Numpad Shortcuts When Active")), 1, 1,
Jeremy Bullock f15907
        Qt::AlignLeft);
Jeremy Bullock f15907
    checkboxLayout->addWidget(m_liveViewOnAllFramesCB, 2, 0, Qt::AlignRight);
Jeremy Bullock f15907
    checkboxLayout->addWidget(new QLabel(tr("Show Live View on All Frames")), 2,
Jeremy Bullock f15907
                              1, Qt::AlignLeft);
Jeremy Bullock f15907
Jeremy Bullock f15907
    checkboxLayout->setColumnStretch(1, 30);
Jeremy Bullock f15907
    optionsOutsideLayout->addLayout(checkboxLayout, Qt::AlignLeft);
Jeremy Bullock f15907
Jeremy Bullock f15907
    optionsLayout->addWidget(new QLabel(tr("Capture Review Time: ")), 0, 0,
Jeremy Bullock f15907
                             Qt::AlignRight);
Jeremy Bullock f15907
    optionsLayout->addWidget(m_postCaptureReviewFld, 0, 1);
Jeremy Bullock f15907
    optionsLayout->addWidget(new QLabel(tr("Level Subsampling: ")), 1, 0,
Jeremy Bullock f15907
                             Qt::AlignRight);
Jeremy Bullock f15907
    optionsLayout->addWidget(m_subsamplingFld, 1, 1);
Jeremy Bullock f15907
    optionsLayout->setColumnStretch(1, 30);
Jeremy Bullock f15907
    optionsLayout->setRowStretch(2, 30);
Jeremy Bullock f15907
    optionsOutsideLayout->addLayout(optionsLayout, Qt::AlignLeft);
Jeremy Bullock f15907
    optionsOutsideLayout->addStretch();
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_optionsPage->setLayout(optionsOutsideLayout);
Jeremy Bullock f15907
Jeremy Bullock f15907
    QScrollArea *mainArea = makeChooserPageWithoutScrollBar(m_mainControlsPage);
Jeremy Bullock f15907
    QScrollArea *settingsArea =
Jeremy Bullock f15907
        makeChooserPageWithoutScrollBar(m_cameraSettingsPage);
Jeremy Bullock f15907
    QScrollArea *optionsArea = makeChooserPageWithoutScrollBar(m_optionsPage);
Jeremy Bullock f15907
Jeremy Bullock f15907
    m_stackedChooser = new QStackedWidget(this);
Jeremy Bullock f15907
    m_stackedChooser->addWidget(mainArea);
Jeremy Bullock f15907
    m_stackedChooser->addWidget(settingsArea);
Jeremy Bullock f15907
    m_stackedChooser->addWidget(optionsArea);
Jeremy Bullock f15907
    m_stackedChooser->setFocusPolicy(Qt::NoFocus);
Jeremy Bullock f15907
Jeremy Bullock f15907
    QFrame *opacityFrame    = new QFrame();
Jeremy Bullock f15907
    QHBoxLayout *opacityLay = new QHBoxLayout();
Jeremy Bullock f15907
    opacityLay->addWidget(new QLabel(tr("Opacity:"), this), 0);
Jeremy Bullock f15907
    opacityLay->addWidget(m_onionOpacityFld, 1);
Jeremy Bullock f15907
    opacityFrame->setLayout(opacityLay);
Jeremy Bullock f15907
    opacityFrame->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
Jeremy Bullock f15907
Jeremy Bullock f15907
    QFrame *controlButtonFrame    = new QFrame();
Jeremy Bullock f15907
    QHBoxLayout *controlButtonLay = new QHBoxLayout();
Jeremy Bullock f15907
    controlButtonLay->addWidget(m_captureButton, 0);
Jeremy Bullock f15907
    controlButtonLay->addWidget(m_toggleLiveViewButton, 0);
Jeremy Bullock f15907
    controlButtonFrame->setLayout(controlButtonLay);
Jeremy Bullock f15907
Jeremy Bullock f15907
    QVBoxLayout *mainLayout = new QVBoxLayout;
Jeremy Bullock f15907
    mainLayout->setMargin(0);
Jeremy Bullock f15907
    mainLayout->setSpacing(0);
Jeremy Bullock f15907
    {
Jeremy Bullock f15907
      QHBoxLayout *hLayout = new QHBoxLayout;
Jeremy Bullock f15907
      hLayout->setMargin(0);
Jeremy Bullock f15907
      {
Jeremy Bullock f15907
        hLayout->addSpacing(4);
Jeremy Bullock f15907
        hLayout->addWidget(m_tabBar);
Jeremy Bullock f15907
        hLayout->addStretch();
Jeremy Bullock f15907
      }
Jeremy Bullock f15907
      m_tabBarContainer->setLayout(hLayout);
Jeremy Bullock f15907
Jeremy Bullock f15907
      mainLayout->addWidget(m_tabBarContainer, 0, 0);
Jeremy Bullock f15907
      mainLayout->addWidget(m_stackedChooser, 1, 0);
Jeremy Bullock f15907
      mainLayout->addWidget(opacityFrame, 0);
Jeremy Bullock f15907
      mainLayout->addWidget(controlButtonFrame, 0);
Jeremy Bullock f15907
      setLayout(mainLayout);
Jeremy Bullock f15907
      m_tabBarContainer->layout()->update();
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
Jeremy Bullock f15907
  TSceneHandle *sceneHandle   = TApp::instance()->getCurrentScene();
Jeremy Bullock f15907
  TXsheetHandle *xsheetHandle = TApp::instance()->getCurrentXsheet();
Jeremy Bullock f15907
Jeremy Bullock f15907
  bool ret = true;
Jeremy Bullock f15907
Jeremy Bullock f15907
  // Outside Connections
Jeremy Bullock f15907
  ret = ret && connect(sceneHandle, SIGNAL(sceneSwitched()), this,
Jeremy Bullock f15907
                       SLOT(onSceneSwitched()));
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(xsheetHandle, SIGNAL(xsheetSwitched()), this, SLOT(update()));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // UI SIGNALS
Jeremy Bullock f15907
  ret = ret && connect(m_tabBar, SIGNAL(currentChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(setPage(int)));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // Control Page
Jeremy Bullock f15907
  ret = ret && connect(refreshCamListButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(refreshCameraListCalled()));
Jeremy Bullock f15907
  ret = ret && connect(m_cameraListCombo, SIGNAL(activated(int)), this,
Jeremy Bullock f15907
                       SLOT(onCameraListComboActivated(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_resolutionCombo, SIGNAL(activated(const QString &)),
Jeremy Bullock f15907
                       this, SLOT(onResolutionComboActivated(const QString &)));
Jeremy Bullock f15907
  if (m_captureFilterSettingsBtn)
Jeremy Bullock f15907
    ret = ret && connect(m_captureFilterSettingsBtn, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                         SLOT(onCaptureFilterSettingsBtnPressed()));
Jeremy Bullock f15907
  ret = ret && connect(m_fileFormatOptionButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onFileFormatOptionButtonPressed()));
Jeremy Bullock f15907
  ret = ret && connect(m_levelNameEdit, SIGNAL(levelNameEdited()), this,
Jeremy Bullock f15907
                       SLOT(onLevelNameEdited()));
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(nextLevelButton, SIGNAL(pressed()), this, SLOT(onNextName()));
Jeremy Bullock f15907
  ret = ret && connect(m_previousLevelButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onPreviousName()));
Jeremy Bullock f15907
  ret = ret && connect(nextOpenLevelButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onNextNewLevel()));
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(nextFrameButton, SIGNAL(pressed()), this, SLOT(onNextFrame()));
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(lastFrameButton, SIGNAL(pressed()), this, SLOT(onLastFrame()));
Jeremy Bullock f15907
  ret = ret && connect(m_previousFrameButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onPreviousFrame()));
Jeremy Bullock f15907
  ret = ret && connect(nextXSheetFrameButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onNextXSheetFrame()));
Jeremy Bullock f15907
  ret = ret && connect(m_previousXSheetFrameButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onPreviousXSheetFrame()));
Jeremy Bullock f15907
  ret = ret && connect(m_setToCurrentXSheetFrameButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(setToCurrentXSheetFrame()));
Jeremy Bullock f15907
  ret = ret && connect(m_onionOpacityFld, SIGNAL(valueEditedByHand()), this,
Jeremy Bullock f15907
                       SLOT(onOnionOpacityFldEdited()));
Jeremy Bullock f15907
  ret = ret && connect(m_onionOpacityFld, SIGNAL(valueChanged(bool)), this,
Jeremy Bullock f15907
                       SLOT(onOnionOpacitySliderChanged(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_captureButton, SIGNAL(clicked(bool)), this,
Jeremy Bullock f15907
                       SLOT(onCaptureButtonClicked(bool)));
Jeremy Bullock f15907
  // ret = ret && connect(subfolderButton, SIGNAL(clicked(bool)), this,
Jeremy Bullock f15907
  //                     SLOT(openSaveInFolderPopup()));
Jeremy Bullock f15907
  ret = ret && connect(m_saveInFileFld, SIGNAL(pathChanged()), this,
Jeremy Bullock f15907
                       SLOT(onSaveInPathEdited()));
Jeremy Bullock f15907
  ret = ret && connect(m_fileTypeCombo, SIGNAL(activated(int)), this,
Jeremy Bullock f15907
                       SLOT(onFileTypeActivated()));
Jeremy Bullock f15907
  ret = ret && connect(m_frameNumberEdit, SIGNAL(editingFinished()), this,
Jeremy Bullock f15907
                       SLOT(onFrameNumberChanged()));
Jeremy Bullock f15907
  ret = ret && connect(m_xSheetFrameNumberEdit, SIGNAL(editingFinished()), this,
Jeremy Bullock f15907
                       SLOT(onXSheetFrameNumberChanged()));
Jeremy Bullock f15907
  ret = ret && connect(m_toggleLiveViewButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onLiveViewToggleClicked()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(filePathChanged(QString)), this,
Jeremy Bullock f15907
                       SLOT(onFilePathChanged(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(levelNameChanged(QString)), this,
Jeremy Bullock f15907
                       SLOT(onLevelNameChanged(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(fileTypeChanged(QString)), this,
Jeremy Bullock f15907
                       SLOT(onFileTypeChanged(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(frameInfoTextChanged(QString)),
Jeremy Bullock f15907
                       this, SLOT(onFrameInfoTextChanged(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(xSheetFrameNumberChanged(int)),
Jeremy Bullock f15907
                       this, SLOT(onXSheetFrameNumberChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(frameNumberChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onFrameNumberChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(opacityChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onOpacityChanged(int)));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // Options Page
Jeremy Bullock f15907
  ret = ret && connect(m_useScaledFullSizeImages, SIGNAL(stateChanged(int)),
Jeremy Bullock f15907
                       this, SLOT(onScaleFullSizeImagesChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_liveViewOnAllFramesCB, SIGNAL(stateChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onLiveViewOnAllFramesChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_blackScreenForCapture, SIGNAL(stateChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onBlackScreenForCaptureChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_placeOnXSheetCB, SIGNAL(stateChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onPlaceOnXSheetChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_directShowCB, SIGNAL(stateChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onUseDirectShowChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_useMjpgCB, SIGNAL(stateChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onUseMjpgChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_useNumpadCB, SIGNAL(stateChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onUseNumpadChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_postCaptureReviewFld, SIGNAL(valueEditedByHand()),
Jeremy Bullock f15907
                       this, SLOT(onCaptureReviewFldEdited()));
Jeremy Bullock f15907
  ret = ret && connect(m_postCaptureReviewFld, SIGNAL(valueChanged(bool)), this,
Jeremy Bullock f15907
                       SLOT(onCaptureReviewSliderChanged(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_subsamplingFld, SIGNAL(valueEditedByHand()), this,
Jeremy Bullock f15907
                       SLOT(onSubsamplingFldEdited()));
Jeremy Bullock f15907
  ret = ret && connect(m_subsamplingFld, SIGNAL(valueChanged(bool)), this,
Jeremy Bullock f15907
                       SLOT(onSubsamplingSliderChanged(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(subsamplingChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onSubsamplingChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(scaleFullSizeImagesSignal(bool)),
Jeremy Bullock f15907
                       this, SLOT(onScaleFullSizeImagesSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(blackCaptureSignal(bool)), this,
Jeremy Bullock f15907
                       SLOT(onBlackCaptureSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(liveViewOnAllFramesSignal(bool)),
Jeremy Bullock f15907
                       this, SLOT(onLiveViewOnAllFramesSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(placeOnXSheetSignal(bool)), this,
Jeremy Bullock f15907
                       SLOT(onPlaceOnXSheetSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(useDirectShowSignal(bool)), this,
Jeremy Bullock f15907
                       SLOT(onUseDirectShowSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(useMjpgSignal(bool)), this,
Jeremy Bullock f15907
                       SLOT(onUseMjpgSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(useNumpadSignal(bool)), this,
Jeremy Bullock f15907
                       SLOT(onUseNumpadSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(reviewTimeChangedSignal(int)), this,
Jeremy Bullock f15907
                       SLOT(onReviewTimeChangedSignal(int)));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // From Stop Motion Main
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(newDimensions()), this,
Jeremy Bullock f15907
                       SLOT(updateDimensions()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(updateCameraList()), this,
Jeremy Bullock f15907
                       SLOT(refreshCameraList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(liveViewChanged(bool)), this,
Jeremy Bullock f15907
                       SLOT(onLiveViewChanged(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(newCameraSelected(int, bool)), this,
Jeremy Bullock f15907
                       SLOT(onNewCameraSelected(int, bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(cameraChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshCameraList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(optionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshOptionsLists()));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // EOS Connections
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(m_zoomButton, SIGNAL(pressed()), this, SLOT(onZoomPressed()));
Jeremy Bullock f15907
  ret = ret && connect(m_pickZoomButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onPickZoomPressed()));
Jeremy Bullock f15907
  ret = ret && connect(m_focusNearButton, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onFocusNear()));
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(m_focusFarButton, SIGNAL(pressed()), this, SLOT(onFocusFar()));
Jeremy Bullock f15907
  ret = ret && connect(m_focusNear2Button, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onFocusNear2()));
Jeremy Bullock f15907
  ret = ret && connect(m_focusFar2Button, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onFocusFar2()));
Jeremy Bullock f15907
  ret = ret && connect(m_focusNear3Button, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onFocusNear3()));
Jeremy Bullock f15907
  ret = ret && connect(m_focusFar3Button, SIGNAL(pressed()), this,
Jeremy Bullock f15907
                       SLOT(onFocusFar3()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(apertureChangedSignal(QString)),
Jeremy Bullock f15907
                       this, SLOT(onApertureChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(isoChangedSignal(QString)), this,
Jeremy Bullock f15907
                       SLOT(onIsoChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(shutterSpeedChangedSignal(QString)),
Jeremy Bullock f15907
                       this, SLOT(onShutterSpeedChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(exposureChangedSignal(QString)),
Jeremy Bullock f15907
                       this, SLOT(onExposureChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(whiteBalanceChangedSignal(QString)),
Jeremy Bullock f15907
                       this, SLOT(onWhiteBalanceChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(imageQualityChangedSignal(QString)),
Jeremy Bullock f15907
                       this, SLOT(onImageQualityChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(pictureStyleChangedSignal(QString)),
Jeremy Bullock f15907
                       this, SLOT(onPictureStyleChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(m_stopMotion, SIGNAL(colorTemperatureChangedSignal(QString)),
Jeremy Bullock f15907
                this, SLOT(onColorTemperatureChangedSignal(QString)));
Jeremy Bullock f15907
  ret = ret && connect(m_apertureCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onApertureChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_shutterSpeedCombo, SIGNAL(currentIndexChanged(int)),
Jeremy Bullock f15907
                       this, SLOT(onShutterSpeedChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_isoCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onIsoChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_exposureCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onExposureChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_whiteBalanceCombo, SIGNAL(currentIndexChanged(int)),
Jeremy Bullock f15907
                       this, SLOT(onWhiteBalanceChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_kelvinCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onColorTemperatureChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_imageQualityCombo, SIGNAL(currentIndexChanged(int)),
Jeremy Bullock f15907
                       this, SLOT(onImageQualityChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_pictureStyleCombo, SIGNAL(currentIndexChanged(int)),
Jeremy Bullock f15907
                       this, SLOT(onPictureStyleChanged(int)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(apertureOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshApertureList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(shutterSpeedOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshShutterSpeedList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(isoOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshIsoList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(exposureOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshExposureList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(whiteBalanceOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshWhiteBalanceList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(imageQualityOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshImageQualityList()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(pictureStyleOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshPictureStyleList()));
Jeremy Bullock f15907
  ret = ret &&
Jeremy Bullock f15907
        connect(m_stopMotion, SIGNAL(modeChanged()), this, SLOT(refreshMode()));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // Webcam Specific Connections
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(webcamResolutionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(onWebcamResolutionsChanged()));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(newWebcamResolutionSelected(int)),
Jeremy Bullock f15907
                       this, SLOT(onNewWebcamResolutionSelected(int)));
Jeremy Bullock f15907
Jeremy Bullock f15907
  assert(ret);
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_placeOnXSheetCB->setChecked(
Jeremy Bullock f15907
      m_stopMotion->getPlaceOnXSheet() == true ? true : false);
Jeremy Bullock f15907
  m_useScaledFullSizeImages->setChecked(m_stopMotion->m_useScaledImages);
Jeremy Bullock f15907
  m_onionOpacityFld->setValue(double(100 * m_stopMotion->getOpacity()) / 255.0);
Jeremy Bullock f15907
  m_directShowCB->setChecked(m_stopMotion->getUseDirectShow());
Jeremy Bullock f15907
  m_useMjpgCB->setChecked(m_stopMotion->getUseMjpg());
Jeremy Bullock f15907
  m_useNumpadCB->setChecked(m_stopMotion->getUseNumpadShortcuts());
Jeremy Bullock f15907
  m_liveViewOnAllFramesCB->setChecked(m_stopMotion->getAlwaysLiveView());
Jeremy Bullock f15907
  m_blackScreenForCapture->setChecked(
Jeremy Bullock f15907
      m_stopMotion->getBlackCapture() == true ? true : false);
Jeremy Bullock f15907
  m_postCaptureReviewFld->setValue(m_stopMotion->getReviewTime());
Jeremy Bullock f15907
Jeremy Bullock f15907
  refreshCameraList();
Jeremy Bullock f15907
  onSceneSwitched();
Jeremy Bullock f15907
  m_stopMotion->setToNextNewLevel();
Jeremy Bullock f15907
  m_saveInFileFld->setPath(m_stopMotion->getFilePath());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
StopMotionController::~StopMotionController() {}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::setPage(int index) {
Jeremy Bullock f15907
  if (m_stopMotion->m_usingWebcam && index > 0) index += 1;
Jeremy Bullock f15907
  m_stackedChooser->setCurrentIndex(index);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onScaleFullSizeImagesChanged(int checked) {
Jeremy Bullock f15907
  m_stopMotion->setUseScaledImages(checked > 0 ? true : false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onScaleFullSizeImagesSignal(bool on) {
Jeremy Bullock f15907
  m_useScaledFullSizeImages->setChecked(on);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onLiveViewOnAllFramesChanged(int checked) {
Jeremy Bullock f15907
  m_stopMotion->setAlwaysLiveView(checked > 0 ? true : false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onLiveViewOnAllFramesSignal(bool on) {
Jeremy Bullock f15907
  m_liveViewOnAllFramesCB->setChecked(on);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onBlackScreenForCaptureChanged(int checked) {
Jeremy Bullock f15907
  m_stopMotion->setBlackCapture(checked);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onBlackCaptureSignal(bool on) {
Jeremy Bullock f15907
  m_blackScreenForCapture->setChecked(on);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPlaceOnXSheetChanged(int checked) {
Jeremy Bullock f15907
  m_stopMotion->setPlaceOnXSheet(checked);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPlaceOnXSheetSignal(bool on) {
Jeremy Bullock f15907
  m_placeOnXSheetCB->setChecked(on);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onUseDirectShowChanged(int checked) {
Jeremy Bullock f15907
  m_stopMotion->setUseDirectShow(checked);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onUseDirectShowSignal(bool on) {
Jeremy Bullock f15907
  m_directShowCB->setChecked(on);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onUseMjpgChanged(int checked) {
Jeremy Bullock f15907
  m_stopMotion->setUseMjpg(checked);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onUseMjpgSignal(bool on) {
Jeremy Bullock f15907
  m_useMjpgCB->setChecked(on);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onUseNumpadChanged(int checked) {
Jeremy Bullock f15907
  m_stopMotion->setUseNumpadShortcuts(checked);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onUseNumpadSignal(bool on) {
Jeremy Bullock f15907
  m_useNumpadCB->setChecked(on);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onCaptureReviewFldEdited() {
Jeremy Bullock f15907
  m_stopMotion->setReviewTime(m_postCaptureReviewFld->getValue());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onCaptureReviewSliderChanged(bool ignore) {
Jeremy Bullock f15907
  m_stopMotion->setReviewTime(m_postCaptureReviewFld->getValue());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onReviewTimeChangedSignal(int time) {
Jeremy Bullock f15907
  m_postCaptureReviewFld->setValue(time);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onSubsamplingChanged(int subsampling) {
Jeremy Bullock f15907
  if (subsampling < 1) {
Jeremy Bullock f15907
    m_subsamplingFld->setValue(1);
Jeremy Bullock f15907
    m_subsamplingFld->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_subsamplingFld->setValue(subsampling);
Jeremy Bullock f15907
    m_subsamplingFld->setEnabled(true);
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFrameNumberChanged(int frameNumber) {
Jeremy Bullock f15907
  m_frameNumberEdit->setValue(frameNumber);
Jeremy Bullock f15907
  m_previousFrameButton->setDisabled(frameNumber == 1);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onXSheetFrameNumberChanged(int frameNumber) {
Jeremy Bullock f15907
  m_xSheetFrameNumberEdit->setValue(frameNumber);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFilePathChanged(QString filePath) {
Jeremy Bullock f15907
  m_saveInFileFld->setPath(filePath);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onLevelNameChanged(QString levelName) {
Jeremy Bullock f15907
  m_levelNameEdit->setText(levelName);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFileTypeChanged(QString fileType) {
Jeremy Bullock f15907
  m_fileTypeCombo->setCurrentText(fileType);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFrameInfoTextChanged(QString infoText) {
Jeremy Bullock f15907
  m_frameInfoLabel->setText(infoText);
Jeremy Bullock f15907
  m_frameInfoLabel->setStyleSheet(QString("QLabel{color: %1;}\
Jeremy Bullock f15907
                                          QLabel QWidget{ color: black;}")
Jeremy Bullock f15907
                                      .arg(m_stopMotion->getInfoColorName()));
Jeremy Bullock f15907
  m_frameInfoLabel->setToolTip(m_stopMotion->getFrameInfoToolTip());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onSubsamplingFldEdited() {
Jeremy Bullock f15907
  m_stopMotion->setSubsamplingValue(m_subsamplingFld->getValue());
Jeremy Bullock f15907
  m_stopMotion->setSubsampling();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onSubsamplingSliderChanged(bool ignore) {
Jeremy Bullock f15907
  m_stopMotion->setSubsamplingValue(m_subsamplingFld->getValue());
Jeremy Bullock f15907
  m_stopMotion->setSubsampling();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshCameraListCalled() {
Jeremy Bullock f15907
  m_stopMotion->refreshCameraList();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshCameraList() {
Jeremy Bullock f15907
  m_cameraListCombo->clear();
Jeremy Bullock f15907
Jeremy Bullock f15907
  QList<qcamerainfo> webcams = m_stopMotion->getWebcams();</qcamerainfo>
Jeremy Bullock f15907
Jeremy Bullock f15907
  int count = m_stopMotion->getCameraCount() + webcams.count();
Jeremy Bullock f15907
  if (count < 1) {
Jeremy Bullock f15907
    m_cameraListCombo->addItem(tr("No camera detected."));
Jeremy Bullock f15907
    m_cameraSettingsLabel->setText(tr("No camera detected"));
Jeremy Bullock f15907
    m_cameraModeLabel->setText("");
Jeremy Bullock f15907
    m_cameraListCombo->setDisabled(true);
Jeremy Bullock f15907
    m_captureButton->setDisabled(true);
Jeremy Bullock f15907
    m_toggleLiveViewButton->setDisabled(true);
shun-iwasawa 2c27a4
    m_toggleLiveViewButton->setText(tr("Start Live View"));
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    int maxTextLength = 0;
Jeremy Bullock f15907
    m_cameraListCombo->addItem(tr("- Select camera -"));
Jeremy Bullock f15907
    if (webcams.count() > 0) {
Jeremy Bullock f15907
      for (int c = 0; c < webcams.size(); c++) {
Jeremy Bullock f15907
        std::string name = webcams.at(c).deviceName().toStdString();
Jeremy Bullock f15907
        QString camDesc  = webcams.at(c).description();
Jeremy Bullock f15907
        m_cameraListCombo->addItem(camDesc);
Jeremy Bullock f15907
        maxTextLength = std::max(maxTextLength, fontMetrics().width(camDesc));
Jeremy Bullock f15907
      }
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
    if (m_stopMotion->getCameraCount() > 0) {
Jeremy Bullock f15907
      QString name;
Jeremy Bullock f15907
      m_stopMotion->getCamera(0);
Jeremy Bullock f15907
      m_stopMotion->openCameraSession();
Jeremy Bullock f15907
      name = QString::fromStdString(m_stopMotion->getCameraName());
Jeremy Bullock f15907
      m_stopMotion->closeCameraSession();
Jeremy Bullock f15907
      m_cameraSettingsLabel->setText(name);
Jeremy Bullock f15907
      m_cameraListCombo->addItem(name);
Jeremy Bullock f15907
      maxTextLength = std::max(maxTextLength, fontMetrics().width(name));
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
    m_cameraListCombo->setMaximumWidth(maxTextLength + 25);
Jeremy Bullock f15907
    m_cameraListCombo->setEnabled(true);
Jeremy Bullock f15907
    m_cameraListCombo->setCurrentIndex(0);
Jeremy Bullock f15907
    m_captureButton->setEnabled(true);
Jeremy Bullock f15907
    m_toggleLiveViewButton->setEnabled(true);
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_stopMotion->updateLevelNameAndFrame(m_levelNameEdit->text().toStdWString());
Jeremy Bullock f15907
  refreshOptionsLists();
Jeremy Bullock f15907
  refreshMode();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshOptionsLists() {
Jeremy Bullock f15907
  m_apertureCombo->blockSignals(true);
Jeremy Bullock f15907
  m_isoCombo->blockSignals(true);
Jeremy Bullock f15907
  m_shutterSpeedCombo->blockSignals(true);
Jeremy Bullock f15907
  m_exposureCombo->blockSignals(true);
Jeremy Bullock f15907
  m_whiteBalanceCombo->blockSignals(true);
Jeremy Bullock f15907
  m_kelvinCombo->blockSignals(true);
Jeremy Bullock f15907
  m_imageQualityCombo->blockSignals(true);
Jeremy Bullock f15907
  m_pictureStyleCombo->blockSignals(true);
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_isoCombo->clear();
Jeremy Bullock f15907
  m_shutterSpeedCombo->clear();
Jeremy Bullock f15907
  m_apertureCombo->clear();
Jeremy Bullock f15907
  m_exposureCombo->clear();
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_stopMotion->getCameraCount() == 0) {
Jeremy Bullock f15907
    m_resolutionCombo->setDisabled(true);
Jeremy Bullock f15907
    m_shutterSpeedCombo->setDisabled(true);
Jeremy Bullock f15907
    m_isoCombo->setDisabled(true);
Jeremy Bullock f15907
    m_apertureCombo->setDisabled(true);
Jeremy Bullock f15907
    m_exposureCombo->setDisabled(true);
Jeremy Bullock f15907
    m_whiteBalanceCombo->setDisabled(true);
Jeremy Bullock f15907
    m_kelvinCombo->setDisabled(true);
Jeremy Bullock f15907
    m_imageQualityCombo->setDisabled(true);
Jeremy Bullock f15907
    m_pictureStyleCombo->setDisabled(true);
Jeremy Bullock f15907
    return;
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
Jeremy Bullock f15907
  refreshApertureList();
Jeremy Bullock f15907
  refreshShutterSpeedList();
Jeremy Bullock f15907
  refreshIsoList();
Jeremy Bullock f15907
  refreshExposureList();
Jeremy Bullock f15907
  refreshWhiteBalanceList();
Jeremy Bullock f15907
  refreshImageQualityList();
Jeremy Bullock f15907
  refreshPictureStyleList();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshMode() {
Jeremy Bullock f15907
  if (m_stopMotion->getCameraCount() == 0) {
Jeremy Bullock f15907
    m_cameraModeLabel->setText("");
Jeremy Bullock f15907
    return;
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  QString mode = m_stopMotion->getMode();
Jeremy Bullock f15907
  m_cameraModeLabel->setText(tr("Mode: ") + mode);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshApertureList() {
Jeremy Bullock f15907
  m_apertureCombo->blockSignals(true);
Jeremy Bullock f15907
  m_apertureCombo->clear();
Jeremy Bullock f15907
  m_stopMotion->getAvailableApertures();
Jeremy Bullock f15907
  m_apertureCombo->addItems(m_stopMotion->getApertureOptions());
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_apertureCombo->count() == 0) {
Jeremy Bullock f15907
    m_apertureCombo->addItem(tr("Auto"));
Jeremy Bullock f15907
    m_apertureCombo->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_apertureCombo->setEnabled(true);
Jeremy Bullock f15907
    m_apertureCombo->setCurrentText(m_stopMotion->getCurrentAperture());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_apertureCombo->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshShutterSpeedList() {
Jeremy Bullock f15907
  m_shutterSpeedCombo->blockSignals(true);
Jeremy Bullock f15907
  m_shutterSpeedCombo->clear();
Jeremy Bullock f15907
  m_stopMotion->getAvailableShutterSpeeds();
Jeremy Bullock f15907
  m_shutterSpeedCombo->addItems(m_stopMotion->getShutterSpeedOptions());
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_shutterSpeedCombo->count() == 0) {
Jeremy Bullock f15907
    m_shutterSpeedCombo->addItem(tr("Auto"));
Jeremy Bullock f15907
    m_shutterSpeedCombo->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_shutterSpeedCombo->setEnabled(true);
Jeremy Bullock f15907
    m_shutterSpeedCombo->setCurrentText(m_stopMotion->getCurrentShutterSpeed());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_shutterSpeedCombo->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshIsoList() {
Jeremy Bullock f15907
  m_isoCombo->blockSignals(true);
Jeremy Bullock f15907
  m_isoCombo->clear();
Jeremy Bullock f15907
  m_stopMotion->getAvailableIso();
Jeremy Bullock f15907
  m_isoCombo->addItems(m_stopMotion->getIsoOptions());
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_isoCombo->count() == 0) {
Jeremy Bullock f15907
    m_isoCombo->addItem(tr("Auto"));
Jeremy Bullock f15907
    m_isoCombo->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_isoCombo->setEnabled(true);
Jeremy Bullock f15907
    std::string currIso = m_stopMotion->getCurrentIso().toStdString();
Jeremy Bullock f15907
    m_isoCombo->setCurrentText(m_stopMotion->getCurrentIso());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_isoCombo->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshExposureList() {
Jeremy Bullock f15907
  m_exposureCombo->blockSignals(true);
Jeremy Bullock f15907
  m_exposureCombo->clear();
Jeremy Bullock f15907
  m_stopMotion->getAvailableExposureCompensations();
Jeremy Bullock f15907
  m_exposureCombo->addItems(m_stopMotion->getExposureOptions());
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_exposureCombo->count() == 0) {
Jeremy Bullock f15907
    m_exposureCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_exposureCombo->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_exposureCombo->setEnabled(true);
Jeremy Bullock f15907
    m_exposureCombo->setCurrentText(
Jeremy Bullock f15907
        m_stopMotion->getCurrentExposureCompensation());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_exposureCombo->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshWhiteBalanceList() {
Jeremy Bullock f15907
  m_whiteBalanceCombo->blockSignals(true);
Jeremy Bullock f15907
  m_whiteBalanceCombo->clear();
Jeremy Bullock f15907
  m_stopMotion->getAvailableWhiteBalances();
Jeremy Bullock f15907
  m_whiteBalanceCombo->addItems(m_stopMotion->getWhiteBalanceOptions());
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_whiteBalanceCombo->count() == 0) {
Jeremy Bullock f15907
    m_whiteBalanceCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_whiteBalanceCombo->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_whiteBalanceCombo->setEnabled(true);
Jeremy Bullock f15907
    m_whiteBalanceCombo->setCurrentText(m_stopMotion->getCurrentWhiteBalance());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_whiteBalanceCombo->blockSignals(false);
Jeremy Bullock f15907
  refreshColorTemperatureList();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshColorTemperatureList() {
Jeremy Bullock f15907
  m_kelvinCombo->blockSignals(true);
Jeremy Bullock f15907
  m_kelvinCombo->clear();
Jeremy Bullock f15907
  m_kelvinCombo->addItems(m_stopMotion->getColorTemperatureOptions());
Jeremy Bullock f15907
  std::string ct = m_stopMotion->getCurrentWhiteBalance().toStdString();
Jeremy Bullock f15907
  int kCount     = m_kelvinCombo->count();
Jeremy Bullock f15907
  if (m_kelvinCombo->count() == 0 ||
Jeremy Bullock f15907
      m_stopMotion->getCurrentWhiteBalance() != "Color Temperature") {
Jeremy Bullock f15907
    // m_kelvinCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_kelvinCombo->setDisabled(true);
Jeremy Bullock f15907
    m_kelvinCombo->hide();
Jeremy Bullock f15907
    m_kelvinLabel->hide();
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_kelvinCombo->show();
Jeremy Bullock f15907
    m_kelvinLabel->show();
Jeremy Bullock f15907
    m_kelvinCombo->setEnabled(true);
Jeremy Bullock f15907
    m_kelvinCombo->setCurrentText(m_stopMotion->getCurrentColorTemperature());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_kelvinCombo->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshImageQualityList() {
Jeremy Bullock f15907
  m_imageQualityCombo->blockSignals(true);
Jeremy Bullock f15907
  m_imageQualityCombo->clear();
Jeremy Bullock f15907
  m_stopMotion->getAvailableImageQualities();
Jeremy Bullock f15907
  m_imageQualityCombo->addItems(m_stopMotion->getImageQualityOptions());
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_imageQualityCombo->count() == 0) {
Jeremy Bullock f15907
    m_imageQualityCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_imageQualityCombo->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_imageQualityCombo->setEnabled(true);
Jeremy Bullock f15907
    m_imageQualityCombo->setCurrentText(m_stopMotion->getCurrentImageQuality());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_imageQualityCombo->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshPictureStyleList() {
Jeremy Bullock f15907
  m_pictureStyleCombo->blockSignals(true);
Jeremy Bullock f15907
  m_pictureStyleCombo->clear();
Jeremy Bullock f15907
  m_stopMotion->getAvailablePictureStyles();
Jeremy Bullock f15907
  m_pictureStyleCombo->addItems(m_stopMotion->getPictureStyleOptions());
Jeremy Bullock f15907
Jeremy Bullock f15907
  if (m_pictureStyleCombo->count() == 0) {
Jeremy Bullock f15907
    m_pictureStyleCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_pictureStyleCombo->setDisabled(true);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_pictureStyleCombo->setEnabled(true);
Jeremy Bullock f15907
    m_pictureStyleCombo->setCurrentText(m_stopMotion->getCurrentPictureStyle());
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_pictureStyleCombo->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onCameraListComboActivated(int comboIndex) {
Jeremy Bullock f15907
  QList<qcamerainfo> cameras = QCameraInfo::availableCameras();</qcamerainfo>
Jeremy Bullock f15907
  if (cameras.size() + m_stopMotion->getCameraCount() !=
Jeremy Bullock f15907
      m_cameraListCombo->count() - 1)
Jeremy Bullock f15907
    return;
Jeremy Bullock f15907
Jeremy Bullock f15907
  m_stopMotion->changeCameras(comboIndex);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onNewCameraSelected(int index, bool useWebcam) {
Jeremy Bullock f15907
  if (index < m_cameraListCombo->count())
Jeremy Bullock f15907
    m_cameraListCombo->setCurrentIndex(index);
Jeremy Bullock f15907
  if (index == 0) {
Jeremy Bullock f15907
    m_cameraListCombo->setCurrentIndex(index);
Jeremy Bullock f15907
    m_resolutionCombo->hide();
Jeremy Bullock f15907
    m_resolutionLabel->hide();
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  if (useWebcam) {
shun-iwasawa 2c27a4
    if (m_tabBar->tabText(1) == tr("Settings")) {
Jeremy Bullock f15907
      m_tabBar->removeTab(1);
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
    m_resolutionCombo->show();
Jeremy Bullock f15907
    m_resolutionCombo->setEnabled(true);
Jeremy Bullock f15907
    m_resolutionLabel->show();
Jeremy Bullock f15907
    m_captureFilterSettingsBtn->show();
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_resolutionCombo->hide();
Jeremy Bullock f15907
    m_resolutionLabel->hide();
Jeremy Bullock f15907
    m_captureFilterSettingsBtn->hide();
shun-iwasawa 2c27a4
    if (m_tabBar->tabText(1) == tr("Options")) {
shun-iwasawa 2c27a4
      m_tabBar->insertTab(1, tr("Settings"));
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onWebcamResolutionsChanged() {
Jeremy Bullock f15907
  m_resolutionCombo->clear();
Jeremy Bullock f15907
  QList<qsize> resolutions = m_stopMotion->getWebcamResolutions();</qsize>
Jeremy Bullock f15907
  for (int s = 0; s < resolutions.size(); s++) {
Jeremy Bullock f15907
    m_resolutionCombo->addItem(QString("%1 x %2")
Jeremy Bullock f15907
                                   .arg(resolutions.at(s).width())
Jeremy Bullock f15907
                                   .arg(resolutions.at(s).height()));
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onNewWebcamResolutionSelected(int index) {
Jeremy Bullock f15907
  m_resolutionCombo->setCurrentIndex(index);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onResolutionComboActivated(const QString &itemText) {
Jeremy Bullock f15907
  m_stopMotion->setWebcamResolution(itemText);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onCaptureFilterSettingsBtnPressed() {
Jeremy Bullock f15907
  if (!m_stopMotion->getWebcam() || m_stopMotion->m_webcamDeviceName.isNull())
Jeremy Bullock f15907
    return;
Jeremy Bullock f15907
Jeremy Bullock f15907
  QList<qcamerainfo> cameras = QCameraInfo::availableCameras();</qcamerainfo>
Jeremy Bullock f15907
  for (int c = 0; c < cameras.size(); c++) {
Jeremy Bullock f15907
    if (cameras.at(c).deviceName() == m_stopMotion->m_webcamDeviceName) {
Jeremy Bullock f15907
#ifdef _WIN32
Jeremy Bullock f15907
      openCaptureFilterSettings(this, cameras.at(c).description());
Jeremy Bullock f15907
#endif
Jeremy Bullock f15907
      return;
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFileFormatOptionButtonPressed() {
Jeremy Bullock f15907
  if (m_fileTypeCombo->currentIndex() == 0) return;
Jeremy Bullock f15907
  // Tentatively use the preview output settings
Jeremy Bullock f15907
  ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
Jeremy Bullock f15907
  if (!scene) return;
Jeremy Bullock f15907
  TOutputProperties *prop = scene->getProperties()->getPreviewProperties();
Jeremy Bullock f15907
  std::string ext         = m_fileTypeCombo->currentText().toStdString();
Jeremy Bullock f15907
  openFormatSettingsPopup(this, ext, prop->getFileFormatProperties(ext));
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onLevelNameEdited() {
Jeremy Bullock f15907
  m_stopMotion->updateLevelNameAndFrame(m_levelNameEdit->text().toStdWString());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
void StopMotionController::onNextName() { m_stopMotion->nextName(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onNextNewLevel() {
Jeremy Bullock f15907
  m_stopMotion->setToNextNewLevel();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPreviousName() { m_stopMotion->previousName(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onNextFrame() { m_stopMotion->nextFrame(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onLastFrame() {}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPreviousFrame() { m_stopMotion->previousFrame(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onNextXSheetFrame() {
Jeremy Bullock f15907
  m_stopMotion->setXSheetFrameNumber(m_stopMotion->getXSheetFrameNumber() + 1);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPreviousXSheetFrame() {
Jeremy Bullock f15907
  m_stopMotion->setXSheetFrameNumber(m_stopMotion->getXSheetFrameNumber() - 1);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::setToCurrentXSheetFrame() {
Jeremy Bullock f15907
  int frameNumber = TApp::instance()->getCurrentFrame()->getFrame() + 1;
Jeremy Bullock f15907
  m_stopMotion->setXSheetFrameNumber(frameNumber);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::updateDimensions() {
Jeremy Bullock f15907
  m_stopMotion->refreshFrameInfo();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFrameCaptured(QImage &image) {}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onApertureChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setAperture(m_apertureCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onApertureChangedSignal(QString text) {
Jeremy Bullock f15907
  m_apertureCombo->setCurrentText(m_stopMotion->getCurrentAperture());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onShutterSpeedChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setShutterSpeed(m_shutterSpeedCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onShutterSpeedChangedSignal(QString text) {
Jeremy Bullock f15907
  m_shutterSpeedCombo->setCurrentText(m_stopMotion->getCurrentShutterSpeed());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onIsoChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setIso(m_isoCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onIsoChangedSignal(QString text) {
Jeremy Bullock f15907
  m_isoCombo->setCurrentText(m_stopMotion->getCurrentIso());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onExposureChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setExposureCompensation(m_exposureCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onExposureChangedSignal(QString text) {
Jeremy Bullock f15907
  m_exposureCombo->setCurrentText(
Jeremy Bullock f15907
      m_stopMotion->getCurrentExposureCompensation());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onWhiteBalanceChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setWhiteBalance(m_whiteBalanceCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onWhiteBalanceChangedSignal(QString text) {
Jeremy Bullock f15907
  m_whiteBalanceCombo->setCurrentText(m_stopMotion->getCurrentWhiteBalance());
Jeremy Bullock f15907
  refreshColorTemperatureList();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onColorTemperatureChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setColorTemperature(m_kelvinCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onColorTemperatureChangedSignal(QString text) {
Jeremy Bullock f15907
  m_kelvinCombo->setCurrentText(m_stopMotion->getCurrentColorTemperature());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onImageQualityChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setImageQuality(m_imageQualityCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onImageQualityChangedSignal(QString text) {
Jeremy Bullock f15907
  m_imageQualityCombo->setCurrentText(m_stopMotion->getCurrentImageQuality());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPictureStyleChanged(int index) {
Jeremy Bullock f15907
  m_stopMotion->setPictureStyle(m_pictureStyleCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPictureStyleChangedSignal(QString text) {
Jeremy Bullock f15907
  m_pictureStyleCombo->setCurrentText(m_stopMotion->getCurrentPictureStyle());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onZoomPressed() { m_stopMotion->zoomLiveView(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPickZoomPressed() {
Jeremy Bullock f15907
  m_stopMotion->m_pickLiveViewZoom = true;
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFocusNear() { m_stopMotion->focusNear(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFocusFar() { m_stopMotion->focusFar(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFocusNear2() { m_stopMotion->focusNear2(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFocusFar2() { m_stopMotion->focusFar2(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFocusNear3() { m_stopMotion->focusNear3(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFocusFar3() { m_stopMotion->focusFar3(); }
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::showEvent(QShowEvent *event) {}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::hideEvent(QHideEvent *event) {
Jeremy Bullock f15907
  // disconnect(m_apertureCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
  //           SLOT(onApertureChanged(int)));
Jeremy Bullock f15907
  // disconnect(m_shutterSpeedCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
  //           SLOT(onShutterSpeedChanged(int)));
Jeremy Bullock f15907
  // disconnect(m_isoCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
  //           SLOT(onIsoChanged(int)));
Jeremy Bullock f15907
  // disconnect(m_exposureCombo, SIGNAL(currentIndexChanged(int)), this,
Jeremy Bullock f15907
  //           SLOT(onExposureChanged(int)));
Jeremy Bullock f15907
Jeremy Bullock f15907
  // disconnect(m_stopMotion, SIGNAL(cameraChanged()), this,
Jeremy Bullock f15907
  //           SLOT(refreshCameraList()));
Jeremy Bullock f15907
  // disconnect(m_stopMotion, SIGNAL(optionsChanged()), this,
Jeremy Bullock f15907
  //           SLOT(refreshOptionsLists()));
Jeremy Bullock f15907
  // disconnect(m_stopMotion, SIGNAL(apertureOptionsChanged()), this,
Jeremy Bullock f15907
  //           SLOT(refreshApertureList()));
Jeremy Bullock f15907
  // disconnect(m_stopMotion, SIGNAL(shutterSpeedOptionsChanged()), this,
Jeremy Bullock f15907
  //           SLOT(refreshShutterSpeedList()));
Jeremy Bullock f15907
  // disconnect(m_stopMotion, SIGNAL(isoOptionsChanged()), this,
Jeremy Bullock f15907
  //           SLOT(refreshIsoList()));
Jeremy Bullock f15907
  // disconnect(m_stopMotion, SIGNAL(exposureOptionsChanged()), this,
Jeremy Bullock f15907
  //           SLOT(refreshExposureList()));
Jeremy Bullock f15907
  // disconnect(m_stopMotion, SIGNAL(modeChanged()), this, SLOT(refreshMode()));
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
////-----------------------------------------------------------------------------
Jeremy Bullock f15907
//
Jeremy Bullock f15907
// void StopMotionController::keyPressEvent(QKeyEvent *event) {
Jeremy Bullock f15907
//  // override return (or enter) key as shortcut key for capturing
Jeremy Bullock f15907
//  if (event->key() == Qt::Key_Return || event->key() == Qt::Key_Enter) {
Jeremy Bullock f15907
//    // show button-clicking animation followed by calling
Jeremy Bullock f15907
//    // onCaptureButtonClicked()
Jeremy Bullock f15907
//    m_captureButton->animateClick();
Jeremy Bullock f15907
//    event->accept();
Jeremy Bullock f15907
//  } else
Jeremy Bullock f15907
//    event->ignore();
Jeremy Bullock f15907
//}
Jeremy Bullock f15907
//
Jeremy Bullock f15907
////-----------------------------------------------------------------------------
Jeremy Bullock f15907
//
Jeremy Bullock f15907
// void StopMotionController::mousePressEvent(QMouseEvent *event) {}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onLiveViewToggleClicked() {
Jeremy Bullock f15907
  m_stopMotion->toggleLiveView();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onLiveViewChanged(bool on) {
Jeremy Bullock f15907
  if (on) {
Jeremy Bullock f15907
    m_toggleLiveViewButton->setText(tr("Stop Live View"));
Jeremy Bullock f15907
Jeremy Bullock f15907
  } else
Jeremy Bullock f15907
    m_toggleLiveViewButton->setText(tr("Start Live View"));
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onOnionOpacityFldEdited() {
Jeremy Bullock f15907
  int value = (int)(255.0f * (float)m_onionOpacityFld->getValue() / 100.0f);
Jeremy Bullock f15907
  m_stopMotion->setOpacity(value);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onOnionOpacitySliderChanged(bool ignore) {
Jeremy Bullock f15907
  int value = (int)(255.0f * (float)m_onionOpacityFld->getValue() / 100.0f);
Jeremy Bullock f15907
  m_stopMotion->setOpacity(value);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onOpacityChanged(int opacity) {
Jeremy Bullock f15907
  m_onionOpacityFld->setValue(double(100 * opacity) / 255.0);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onCaptureButtonClicked(bool on) {
Jeremy Bullock f15907
  m_stopMotion->captureImage();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::openSaveInFolderPopup() {
Jeremy Bullock f15907
  if (m_saveInFolderPopup->exec()) {
Jeremy Bullock f15907
    QString oldPath = m_saveInFileFld->getPath();
Jeremy Bullock f15907
    m_saveInFileFld->setPath(m_saveInFolderPopup->getPath());
Jeremy Bullock f15907
    if (oldPath == m_saveInFileFld->getPath())
Jeremy Bullock f15907
      m_stopMotion->setToNextNewLevel();
Jeremy Bullock f15907
    else {
Jeremy Bullock f15907
      onSaveInPathEdited();
Jeremy Bullock f15907
    }
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFileTypeActivated() {
Jeremy Bullock f15907
  m_stopMotion->setFileType(m_fileTypeCombo->currentText());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onFrameNumberChanged() {
Jeremy Bullock f15907
  m_stopMotion->setFrameNumber(m_frameNumberEdit->getValue());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onXSheetFrameNumberChanged() {
Jeremy Bullock f15907
  m_stopMotion->setXSheetFrameNumber(m_xSheetFrameNumberEdit->getValue());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onSaveInPathEdited() {
Jeremy Bullock f15907
  m_stopMotion->setFilePath(m_saveInFileFld->getPath());
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onSceneSwitched() {
Jeremy Bullock f15907
  // m_saveInFolderPopup->updateParentFolder();
Jeremy Bullock f15907
  // m_saveInFileFld->setPath(m_saveInFolderPopup->getParentPath());
Jeremy Bullock f15907
  // m_stopMotion->refreshFrameInfo();
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::updateStopMotion() {}