Jeremy Bullock f15907
#include "stopmotioncontroller.h"
shun-iwasawa 31accf
#include "webcam.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"
justburner d63640
#include "toonzqt/doublefield.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>
shun-iwasawa 31accf
#include <qserialport></qserialport>
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"));
shun-iwasawa 31accf
  m_tabBar->addSimpleTab(tr("Light"));
shun-iwasawa 31accf
  m_tabBar->addSimpleTab(tr("Motion"));
Jeremy Bullock f15907
  m_tabBarContainer    = new TabBarContainter(this);
shun-iwasawa 31accf
  m_mainControlsPage   = new QFrame(this);
shun-iwasawa 31accf
  m_cameraSettingsPage = new QFrame(this);
shun-iwasawa 31accf
  m_optionsPage        = new QFrame(this);
shun-iwasawa 31accf
  m_motionPage         = new QFrame(this);
shun-iwasawa 31accf
  m_lightPage          = new QFrame(this);
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);
shun-iwasawa 31accf
  m_cameraStatusLabel               = new QLabel(tr("Camera Status"), 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
  // 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;
shun-iwasawa 31accf
  m_frameNumberEdit = new FrameNumberLineEdit(this, startFrame);
shun-iwasawa 31accf
  m_frameInfoLabel  = new QLabel("", this);
shun-iwasawa 31accf
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);
shun-iwasawa 31accf
luz paz 6454c4
  // should choosing the file type is disabled for simplicity
shun-iwasawa 31accf
  // too many options can be a bad thing
shun-iwasawa 31accf
  m_fileTypeCombo          = new QComboBox(this);
shun-iwasawa 31accf
  m_fileFormatOptionButton = new QPushButton(tr("Options"), this);
shun-iwasawa 31accf
  m_fileFormatOptionButton->setFixedHeight(28);
shun-iwasawa 31accf
  m_fileFormatOptionButton->setStyleSheet("padding: 0 2;");
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);
shun-iwasawa 31accf
  m_captureButton = new QPushButton(tr("Capture"), this);
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));
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton = new QPushButton();
shun-iwasawa 31accf
  // m_alwaysUseLiveViewImagesButton->setObjectName("LargeSizedText");
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->setObjectName("LiveViewButton");
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->setFixedHeight(35);
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->setFixedWidth(35);
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->setCheckable(true);
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->setIconSize(QSize(25, 25));
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->setToolTip(
shun-iwasawa 31accf
      tr("Show original live view images in timeline"));
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();
shun-iwasawa 31accf
  m_zoomButton = new QPushButton(tr("Check"), this);
Jeremy Bullock f15907
  m_zoomButton->setFixedHeight(28);
shun-iwasawa 31accf
  m_zoomButton->setStyleSheet("padding: 5 2;");
shun-iwasawa 31accf
  m_zoomButton->setMaximumWidth(100);
shun-iwasawa 31accf
  m_zoomButton->setToolTip(tr("Zoom in to check focus"));
shun-iwasawa 31accf
  m_zoomButton->setCheckable(true);
shun-iwasawa 31accf
  m_pickZoomButton = new QPushButton(tr("Pick"), this);
shun-iwasawa 31accf
  m_pickZoomButton->setStyleSheet("padding: 5 2;");
shun-iwasawa 31accf
  m_pickZoomButton->setMaximumWidth(100);
Jeremy Bullock f15907
  m_pickZoomButton->setFixedHeight(28);
shun-iwasawa 31accf
  m_pickZoomButton->setToolTip(tr("Set focus check location"));
shun-iwasawa 31accf
  m_pickZoomButton->setCheckable(true);
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);
shun-iwasawa 31accf
        // if (m_captureFilterSettingsBtn) {
shun-iwasawa 31accf
        //  camLay->addWidget(m_captureFilterSettingsBtn, 0, 3, Qt::AlignLeft);
shun-iwasawa 31accf
        //  camLay->addWidget(m_resolutionLabel, 1, 0, Qt::AlignRight);
shun-iwasawa 31accf
        //  camLay->addWidget(m_resolutionCombo, 1, 1, 1, 3, Qt::AlignLeft);
shun-iwasawa 31accf
        //  camLay->setColumnStretch(3, 30);
shun-iwasawa 31accf
        //} else {
shun-iwasawa 31accf
        //}
shun-iwasawa 31accf
        camLay->addWidget(m_resolutionLabel, 1, 0, Qt::AlignRight);
shun-iwasawa 31accf
        camLay->addWidget(m_resolutionCombo, 1, 1, 1, 2, Qt::AlignLeft);
shun-iwasawa 31accf
        camLay->setColumnStretch(2, 30);
shun-iwasawa 31accf
        camLay->addWidget(m_cameraStatusLabel, 2, 1, 1, 2, Qt::AlignLeft);
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
shun-iwasawa 31accf
    QVBoxLayout *innerSettingsLayout = new QVBoxLayout;
shun-iwasawa 31accf
    m_noCameraFrame                  = new QFrame();
shun-iwasawa 31accf
    QHBoxLayout *noCameraLayout      = new QHBoxLayout();
shun-iwasawa 31accf
    noCameraLayout->addStretch();
shun-iwasawa 31accf
    noCameraLayout->addWidget(
shun-iwasawa 31accf
        new QLabel(tr("Select a camera to change settings.")));
shun-iwasawa 31accf
    noCameraLayout->addStretch();
shun-iwasawa 31accf
    m_noCameraFrame->setLayout(noCameraLayout);
shun-iwasawa 31accf
    innerSettingsLayout->addWidget(m_noCameraFrame);
shun-iwasawa 31accf
shun-iwasawa 31accf
    m_apertureLabel  = new QLabel(tr(""), this);
shun-iwasawa 31accf
    m_apertureSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_apertureSlider->setRange(0, 10);
shun-iwasawa 31accf
    m_apertureSlider->setTickInterval(1);
shun-iwasawa 31accf
    m_apertureSlider->setFixedWidth(260);
shun-iwasawa 31accf
    m_isoLabel  = new QLabel(tr(""), this);
shun-iwasawa 31accf
    m_isoSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_isoSlider->setRange(0, 10);
shun-iwasawa 31accf
    m_isoSlider->setTickInterval(1);
shun-iwasawa 31accf
    m_isoSlider->setFixedWidth(260);
shun-iwasawa 31accf
    m_shutterSpeedLabel  = new QLabel(tr(""), this);
shun-iwasawa 31accf
    m_shutterSpeedSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_shutterSpeedSlider->setRange(0, 10);
shun-iwasawa 31accf
    m_shutterSpeedSlider->setTickInterval(1);
shun-iwasawa 31accf
    m_shutterSpeedSlider->setFixedWidth(260);
shun-iwasawa 31accf
    m_kelvinValueLabel = new QLabel(tr("Temperature: "), this);
shun-iwasawa 31accf
    m_kelvinSlider     = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_kelvinSlider->setRange(0, 10);
shun-iwasawa 31accf
    m_kelvinSlider->setTickInterval(1);
shun-iwasawa 31accf
    m_kelvinSlider->setFixedWidth(260);
Jeremy Bullock f15907
    m_exposureCombo       = new QComboBox(this);
Jeremy Bullock f15907
    m_whiteBalanceCombo   = 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_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);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(" ", this), 2, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_shutterSpeedLabel, 3, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_shutterSpeedSlider, 4, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_apertureLabel, 5, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_apertureSlider, 6, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_isoLabel, 7, 0, 1, 2, Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_isoSlider, 8, 0, 1, 2, Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(" ", this), 9, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(tr("White Balance: ")), 10, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_whiteBalanceCombo, 10, 1, Qt::AlignLeft);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_kelvinValueLabel, 11, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_kelvinSlider, 12, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(" ", this), 13, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(tr("Picture Style: ")), 14, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_pictureStyleCombo, 14, 1, Qt::AlignLeft);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(tr("Image Quality: ")), 15, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_imageQualityCombo, 15, 1, Qt::AlignLeft);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(tr("Exposure: ")), 16, 0,
Jeremy Bullock f15907
                                    Qt::AlignRight);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(m_exposureCombo, 16, 1, Qt::AlignLeft);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(" ", this), 17, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
shun-iwasawa 31accf
      settingsGridLayout->addWidget(new QLabel(" ", this), 19, 0, 1, 2,
shun-iwasawa 31accf
                                    Qt::AlignCenter);
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();
shun-iwasawa 31accf
    m_dslrFrame = new QFrame();
shun-iwasawa 31accf
    m_dslrFrame->setLayout(settingsLayout);
shun-iwasawa 31accf
    innerSettingsLayout->addWidget(m_dslrFrame);
shun-iwasawa 31accf
    m_dslrFrame->hide();
shun-iwasawa 31accf
shun-iwasawa 31accf
    QVBoxLayout *webcamSettingsLayout = new QVBoxLayout;
shun-iwasawa 31accf
    webcamSettingsLayout->setSpacing(0);
shun-iwasawa 31accf
    webcamSettingsLayout->setMargin(5);
shun-iwasawa 31accf
    QHBoxLayout *webcamLabelLayout = new QHBoxLayout();
shun-iwasawa c7f5f4
    m_webcamLabel = new QLabel(tr("insert webcam name here"), this);
shun-iwasawa 31accf
    webcamLabelLayout->addStretch();
shun-iwasawa 31accf
    webcamLabelLayout->addWidget(m_webcamLabel);
shun-iwasawa 31accf
    webcamLabelLayout->addStretch();
shun-iwasawa 31accf
    webcamSettingsLayout->addLayout(webcamLabelLayout);
shun-iwasawa 31accf
    webcamSettingsLayout->addSpacing(10);
shun-iwasawa 31accf
shun-iwasawa 31accf
    // webcam focus
shun-iwasawa 31accf
    m_webcamAutoFocusGB = new QGroupBox(tr("Manual Focus"), this);
shun-iwasawa 31accf
    m_webcamAutoFocusGB->setCheckable(true);
shun-iwasawa 31accf
shun-iwasawa 31accf
    m_webcamFocusSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_webcamFocusSlider->setRange(0, 255);
shun-iwasawa 31accf
    m_webcamFocusSlider->setTickInterval(5);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QHBoxLayout *webcamFocusLay = new QHBoxLayout();
shun-iwasawa 31accf
    webcamFocusLay->addWidget(new QLabel(tr("Focus: "), this), 0);
shun-iwasawa 31accf
    webcamFocusLay->addWidget(m_webcamFocusSlider, 1);
shun-iwasawa 31accf
    m_webcamAutoFocusGB->setLayout(webcamFocusLay);
shun-iwasawa 31accf
    webcamSettingsLayout->addWidget(m_webcamAutoFocusGB);
shun-iwasawa 31accf
    webcamSettingsLayout->addSpacing(5);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QGridLayout *webcamGridLay = new QGridLayout();
shun-iwasawa 31accf
    webcamGridLay->setMargin(0);
shun-iwasawa 31accf
    webcamGridLay->setSpacing(3);
shun-iwasawa 31accf
    webcamGridLay->setColumnStretch(0, 0);
shun-iwasawa 31accf
    webcamGridLay->setColumnStretch(1, 1);
shun-iwasawa 31accf
shun-iwasawa 31accf
    // webcam exposure
shun-iwasawa 31accf
    m_webcamExposureSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_webcamExposureSlider->setRange(-13, -1);
shun-iwasawa 31accf
    m_webcamExposureSlider->setTickInterval(1);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QHBoxLayout *webcamExposureLay = new QHBoxLayout();
shun-iwasawa 31accf
    webcamExposureLay->addWidget(m_webcamExposureSlider, 1);
shun-iwasawa 31accf
    webcamGridLay->addWidget(new QLabel(tr("Exposure: "), this), 0, 0, 1, 1,
shun-iwasawa 31accf
                             Qt::AlignRight);
shun-iwasawa 31accf
    webcamGridLay->addLayout(webcamExposureLay, 0, 1, 1, 1);
shun-iwasawa 31accf
shun-iwasawa 31accf
    // webcam brightness
shun-iwasawa 31accf
    m_webcamBrightnessSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_webcamBrightnessSlider->setRange(0, 255);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QHBoxLayout *webcamBrightnessLay = new QHBoxLayout();
shun-iwasawa 31accf
    webcamBrightnessLay->addWidget(m_webcamBrightnessSlider, 1);
shun-iwasawa 31accf
    webcamGridLay->addWidget(new QLabel(tr("Brightness: "), this), 1, 0, 1, 1,
shun-iwasawa 31accf
                             Qt::AlignRight);
shun-iwasawa 31accf
    webcamGridLay->addLayout(webcamBrightnessLay, 1, 1, 1, 1);
shun-iwasawa 31accf
shun-iwasawa 31accf
    // webcam contrast
shun-iwasawa 31accf
    m_webcamContrastSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_webcamContrastSlider->setRange(0, 255);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QHBoxLayout *webcamContrastLay = new QHBoxLayout();
shun-iwasawa 31accf
    webcamContrastLay->addWidget(m_webcamContrastSlider, 1);
shun-iwasawa 31accf
    webcamGridLay->addWidget(new QLabel(tr("Contrast: "), this), 2, 0, 1, 1,
shun-iwasawa 31accf
                             Qt::AlignRight);
shun-iwasawa 31accf
    webcamGridLay->addLayout(webcamContrastLay, 2, 1, 1, 1);
shun-iwasawa 31accf
shun-iwasawa 31accf
    // webcam gain
shun-iwasawa 31accf
    m_webcamGainSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_webcamGainSlider->setRange(0, 255);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QHBoxLayout *webcamGainLay = new QHBoxLayout();
shun-iwasawa 31accf
    webcamGainLay->addWidget(m_webcamGainSlider, 1);
shun-iwasawa 31accf
    webcamGridLay->addWidget(new QLabel(tr("Gain: "), this), 3, 0, 1, 1,
shun-iwasawa 31accf
                             Qt::AlignRight);
shun-iwasawa 31accf
    webcamGridLay->addLayout(webcamGainLay, 3, 1, 1, 1);
shun-iwasawa 31accf
shun-iwasawa 31accf
    // webcam saturation
shun-iwasawa 31accf
    m_webcamSaturationSlider = new QSlider(Qt::Horizontal, this);
shun-iwasawa 31accf
    m_webcamSaturationSlider->setRange(0, 255);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QHBoxLayout *webcamSaturationLay = new QHBoxLayout();
shun-iwasawa 31accf
    webcamSaturationLay->addWidget(m_webcamSaturationSlider, 1);
shun-iwasawa 31accf
    webcamGridLay->addWidget(new QLabel(tr("Saturation: "), this), 4, 0, 1, 1,
shun-iwasawa 31accf
                             Qt::AlignRight);
shun-iwasawa 31accf
    webcamGridLay->addLayout(webcamSaturationLay, 4, 1, 1, 1);
shun-iwasawa 31accf
shun-iwasawa 31accf
#ifdef _WIN32
shun-iwasawa 31accf
    m_captureFilterSettingsBtn = new QPushButton(this);
shun-iwasawa 31accf
#else
shun-iwasawa 31accf
    m_captureFilterSettingsBtn = 0;
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
    if (m_captureFilterSettingsBtn) {
shun-iwasawa 31accf
      m_captureFilterSettingsBtn->setObjectName("GearButton");
shun-iwasawa 31accf
      m_captureFilterSettingsBtn->setFixedSize(128, 28);
shun-iwasawa 31accf
      m_captureFilterSettingsBtn->setText(tr("More"));
shun-iwasawa 31accf
      m_captureFilterSettingsBtn->setIconSize(QSize(15, 15));
shun-iwasawa 31accf
      m_captureFilterSettingsBtn->setToolTip(tr("Webcam Settings..."));
shun-iwasawa 31accf
      webcamGridLay->addWidget(m_captureFilterSettingsBtn, 5, 0, 1, 2,
shun-iwasawa 31accf
                               Qt::AlignCenter);
shun-iwasawa 31accf
    }
shun-iwasawa 31accf
shun-iwasawa 31accf
    webcamSettingsLayout->addLayout(webcamGridLay);
shun-iwasawa 31accf
shun-iwasawa 31accf
    webcamSettingsLayout->addStretch();
shun-iwasawa 31accf
    m_webcamFrame = new QFrame();
shun-iwasawa 31accf
    m_webcamFrame->setSizePolicy(QSizePolicy::Expanding,
shun-iwasawa 31accf
                                 QSizePolicy::Expanding);
shun-iwasawa 31accf
    m_webcamFrame->setLayout(webcamSettingsLayout);
shun-iwasawa 31accf
    innerSettingsLayout->addWidget(m_webcamFrame);
shun-iwasawa 31accf
    m_webcamFrame->hide();
shun-iwasawa 31accf
    innerSettingsLayout->addStretch();
shun-iwasawa 31accf
    m_cameraSettingsPage->setLayout(innerSettingsLayout);
Jeremy Bullock f15907
Jeremy Bullock f15907
    // Make Options Page
shun-iwasawa 31accf
    QGroupBox *webcamBox  = new QGroupBox(tr("Webcam Options"), this);
shun-iwasawa 31accf
    QGroupBox *dslrBox    = new QGroupBox(tr("DSLR Options"), this);
justburner d63640
    m_timerCB             = new QGroupBox(tr("Use Time Lapse"), this);
justburner d63640
    m_timerIntervalFld    = new DVGui::DoubleField(this, true, 1);
justburner d63640
    m_timerCB->setCheckable(true);
justburner d63640
    m_timerCB->setObjectName("CleanupSettingsFrame");
shun-iwasawa 31accf
    m_timerCB->setChecked(false);
justburner d63640
    m_timerIntervalFld->setRange(0.0, 60.0);
justburner d63640
    m_timerIntervalFld->setValue(0.0);
shun-iwasawa 31accf
justburner d63640
    m_postCaptureReviewFld = new DVGui::DoubleField(this, true, 1);
justburner d63640
    m_postCaptureReviewFld->setRange(0.0, 10.0);
justburner d63640
    m_postCaptureReviewFld->setValue(0.0);
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
justburner d63640
    m_placeOnXSheetCB = new QCheckBox(tr("Place on XSheet"), this);
Jeremy Bullock f15907
    m_placeOnXSheetCB->setToolTip(tr("Place the frame in the XSheet"));
Jeremy Bullock f15907
justburner d63640
    m_useScaledFullSizeImages =
justburner d63640
        new QCheckBox(tr("Use Reduced Resolution Images"), this);
justburner d63640
    m_directShowCB = new QCheckBox(tr("Use Direct Show Webcam Drivers"), this);
justburner d63640
    m_useMjpgCB    = new QCheckBox(tr("Use MJPG with Webcam"), this);
justburner d63640
    m_useNumpadCB = new QCheckBox(tr("Use Numpad Shortcuts When Active"), this);
justburner d63640
    m_useNumpadCB->setToolTip(
justburner d63640
        tr("Requires restarting camera when toggled\n"
justburner d63640
           "NP 1 = Previous Frame\n"
justburner d63640
           "NP 2 = Next Frame\n"
justburner d63640
           "NP 3 = Jump To Camera\n"
justburner d63640
           "NP 5 = Toggle Live View\n"
justburner d63640
           "NP 6 = Short Play\n"
justburner d63640
           "NP 8 = Loop\n"
justburner d63640
           "NP 0 = Play\n"
justburner d63640
           "Period = Use Live View Images\n"
justburner d63640
           "Plus = Raise Opacity\n"
justburner d63640
           "Minus = Lower Opacity\n"
justburner d63640
           "Enter = Capture\n"
justburner d63640
           "BackSpace = Remove Frame\n"
justburner d63640
           "Multiply = Toggle Zoom\n"
justburner d63640
           "Divide = Focus Check"));
justburner d63640
    m_drawBeneathCB = new QCheckBox(tr("Show Camera Below Other Levels"), this);
justburner d63640
    m_liveViewOnAllFramesCB =
justburner d63640
        new QCheckBox(tr("Show Live View on All Frames"), this);
justburner d63640
    m_playSound = new QCheckBox(tr("Play Sound on Capture"), this);
justburner d63640
    m_playSound->setToolTip(tr("Make a click sound on each capture"));
Jeremy Bullock f15907
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
justburner d63640
    dslrLayout->addWidget(m_useScaledFullSizeImages, 1, 0, 1, 2);
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);
shun-iwasawa 31accf
    dslrBox->hide();
Jeremy Bullock f15907
justburner d63640
    webcamLayout->addWidget(m_directShowCB, 0, 0, 1, 2);
justburner d63640
    webcamLayout->addWidget(m_useMjpgCB, 1, 0, 1, 2);
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);
shun-iwasawa 31accf
    webcamBox->hide();
shun-iwasawa 31accf
shun-iwasawa 31accf
    QGridLayout *timerLay = new QGridLayout();
shun-iwasawa 31accf
    timerLay->setMargin(8);
shun-iwasawa 31accf
    timerLay->setHorizontalSpacing(3);
shun-iwasawa 31accf
    timerLay->setVerticalSpacing(5);
shun-iwasawa 31accf
    {
shun-iwasawa 31accf
      timerLay->addWidget(new QLabel(tr("Interval(sec):"), this), 1, 0,
shun-iwasawa 31accf
                          Qt::AlignRight);
shun-iwasawa 31accf
      timerLay->addWidget(m_timerIntervalFld, 1, 1);
shun-iwasawa 31accf
    }
shun-iwasawa 31accf
    timerLay->setColumnStretch(0, 0);
shun-iwasawa 31accf
    timerLay->setColumnStretch(1, 1);
justburner d63640
    m_timerCB->setLayout(timerLay);
justburner d63640
    optionsOutsideLayout->addWidget(m_timerCB);
Jeremy Bullock f15907
justburner d63640
    checkboxLayout->addWidget(m_placeOnXSheetCB, 0, 0, 1, 2);
shun-iwasawa 31accf
    m_placeOnXSheetCB->hide();
justburner d63640
    checkboxLayout->addWidget(m_drawBeneathCB, 1, 0, 1, 2);
shun-iwasawa 31accf
    m_drawBeneathCB->hide();
shun-iwasawa 31accf
justburner d63640
    checkboxLayout->addWidget(m_useNumpadCB, 2, 0, 1, 2);
justburner d63640
    checkboxLayout->addWidget(m_liveViewOnAllFramesCB, 3, 0, 1, 2);
shun-iwasawa 31accf
    m_liveViewOnAllFramesCB->hide();
justburner d63640
    checkboxLayout->addWidget(m_playSound, 4, 0, 1, 2);
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);
shun-iwasawa 31accf
    // optionsLayout->addWidget(new QLabel(tr("Level Subsampling: ")), 1, 0,
shun-iwasawa 31accf
    //                         Qt::AlignRight);
Jeremy Bullock f15907
    optionsLayout->addWidget(m_subsamplingFld, 1, 1);
shun-iwasawa 31accf
    m_subsamplingFld->hide();
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
shun-iwasawa 31accf
    m_blackScreenForCapture = new QCheckBox(tr("Blackout all Screens"), this);
shun-iwasawa 31accf
    QVBoxLayout *lightOutsideLayout = new QVBoxLayout;
shun-iwasawa 31accf
    m_testLightsButton              = new QPushButton(tr("Test"), this);
shun-iwasawa 31accf
    m_testLightsButton->setMaximumWidth(150);
shun-iwasawa 31accf
    m_testLightsButton->setFixedHeight(28);
shun-iwasawa 31accf
    m_testLightsButton->setSizePolicy(QSizePolicy::Maximum,
shun-iwasawa 31accf
                                      QSizePolicy::Maximum);
shun-iwasawa 31accf
    m_testLightsButton->setStyleSheet("padding: 2px;");
shun-iwasawa 31accf
    m_lightTestTimer = new QTimer(this);
shun-iwasawa 31accf
    m_lightTestTimer->setSingleShot(true);
shun-iwasawa 31accf
    m_screen1ColorFld = new DVGui::ColorField(
shun-iwasawa 31accf
        this, false, TPixel32(0, 0, 0, 255), 40, true, 60);
shun-iwasawa 31accf
shun-iwasawa 31accf
    m_screen2ColorFld = new DVGui::ColorField(
shun-iwasawa 31accf
        this, false, TPixel32(0, 0, 0, 255), 40, true, 60);
shun-iwasawa 31accf
shun-iwasawa 31accf
    m_screen3ColorFld = new DVGui::ColorField(
shun-iwasawa 31accf
        this, false, TPixel32(0, 0, 0, 255), 40, true, 60);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QGridLayout *lightTopLayout = new QGridLayout;
shun-iwasawa 31accf
    lightTopLayout->addWidget(m_blackScreenForCapture, 0, 0, Qt::AlignRight);
shun-iwasawa 31accf
    lightTopLayout->setColumnStretch(1, 30);
shun-iwasawa 31accf
    lightOutsideLayout->addLayout(lightTopLayout);
shun-iwasawa 31accf
shun-iwasawa 31accf
    m_screen1Box = new QGroupBox(tr("Screen 1"), this);
shun-iwasawa 31accf
    m_screen1Box->setCheckable(true);
shun-iwasawa 31accf
    m_screen1Box->setChecked(false);
shun-iwasawa 31accf
    QGridLayout *screen1Layout = new QGridLayout;
shun-iwasawa 31accf
    screen1Layout->addWidget(m_screen1ColorFld, 0, 0, 1, 2, Qt::AlignLeft);
shun-iwasawa 31accf
    screen1Layout->setColumnStretch(1, 30);
shun-iwasawa 31accf
    m_screen1Box->setLayout(screen1Layout);
shun-iwasawa 31accf
    m_screen1Box->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
shun-iwasawa 31accf
    lightOutsideLayout->addWidget(m_screen1Box, Qt::AlignCenter);
shun-iwasawa 31accf
shun-iwasawa 31accf
    m_screen2Box = new QGroupBox(tr("Screen 2"), this);
shun-iwasawa 31accf
    m_screen2Box->setCheckable(true);
shun-iwasawa 31accf
    m_screen2Box->setChecked(false);
shun-iwasawa 31accf
    QGridLayout *screen2Layout = new QGridLayout;
shun-iwasawa 31accf
    screen2Layout->addWidget(m_screen2ColorFld, 0, 0, 1, 2, Qt::AlignLeft);
shun-iwasawa 31accf
    screen2Layout->setColumnStretch(1, 30);
shun-iwasawa 31accf
    m_screen2Box->setLayout(screen2Layout);
shun-iwasawa 31accf
    m_screen2Box->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
shun-iwasawa 31accf
    lightOutsideLayout->addWidget(m_screen2Box, Qt::AlignCenter);
shun-iwasawa 31accf
shun-iwasawa 31accf
    m_screen3Box = new QGroupBox(tr("Screen 3"), this);
shun-iwasawa 31accf
    m_screen3Box->setCheckable(true);
shun-iwasawa 31accf
    m_screen3Box->setChecked(false);
shun-iwasawa 31accf
    QGridLayout *screen3Layout = new QGridLayout;
shun-iwasawa 31accf
    screen3Layout->addWidget(m_screen3ColorFld, 0, 0, 1, 2, Qt::AlignLeft);
shun-iwasawa 31accf
    screen3Layout->setColumnStretch(1, 30);
shun-iwasawa 31accf
    m_screen3Box->setLayout(screen3Layout);
shun-iwasawa 31accf
    m_screen3Box->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
shun-iwasawa 31accf
    lightOutsideLayout->addWidget(m_screen3Box, Qt::AlignCenter);
shun-iwasawa 31accf
shun-iwasawa 31accf
    QHBoxLayout *testLayout = new QHBoxLayout;
shun-iwasawa 31accf
    testLayout->addWidget(m_testLightsButton, Qt::AlignHCenter);
shun-iwasawa 31accf
    lightOutsideLayout->addLayout(testLayout);
shun-iwasawa 31accf
    lightOutsideLayout->addStretch();
shun-iwasawa 31accf
    m_lightPage->setLayout(lightOutsideLayout);
shun-iwasawa 31accf
shun-iwasawa 31accf
    if (m_stopMotion->m_light->m_screenCount < 3) m_screen3Box->hide();
shun-iwasawa 31accf
    if (m_stopMotion->m_light->m_screenCount < 2) m_screen2Box->hide();
shun-iwasawa 31accf
shun-iwasawa 31accf
    QVBoxLayout *motionOutsideLayout = new QVBoxLayout;
shun-iwasawa 31accf
    // QGridLayout* motionInsideLayout = new QGridLayout;
shun-iwasawa 31accf
    m_controlDeviceCombo = new QComboBox(this);
shun-iwasawa 31accf
    m_controlDeviceCombo->addItems(
shun-iwasawa 31accf
        m_stopMotion->m_serial->getAvailableSerialPorts());
shun-iwasawa 31accf
shun-iwasawa 31accf
    QGroupBox *motionBox      = new QGroupBox(tr("Motion Control"), this);
shun-iwasawa 31accf
    QGridLayout *motionLayout = new QGridLayout;
shun-iwasawa 31accf
    motionLayout->addWidget(new QLabel(tr("Port: ")), 0, 0, Qt::AlignRight);
shun-iwasawa 31accf
    motionLayout->addWidget(m_controlDeviceCombo, 0, 1, Qt::AlignLeft);
shun-iwasawa 31accf
    motionLayout->setColumnStretch(1, 30);
shun-iwasawa 31accf
    motionBox->setLayout(motionLayout);
shun-iwasawa 31accf
    motionBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum);
shun-iwasawa 31accf
    motionOutsideLayout->addWidget(motionBox, Qt::AlignCenter);
shun-iwasawa 31accf
    motionOutsideLayout->addStretch();
shun-iwasawa 31accf
shun-iwasawa 31accf
    // motionOutsideLayout->addLayout(motionInsideLayout);
shun-iwasawa 31accf
    m_motionPage->setLayout(motionOutsideLayout);
shun-iwasawa 31accf
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);
shun-iwasawa 31accf
    QScrollArea *lightArea   = makeChooserPageWithoutScrollBar(m_lightPage);
shun-iwasawa 31accf
    QScrollArea *motionArea  = makeChooserPageWithoutScrollBar(m_motionPage);
shun-iwasawa 31accf
shun-iwasawa 31accf
    mainArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
shun-iwasawa 31accf
    settingsArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
shun-iwasawa 31accf
    optionsArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
shun-iwasawa 31accf
    lightArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
shun-iwasawa 31accf
    motionArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
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);
shun-iwasawa 31accf
    m_stackedChooser->addWidget(lightArea);
shun-iwasawa 31accf
    m_stackedChooser->addWidget(motionArea);
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);
shun-iwasawa 31accf
    controlButtonLay->addWidget(m_alwaysUseLiveViewImagesButton, 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
shun-iwasawa 31accf
  ret = ret && connect(refreshCamListButton, SIGNAL(clicked()), 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)
shun-iwasawa 31accf
    ret = ret && connect(m_captureFilterSettingsBtn, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                         SLOT(onCaptureFilterSettingsBtnPressed()));
shun-iwasawa 31accf
  ret = ret && connect(m_fileFormatOptionButton, SIGNAL(clicked()), 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 &&
shun-iwasawa 31accf
        connect(nextLevelButton, SIGNAL(clicked()), this, SLOT(onNextName()));
shun-iwasawa 31accf
  ret = ret && connect(m_previousLevelButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onPreviousName()));
shun-iwasawa 31accf
  ret = ret && connect(nextOpenLevelButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onNextNewLevel()));
Jeremy Bullock f15907
  ret = ret &&
shun-iwasawa 31accf
        connect(nextFrameButton, SIGNAL(clicked()), this, SLOT(onNextFrame()));
Jeremy Bullock f15907
  ret = ret &&
shun-iwasawa 31accf
        connect(lastFrameButton, SIGNAL(clicked()), this, SLOT(onLastFrame()));
shun-iwasawa 31accf
  ret = ret && connect(m_previousFrameButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onPreviousFrame()));
shun-iwasawa 31accf
  ret = ret && connect(nextXSheetFrameButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onNextXSheetFrame()));
shun-iwasawa 31accf
  ret = ret && connect(m_previousXSheetFrameButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onPreviousXSheetFrame()));
shun-iwasawa 31accf
  ret = ret && connect(m_setToCurrentXSheetFrameButton, SIGNAL(clicked()), 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()));
shun-iwasawa 31accf
  ret = ret && connect(m_alwaysUseLiveViewImagesButton, SIGNAL(clicked()), this,
shun-iwasawa 31accf
                       SLOT(onAlwaysUseLiveViewImagesButtonClicked()));
shun-iwasawa 31accf
  ret =
shun-iwasawa 31accf
      ret && connect(m_stopMotion, SIGNAL(alwaysUseLiveViewImagesToggled(bool)),
shun-iwasawa 31accf
                     this, SLOT(onAlwaysUseLiveViewImagesToggled(bool)));
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)));
justburner d63640
  ret = ret && connect(m_playSound, SIGNAL(toggled(bool)), this,
justburner d63640
                       SLOT(onPlaySoundToggled(bool)));
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)));
shun-iwasawa 31accf
  ret = ret && connect(m_drawBeneathCB, SIGNAL(stateChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onDrawBeneathChanged(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)));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_canon, SIGNAL(scaleFullSizeImagesSignal(bool)),
shun-iwasawa 31accf
                this, SLOT(onScaleFullSizeImagesSignal(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)));
shun-iwasawa 31accf
  ret =
shun-iwasawa 31accf
      ret && connect(m_stopMotion->m_webcam, SIGNAL(useDirectShowSignal(bool)),
shun-iwasawa 31accf
                     this, SLOT(onUseDirectShowSignal(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_webcam, SIGNAL(useMjpgSignal(bool)),
shun-iwasawa 31accf
                       this, SLOT(onUseMjpgSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(useNumpadSignal(bool)), this,
Jeremy Bullock f15907
                       SLOT(onUseNumpadSignal(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion, SIGNAL(drawBeneathLevelsSignal(bool)),
shun-iwasawa 31accf
                       this, SLOT(onDrawBeneathSignal(bool)));
Jeremy Bullock f15907
  ret = ret && connect(m_stopMotion, SIGNAL(reviewTimeChangedSignal(int)), this,
Jeremy Bullock f15907
                       SLOT(onReviewTimeChangedSignal(int)));
justburner d63640
  ret = ret && connect(m_stopMotion, SIGNAL(playCaptureSignal(bool)), this,
justburner d63640
                       SLOT(onPlayCaptureSignal(bool)));
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()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion, SIGNAL(updateCameraList(QString)), this,
shun-iwasawa 31accf
                       SLOT(refreshCameraList(QString)));
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)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion, SIGNAL(cameraChanged(QString)), this,
shun-iwasawa 31accf
                       SLOT(refreshCameraList(QString)));
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 &&
shun-iwasawa 31accf
        connect(m_zoomButton, SIGNAL(clicked()), this, SLOT(onZoomPressed()));
shun-iwasawa 31accf
  ret = ret && connect(m_pickZoomButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onPickZoomPressed()));
shun-iwasawa 31accf
  ret = ret && connect(m_focusNearButton, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onFocusNear()));
Jeremy Bullock f15907
  ret = ret &&
shun-iwasawa 31accf
        connect(m_focusFarButton, SIGNAL(clicked()), this, SLOT(onFocusFar()));
shun-iwasawa 31accf
  ret = ret && connect(m_focusNear2Button, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onFocusNear2()));
shun-iwasawa 31accf
  ret = ret && connect(m_focusFar2Button, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onFocusFar2()));
shun-iwasawa 31accf
  ret = ret && connect(m_focusNear3Button, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onFocusNear3()));
shun-iwasawa 31accf
  ret = ret && connect(m_focusFar3Button, SIGNAL(clicked()), this,
Jeremy Bullock f15907
                       SLOT(onFocusFar3()));
Jeremy Bullock f15907
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_canon, SIGNAL(apertureChangedSignal(QString)),
shun-iwasawa 31accf
                this, SLOT(onApertureChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon, SIGNAL(isoChangedSignal(QString)),
shun-iwasawa 31accf
                       this, SLOT(onIsoChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon,
shun-iwasawa 31accf
                       SIGNAL(shutterSpeedChangedSignal(QString)), this,
shun-iwasawa 31accf
                       SLOT(onShutterSpeedChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_canon, SIGNAL(exposureChangedSignal(QString)),
shun-iwasawa 31accf
                this, SLOT(onExposureChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon,
shun-iwasawa 31accf
                       SIGNAL(whiteBalanceChangedSignal(QString)), this,
shun-iwasawa 31accf
                       SLOT(onWhiteBalanceChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon,
shun-iwasawa 31accf
                       SIGNAL(imageQualityChangedSignal(QString)), this,
shun-iwasawa 31accf
                       SLOT(onImageQualityChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon,
shun-iwasawa 31accf
                       SIGNAL(pictureStyleChangedSignal(QString)), this,
shun-iwasawa 31accf
                       SLOT(onPictureStyleChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon,
shun-iwasawa 31accf
                       SIGNAL(colorTemperatureChangedSignal(QString)), this,
shun-iwasawa 31accf
                       SLOT(onColorTemperatureChangedSignal(QString)));
shun-iwasawa 31accf
  ret = ret && connect(m_apertureSlider, SIGNAL(valueChanged(int)), this,
Jeremy Bullock f15907
                       SLOT(onApertureChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_shutterSpeedSlider, SIGNAL(valueChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onShutterSpeedChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_isoSlider, SIGNAL(valueChanged(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)));
shun-iwasawa 31accf
  ret = ret && connect(m_kelvinSlider, SIGNAL(valueChanged(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)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon, SIGNAL(apertureOptionsChanged()),
shun-iwasawa 31accf
                       this, SLOT(refreshApertureList()));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_canon, SIGNAL(shutterSpeedOptionsChanged()),
shun-iwasawa 31accf
                this, SLOT(refreshShutterSpeedList()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon, SIGNAL(isoOptionsChanged()), this,
Jeremy Bullock f15907
                       SLOT(refreshIsoList()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon, SIGNAL(exposureOptionsChanged()),
shun-iwasawa 31accf
                       this, SLOT(refreshExposureList()));
Jeremy Bullock f15907
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_canon, SIGNAL(whiteBalanceOptionsChanged()),
shun-iwasawa 31accf
                this, SLOT(refreshWhiteBalanceList()));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_canon, SIGNAL(imageQualityOptionsChanged()),
shun-iwasawa 31accf
                this, SLOT(refreshImageQualityList()));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_canon, SIGNAL(pictureStyleOptionsChanged()),
shun-iwasawa 31accf
                this, SLOT(refreshPictureStyleList()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon, SIGNAL(modeChanged()), this,
shun-iwasawa 31accf
                       SLOT(refreshMode()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_canon, SIGNAL(focusCheckToggled(bool)),
shun-iwasawa 31accf
                       this, SLOT(onFocusCheckToggled(bool)));
shun-iwasawa 31accf
  ret =
shun-iwasawa 31accf
      ret && connect(m_stopMotion->m_canon, SIGNAL(pickFocusCheckToggled(bool)),
shun-iwasawa 31accf
                     this, SLOT(onPickFocusCheckToggled(bool)));
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)));
shun-iwasawa 31accf
  ret = ret && connect(m_webcamFocusSlider, SIGNAL(valueChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onWebcamFocusSliderChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_webcamAutoFocusGB, SIGNAL(toggled(bool)), this,
shun-iwasawa 31accf
                       SLOT(onWebcamAutofocusToggled(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_webcamExposureSlider, SIGNAL(valueChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onWebcamExposureSliderChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_webcamBrightnessSlider, SIGNAL(valueChanged(int)),
shun-iwasawa 31accf
                       this, SLOT(onWebcamBrightnessSliderChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_webcamContrastSlider, SIGNAL(valueChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onWebcamContrastSliderChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_webcamGainSlider, SIGNAL(valueChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onWebcamGainSliderChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_webcamSaturationSlider, SIGNAL(valueChanged(int)),
shun-iwasawa 31accf
                       this, SLOT(onWebcamSaturationSliderChanged(int)));
shun-iwasawa 31accf
shun-iwasawa 31accf
  // Lighting Connections
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_screen1ColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)),
shun-iwasawa 31accf
                this, SLOT(setScreen1Color(const TPixel32 &, bool)));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_screen2ColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)),
shun-iwasawa 31accf
                this, SLOT(setScreen2Color(const TPixel32 &, bool)));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_screen3ColorFld, SIGNAL(colorChanged(const TPixel32 &, bool)),
shun-iwasawa 31accf
                this, SLOT(setScreen3Color(const TPixel32 &, bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_screen1Box, SIGNAL(toggled(bool)), this,
shun-iwasawa 31accf
                       SLOT(onScreen1OverlayToggled(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_screen2Box, SIGNAL(toggled(bool)), this,
shun-iwasawa 31accf
                       SLOT(onScreen2OverlayToggled(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_screen3Box, SIGNAL(toggled(bool)), this,
shun-iwasawa 31accf
                       SLOT(onScreen3OverlayToggled(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_lightTestTimer, SIGNAL(timeout()), this,
shun-iwasawa 31accf
                       SLOT(onTestLightsTimeout()));
shun-iwasawa 31accf
  ret = ret && connect(m_testLightsButton, SIGNAL(clicked()), this,
shun-iwasawa 31accf
                       SLOT(onTestLightsPressed()));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_light, SIGNAL(screen1ColorChanged(TPixel32)),
shun-iwasawa 31accf
                this, SLOT(onScreen1ColorChanged(TPixel32)));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_light, SIGNAL(screen2ColorChanged(TPixel32)),
shun-iwasawa 31accf
                this, SLOT(onScreen2ColorChanged(TPixel32)));
shun-iwasawa 31accf
  ret = ret &&
shun-iwasawa 31accf
        connect(m_stopMotion->m_light, SIGNAL(screen3ColorChanged(TPixel32)),
shun-iwasawa 31accf
                this, SLOT(onScreen3ColorChanged(TPixel32)));
shun-iwasawa 31accf
  ret =
shun-iwasawa 31accf
      ret && connect(m_stopMotion->m_light, SIGNAL(screen1OverlayChanged(bool)),
shun-iwasawa 31accf
                     this, SLOT(onScreen1OverlayChanged(bool)));
shun-iwasawa 31accf
  ret =
shun-iwasawa 31accf
      ret && connect(m_stopMotion->m_light, SIGNAL(screen2OverlayChanged(bool)),
shun-iwasawa 31accf
                     this, SLOT(onScreen2OverlayChanged(bool)));
shun-iwasawa 31accf
  ret =
shun-iwasawa 31accf
      ret && connect(m_stopMotion->m_light, SIGNAL(screen3OverlayChanged(bool)),
shun-iwasawa 31accf
                     this, SLOT(onScreen3OverlayChanged(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_blackScreenForCapture, SIGNAL(stateChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onBlackScreenForCaptureChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_light, SIGNAL(blackCaptureSignal(bool)),
shun-iwasawa 31accf
                       this, SLOT(onBlackCaptureSignal(bool)));
shun-iwasawa 31accf
shun-iwasawa 31accf
  // Serial Port Connections
shun-iwasawa 31accf
  ret = ret && connect(m_controlDeviceCombo, SIGNAL(currentIndexChanged(int)),
shun-iwasawa 31accf
                       this, SLOT(serialPortChanged(int)));
shun-iwasawa 31accf
shun-iwasawa 31accf
  // Time Lapse
shun-iwasawa 31accf
  ret = ret && connect(m_timerCB, SIGNAL(toggled(bool)), this,
shun-iwasawa 31accf
                       SLOT(onIntervalTimerCBToggled(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_timerIntervalFld, SIGNAL(valueChanged(bool)), this,
shun-iwasawa 31accf
                       SLOT(onIntervalSliderValueChanged(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion, SIGNAL(intervalAmountChanged(int)), this,
shun-iwasawa 31accf
                       SLOT(onIntervalAmountChanged(int)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion, SIGNAL(intervalToggled(bool)), this,
shun-iwasawa 31accf
                       SLOT(onIntervalToggled(bool)));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion, SIGNAL(intervalStarted()), this,
shun-iwasawa 31accf
                       SLOT(onIntervalStarted()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion, SIGNAL(intervalStopped()), this,
shun-iwasawa 31accf
                       SLOT(onIntervalStopped()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_intervalTimer, SIGNAL(timeout()), this,
shun-iwasawa 31accf
                       SLOT(onIntervalCaptureTimerTimeout()));
shun-iwasawa 31accf
  ret = ret && connect(m_stopMotion->m_countdownTimer, SIGNAL(timeout()), this,
shun-iwasawa 31accf
                       SLOT(onIntervalCountDownTimeout()));
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);
shun-iwasawa 31accf
  m_useScaledFullSizeImages->setChecked(
shun-iwasawa 31accf
      m_stopMotion->m_canon->m_useScaledImages);
Jeremy Bullock f15907
  m_onionOpacityFld->setValue(double(100 * m_stopMotion->getOpacity()) / 255.0);
shun-iwasawa 31accf
  m_directShowCB->setChecked(m_stopMotion->m_webcam->getUseDirectShow());
shun-iwasawa 31accf
  m_useMjpgCB->setChecked(m_stopMotion->m_webcam->getUseMjpg());
Jeremy Bullock f15907
  m_useNumpadCB->setChecked(m_stopMotion->getUseNumpadShortcuts());
shun-iwasawa 31accf
  m_drawBeneathCB->setChecked(m_stopMotion->m_drawBeneathLevels);
Jeremy Bullock f15907
  m_liveViewOnAllFramesCB->setChecked(m_stopMotion->getAlwaysLiveView());
justburner d63640
  m_playSound->setChecked(m_stopMotion->getPlayCaptureSound());
Jeremy Bullock f15907
  m_blackScreenForCapture->setChecked(
shun-iwasawa 31accf
      m_stopMotion->m_light->getBlackCapture() == true ? true : false);
shun-iwasawa 31accf
  if (m_stopMotion->m_light->getBlackCapture()) {
shun-iwasawa 31accf
    m_screen1Box->setDisabled(true);
shun-iwasawa 31accf
    m_screen2Box->setDisabled(true);
shun-iwasawa 31accf
    m_screen3Box->setDisabled(true);
shun-iwasawa 31accf
  }
justburner d63640
  m_postCaptureReviewFld->setValue(m_stopMotion->getReviewTimeDSec() / 10.0);
justburner d63640
  m_timerIntervalFld->setValue(m_stopMotion->getIntervalDSec() / 10.0);
Jeremy Bullock f15907
shun-iwasawa 31accf
  refreshCameraList(QString(""));
Jeremy Bullock f15907
  onSceneSwitched();
Jeremy Bullock f15907
  m_stopMotion->setToNextNewLevel();
Jeremy Bullock f15907
  m_saveInFileFld->setPath(m_stopMotion->getFilePath());
shun-iwasawa 31accf
shun-iwasawa 31accf
#ifndef _WIN32
shun-iwasawa 31accf
  m_directShowCB->hide();
shun-iwasawa 31accf
#endif
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) {
shun-iwasawa 31accf
  if (index > 0 && m_tabBar->tabText(1) != tr("Settings")) {
shun-iwasawa 31accf
    index += 1;
shun-iwasawa 31accf
  }
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) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->setUseScaledImages(checked > 0 ? true : false);
shun-iwasawa 31accf
#endif
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) {
shun-iwasawa 31accf
  m_stopMotion->m_light->setBlackCapture(checked);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onBlackCaptureSignal(bool on) {
shun-iwasawa 31accf
  m_blackScreenForCapture->blockSignals(true);
Jeremy Bullock f15907
  m_blackScreenForCapture->setChecked(on);
shun-iwasawa 31accf
  m_screen1Box->setDisabled(on);
shun-iwasawa 31accf
  m_screen2Box->setDisabled(on);
shun-iwasawa 31accf
  m_screen3Box->setDisabled(on);
shun-iwasawa 31accf
  m_blackScreenForCapture->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::setScreen1Color(const TPixel32 &bgColor,
shun-iwasawa 31accf
                                           bool isDragging) {
shun-iwasawa 31accf
  m_stopMotion->m_light->setScreen1Color(bgColor);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::setScreen2Color(const TPixel32 &bgColor,
shun-iwasawa 31accf
                                           bool isDragging) {
shun-iwasawa 31accf
  m_stopMotion->m_light->setScreen2Color(bgColor);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::setScreen3Color(const TPixel32 &bgColor,
shun-iwasawa 31accf
                                           bool isDragging) {
shun-iwasawa 31accf
  m_stopMotion->m_light->setScreen3Color(bgColor);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen1OverlayToggled(bool on) {
shun-iwasawa 31accf
  m_stopMotion->m_light->setScreen1UseOverlay(on);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen2OverlayToggled(bool on) {
shun-iwasawa 31accf
  m_stopMotion->m_light->setScreen2UseOverlay(on);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen3OverlayToggled(bool on) {
shun-iwasawa 31accf
  m_stopMotion->m_light->setScreen3UseOverlay(on);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen1ColorChanged(TPixel32 color) {
shun-iwasawa 31accf
  m_screen1ColorFld->blockSignals(true);
shun-iwasawa 31accf
  m_screen1ColorFld->setColor(color);
shun-iwasawa 31accf
  m_screen1ColorFld->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen2ColorChanged(TPixel32 color) {
shun-iwasawa 31accf
  m_screen2ColorFld->blockSignals(true);
shun-iwasawa 31accf
  m_screen2ColorFld->setColor(color);
shun-iwasawa 31accf
  m_screen2ColorFld->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen3ColorChanged(TPixel32 color) {
shun-iwasawa 31accf
  m_screen3ColorFld->blockSignals(true);
shun-iwasawa 31accf
  m_screen3ColorFld->setColor(color);
shun-iwasawa 31accf
  m_screen3ColorFld->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen1OverlayChanged(bool on) {
shun-iwasawa 31accf
  m_screen1Box->blockSignals(true);
shun-iwasawa 31accf
  m_screen1Box->setChecked(on);
shun-iwasawa 31accf
  m_screen1Box->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen2OverlayChanged(bool on) {
shun-iwasawa 31accf
  m_screen2Box->blockSignals(true);
shun-iwasawa 31accf
  m_screen2Box->setChecked(on);
shun-iwasawa 31accf
  m_screen2Box->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onScreen3OverlayChanged(bool on) {
shun-iwasawa 31accf
  m_screen3Box->blockSignals(true);
shun-iwasawa 31accf
  m_screen3Box->setChecked(on);
shun-iwasawa 31accf
  m_screen3Box->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onTestLightsPressed() {
shun-iwasawa 31accf
  m_stopMotion->m_light->showOverlays();
shun-iwasawa 31accf
  m_lightTestTimer->start(2000);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onTestLightsTimeout() {
shun-iwasawa 31accf
  m_stopMotion->m_light->hideOverlays();
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) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->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) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->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
shun-iwasawa 31accf
void StopMotionController::onDrawBeneathChanged(int checked) {
shun-iwasawa 31accf
  m_stopMotion->setDrawBeneathLevels(checked);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onDrawBeneathSignal(bool on) {
shun-iwasawa 31accf
  m_drawBeneathCB->setChecked(on);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
Jeremy Bullock f15907
void StopMotionController::onCaptureReviewFldEdited() {
justburner d63640
  m_stopMotion->setReviewTimeDSec(m_postCaptureReviewFld->getValue() * 10.0);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onCaptureReviewSliderChanged(bool ignore) {
justburner d63640
  m_stopMotion->setReviewTimeDSec(m_postCaptureReviewFld->getValue() * 10.0);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onReviewTimeChangedSignal(int time) {
justburner d63640
  m_postCaptureReviewFld->setValue(time / 10.0);
justburner d63640
}
justburner d63640
justburner d63640
//-----------------------------------------------------------------------------
justburner d63640
justburner d63640
void StopMotionController::onPlayCaptureSignal(bool on) {
justburner d63640
  m_playSound->setChecked(on);
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
shun-iwasawa 31accf
void StopMotionController::refreshCameraList(QString activeCamera) {
shun-iwasawa 31accf
  m_cameraListCombo->blockSignals(true);
Jeremy Bullock f15907
  m_cameraListCombo->clear();
shun-iwasawa 31accf
  m_cameraStatusLabel->hide();
shun-iwasawa 31accf
  QList<qcamerainfo> webcams = m_stopMotion->m_webcam->getWebcams();</qcamerainfo>
shun-iwasawa 31accf
  int count                  = webcams.count();
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  count += m_stopMotion->m_canon->getCameraCount();
shun-iwasawa 31accf
#endif
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
    }
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
    if (m_stopMotion->m_canon->getCameraCount() > 0) {
Jeremy Bullock f15907
      QString name;
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCamera(0);
shun-iwasawa 31accf
      bool open = m_stopMotion->m_canon->m_sessionOpen;
shun-iwasawa 31accf
      if (!open) m_stopMotion->m_canon->openCameraSession();
shun-iwasawa 31accf
      name = QString::fromStdString(m_stopMotion->m_canon->getCameraName());
shun-iwasawa 31accf
      if (!open) m_stopMotion->m_canon->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
    }
shun-iwasawa 31accf
#endif
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
  }
shun-iwasawa 31accf
  if (activeCamera != "") m_cameraListCombo->setCurrentText(activeCamera);
shun-iwasawa 31accf
  m_cameraListCombo->blockSignals(false);
Jeremy Bullock f15907
  m_stopMotion->updateLevelNameAndFrame(m_levelNameEdit->text().toStdWString());
Jeremy Bullock f15907
  refreshOptionsLists();
shun-iwasawa 31accf
#ifdef WITH_CANON
Jeremy Bullock f15907
  refreshMode();
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshOptionsLists() {
shun-iwasawa 31accf
  m_apertureSlider->blockSignals(true);
shun-iwasawa 31accf
  m_isoSlider->blockSignals(true);
shun-iwasawa 31accf
  m_shutterSpeedSlider->blockSignals(true);
Jeremy Bullock f15907
  m_exposureCombo->blockSignals(true);
Jeremy Bullock f15907
  m_whiteBalanceCombo->blockSignals(true);
shun-iwasawa 31accf
  m_kelvinSlider->blockSignals(true);
Jeremy Bullock f15907
  m_imageQualityCombo->blockSignals(true);
Jeremy Bullock f15907
  m_pictureStyleCombo->blockSignals(true);
Jeremy Bullock f15907
shun-iwasawa 31accf
  // m_isoCombo->clear();
shun-iwasawa 31accf
  // m_shutterSpeedCombo->clear();
shun-iwasawa 31accf
  // m_apertureSlider->clear();
Jeremy Bullock f15907
  m_exposureCombo->clear();
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  if (m_stopMotion->m_canon->getCameraCount() == 0) {
shun-iwasawa 31accf
    m_shutterSpeedSlider->setDisabled(true);
shun-iwasawa 31accf
    m_isoSlider->setDisabled(true);
shun-iwasawa 31accf
    m_apertureSlider->setDisabled(true);
Jeremy Bullock f15907
    m_exposureCombo->setDisabled(true);
Jeremy Bullock f15907
    m_whiteBalanceCombo->setDisabled(true);
shun-iwasawa 31accf
    m_kelvinSlider->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();
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshMode() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  if (m_stopMotion->m_canon->getCameraCount() == 0) {
Jeremy Bullock f15907
    m_cameraModeLabel->setText("");
shun-iwasawa 31accf
    m_cameraStatusLabel->hide();
Jeremy Bullock f15907
    return;
Jeremy Bullock f15907
  }
shun-iwasawa 31accf
  QString mode    = m_stopMotion->m_canon->getMode();
shun-iwasawa 31accf
  QString battery = m_stopMotion->m_canon->getCurrentBatteryLevel();
Jeremy Bullock f15907
  m_cameraModeLabel->setText(tr("Mode: ") + mode);
shun-iwasawa c7f5f4
  m_cameraStatusLabel->setText(tr("Mode: ") + mode + tr(" - Battery: ") +
shun-iwasawa c7f5f4
                               battery);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshApertureList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_apertureSlider->blockSignals(true);
shun-iwasawa 31accf
  int count = 0;
shun-iwasawa 31accf
  m_stopMotion->m_canon->getAvailableApertures();
shun-iwasawa 31accf
  count = m_stopMotion->m_canon->getApertureOptions().size();
shun-iwasawa 31accf
shun-iwasawa 31accf
  if (count == 0) {
shun-iwasawa 31accf
    m_apertureLabel->setText(tr("Aperture: Auto"));
shun-iwasawa 31accf
    m_apertureSlider->setDisabled(true);
shun-iwasawa 31accf
    m_apertureSlider->setRange(0, 0);
Jeremy Bullock f15907
  } else {
shun-iwasawa 31accf
    m_apertureSlider->setEnabled(true);
shun-iwasawa 31accf
    m_apertureLabel->setText(tr("Aperture: ") +
shun-iwasawa 31accf
                             m_stopMotion->m_canon->getCurrentAperture());
shun-iwasawa 31accf
    m_apertureSlider->setRange(0, count - 1);
shun-iwasawa 31accf
    m_apertureSlider->setValue(
shun-iwasawa 31accf
        m_stopMotion->m_canon->getApertureOptions().lastIndexOf(
shun-iwasawa 31accf
            m_stopMotion->m_canon->getCurrentAperture()));
Jeremy Bullock f15907
  }
shun-iwasawa 31accf
  m_apertureSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshShutterSpeedList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_shutterSpeedSlider->blockSignals(true);
shun-iwasawa 31accf
  int count = 0;
shun-iwasawa 31accf
  m_stopMotion->m_canon->getAvailableShutterSpeeds();
shun-iwasawa 31accf
  count = m_stopMotion->m_canon->getShutterSpeedOptions().size();
shun-iwasawa 31accf
shun-iwasawa 31accf
  if (count == 0) {
shun-iwasawa 31accf
    m_shutterSpeedLabel->setText(tr("Shutter Speed: Auto"));
shun-iwasawa 31accf
    m_shutterSpeedSlider->setDisabled(true);
shun-iwasawa 31accf
    m_shutterSpeedSlider->setRange(0, 0);
Jeremy Bullock f15907
  } else {
shun-iwasawa 31accf
    m_shutterSpeedSlider->setEnabled(true);
shun-iwasawa 31accf
    m_shutterSpeedLabel->setText(
shun-iwasawa 31accf
        tr("Shutter Speed: ") +
shun-iwasawa 31accf
        m_stopMotion->m_canon->getCurrentShutterSpeed());
shun-iwasawa 31accf
    m_shutterSpeedSlider->setRange(0, count - 1);
shun-iwasawa 31accf
    m_shutterSpeedSlider->setValue(
shun-iwasawa 31accf
        m_stopMotion->m_canon->getShutterSpeedOptions().lastIndexOf(
shun-iwasawa 31accf
            m_stopMotion->m_canon->getCurrentShutterSpeed()));
Jeremy Bullock f15907
  }
shun-iwasawa 31accf
  m_shutterSpeedSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshIsoList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_isoSlider->blockSignals(true);
shun-iwasawa 31accf
  int count = 0;
shun-iwasawa 31accf
  m_stopMotion->m_canon->getAvailableIso();
shun-iwasawa 31accf
  count = m_stopMotion->m_canon->getIsoOptions().size();
shun-iwasawa 31accf
shun-iwasawa 31accf
  if (count == 0) {
shun-iwasawa 31accf
    m_isoLabel->setText(tr("Iso: ") + tr("Auto"));
shun-iwasawa 31accf
    m_isoSlider->setDisabled(true);
shun-iwasawa 31accf
    m_isoSlider->setRange(0, 0);
Jeremy Bullock f15907
  } else {
shun-iwasawa 31accf
    m_isoSlider->setEnabled(true);
shun-iwasawa 31accf
    m_isoLabel->setText(tr("Iso: ") + m_stopMotion->m_canon->getCurrentIso());
shun-iwasawa 31accf
    m_isoSlider->setRange(0, count - 1);
shun-iwasawa 31accf
    m_isoSlider->setValue(m_stopMotion->m_canon->getIsoOptions().lastIndexOf(
shun-iwasawa 31accf
        m_stopMotion->m_canon->getCurrentIso()));
Jeremy Bullock f15907
  }
shun-iwasawa 31accf
  m_isoSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshExposureList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
Jeremy Bullock f15907
  m_exposureCombo->blockSignals(true);
Jeremy Bullock f15907
  m_exposureCombo->clear();
shun-iwasawa 31accf
  m_stopMotion->m_canon->getAvailableExposureCompensations();
shun-iwasawa 31accf
  QStringList options = m_stopMotion->m_canon->getExposureOptions();
shun-iwasawa 31accf
  m_exposureCombo->addItems(options);
shun-iwasawa 31accf
  int maxTextLength = 0;
shun-iwasawa 31accf
  for (int i = 0; i < options.size(); i++) {
shun-iwasawa 31accf
    maxTextLength = std::max(maxTextLength, fontMetrics().width(options.at(i)));
shun-iwasawa 31accf
  }
Jeremy Bullock f15907
  if (m_exposureCombo->count() == 0) {
Jeremy Bullock f15907
    m_exposureCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_exposureCombo->setDisabled(true);
shun-iwasawa c7f5f4
    m_exposureCombo->setMaximumWidth(fontMetrics().width(tr("Disabled")) + 25);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_exposureCombo->setEnabled(true);
Jeremy Bullock f15907
    m_exposureCombo->setCurrentText(
shun-iwasawa 31accf
        m_stopMotion->m_canon->getCurrentExposureCompensation());
shun-iwasawa 31accf
    m_exposureCombo->setMaximumWidth(maxTextLength + 25);
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_exposureCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshWhiteBalanceList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
Jeremy Bullock f15907
  m_whiteBalanceCombo->blockSignals(true);
Jeremy Bullock f15907
  m_whiteBalanceCombo->clear();
shun-iwasawa 31accf
  m_stopMotion->m_canon->getAvailableWhiteBalances();
shun-iwasawa 31accf
  QStringList options = m_stopMotion->m_canon->getWhiteBalanceOptions();
shun-iwasawa 31accf
  m_whiteBalanceCombo->addItems(options);
shun-iwasawa 31accf
  int maxTextLength = 0;
shun-iwasawa 31accf
  for (int i = 0; i < options.size(); i++) {
shun-iwasawa 31accf
    maxTextLength = std::max(maxTextLength, fontMetrics().width(options.at(i)));
shun-iwasawa 31accf
  }
Jeremy Bullock f15907
  if (m_whiteBalanceCombo->count() == 0) {
Jeremy Bullock f15907
    m_whiteBalanceCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_whiteBalanceCombo->setDisabled(true);
shun-iwasawa c7f5f4
    m_whiteBalanceCombo->setMaximumWidth(fontMetrics().width(tr("Disabled")) +
shun-iwasawa c7f5f4
                                         25);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_whiteBalanceCombo->setEnabled(true);
shun-iwasawa 31accf
    m_whiteBalanceCombo->setCurrentText(
shun-iwasawa 31accf
        m_stopMotion->m_canon->getCurrentWhiteBalance());
shun-iwasawa 31accf
    m_whiteBalanceCombo->setMaximumWidth(maxTextLength + 25);
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_whiteBalanceCombo->blockSignals(false);
Jeremy Bullock f15907
  refreshColorTemperatureList();
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshColorTemperatureList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_kelvinSlider->blockSignals(true);
shun-iwasawa 31accf
  int count = 0;
shun-iwasawa 31accf
  count     = m_stopMotion->m_canon->getColorTemperatureOptions().size();
shun-iwasawa 31accf
shun-iwasawa 31accf
  if (count == 0 ||
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentWhiteBalance() != "Color Temperature") {
Jeremy Bullock f15907
    // m_kelvinCombo->addItem(tr("Disabled"));
shun-iwasawa 31accf
    m_kelvinSlider->setDisabled(true);
shun-iwasawa 31accf
    m_kelvinSlider->hide();
shun-iwasawa 31accf
    m_kelvinValueLabel->hide();
Jeremy Bullock f15907
  } else {
shun-iwasawa 31accf
    m_kelvinSlider->show();
shun-iwasawa 31accf
    m_kelvinValueLabel->show();
shun-iwasawa 31accf
    m_kelvinSlider->setEnabled(true);
shun-iwasawa 31accf
    m_kelvinSlider->setRange(0, count - 1);
shun-iwasawa 31accf
    m_kelvinValueLabel->setText(
shun-iwasawa 31accf
        tr("Temperature: ") +
shun-iwasawa 31accf
        m_stopMotion->m_canon->getCurrentColorTemperature());
Jeremy Bullock f15907
  }
shun-iwasawa 31accf
  m_kelvinSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshImageQualityList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
Jeremy Bullock f15907
  m_imageQualityCombo->blockSignals(true);
Jeremy Bullock f15907
  m_imageQualityCombo->clear();
shun-iwasawa 31accf
  m_stopMotion->m_canon->getAvailableImageQualities();
shun-iwasawa 31accf
  QStringList options = m_stopMotion->m_canon->getImageQualityOptions();
shun-iwasawa 31accf
  m_imageQualityCombo->addItems(options);
shun-iwasawa 31accf
  int maxTextLength = 0;
shun-iwasawa 31accf
  for (int i = 0; i < options.size(); i++) {
shun-iwasawa 31accf
    maxTextLength = std::max(maxTextLength, fontMetrics().width(options.at(i)));
shun-iwasawa 31accf
  }
Jeremy Bullock f15907
  if (m_imageQualityCombo->count() == 0) {
Jeremy Bullock f15907
    m_imageQualityCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_imageQualityCombo->setDisabled(true);
shun-iwasawa c7f5f4
    m_imageQualityCombo->setMaximumWidth(fontMetrics().width(tr("Disabled")) +
shun-iwasawa c7f5f4
                                         25);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_imageQualityCombo->setEnabled(true);
shun-iwasawa 31accf
    m_imageQualityCombo->setCurrentText(
shun-iwasawa 31accf
        m_stopMotion->m_canon->getCurrentImageQuality());
shun-iwasawa 31accf
    m_imageQualityCombo->setMaximumWidth(maxTextLength + 25);
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_imageQualityCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::refreshPictureStyleList() {
shun-iwasawa 31accf
#ifdef WITH_CANON
Jeremy Bullock f15907
  m_pictureStyleCombo->blockSignals(true);
Jeremy Bullock f15907
  m_pictureStyleCombo->clear();
shun-iwasawa 31accf
  m_stopMotion->m_canon->getAvailablePictureStyles();
shun-iwasawa 31accf
  QStringList options = m_stopMotion->m_canon->getPictureStyleOptions();
shun-iwasawa 31accf
  m_pictureStyleCombo->addItems(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getPictureStyleOptions());
shun-iwasawa 31accf
  int maxTextLength = 0;
shun-iwasawa 31accf
  for (int i = 0; i < options.size(); i++) {
shun-iwasawa 31accf
    maxTextLength = std::max(maxTextLength, fontMetrics().width(options.at(i)));
shun-iwasawa 31accf
  }
Jeremy Bullock f15907
  if (m_pictureStyleCombo->count() == 0) {
Jeremy Bullock f15907
    m_pictureStyleCombo->addItem(tr("Disabled"));
Jeremy Bullock f15907
    m_pictureStyleCombo->setDisabled(true);
shun-iwasawa c7f5f4
    m_pictureStyleCombo->setMaximumWidth(fontMetrics().width(tr("Disabled")) +
shun-iwasawa c7f5f4
                                         25);
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_pictureStyleCombo->setEnabled(true);
shun-iwasawa 31accf
    m_pictureStyleCombo->setCurrentText(
shun-iwasawa 31accf
        m_stopMotion->m_canon->getCurrentPictureStyle());
shun-iwasawa 31accf
    m_pictureStyleCombo->setMaximumWidth(maxTextLength + 25);
Jeremy Bullock f15907
  }
Jeremy Bullock f15907
  m_pictureStyleCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
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>
shun-iwasawa 31accf
  int cameraCount            = cameras.size();
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  cameraCount += m_stopMotion->m_canon->getCameraCount();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
  if (cameraCount != m_cameraListCombo->count() - 1) 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();
shun-iwasawa 31accf
    m_cameraStatusLabel->hide();
shun-iwasawa fe0983
    m_pickZoomButton->setStyleSheet("border:1px solid rgba(0, 0, 0, 0);");
shun-iwasawa fe0983
    m_zoomButton->setStyleSheet("border:1px solid rgba(0, 0, 0, 0);");
shun-iwasawa 31accf
    m_pickZoomButton->setChecked(false);
shun-iwasawa 31accf
    m_zoomButton->setChecked(false);
shun-iwasawa 31accf
    m_dslrFrame->hide();
shun-iwasawa 31accf
    m_webcamFrame->hide();
shun-iwasawa 31accf
    m_noCameraFrame->show();
shun-iwasawa 31accf
    m_alwaysUseLiveViewImagesButton->hide();
shun-iwasawa 31accf
    // if (m_tabBar->tabText(1) == tr("Settings")) {
shun-iwasawa 31accf
    //    m_tabBar->removeTab(1);
shun-iwasawa 31accf
    //}
shun-iwasawa 31accf
  } else if (useWebcam) {
Jeremy Bullock f15907
    m_resolutionCombo->show();
Jeremy Bullock f15907
    m_resolutionCombo->setEnabled(true);
Jeremy Bullock f15907
    m_resolutionLabel->show();
shun-iwasawa 31accf
    if (m_captureFilterSettingsBtn) m_captureFilterSettingsBtn->show();
shun-iwasawa 31accf
    m_cameraStatusLabel->hide();
shun-iwasawa 31accf
    m_webcamFrame->show();
shun-iwasawa 31accf
    m_dslrFrame->hide();
shun-iwasawa 31accf
    m_noCameraFrame->hide();
shun-iwasawa 31accf
    m_alwaysUseLiveViewImagesButton->hide();
shun-iwasawa 31accf
    getWebcamStatus();
shun-iwasawa 31accf
    // if (m_tabBar->tabText(1) == tr("Options")) {
shun-iwasawa 31accf
    //    m_tabBar->insertTab(1, tr("Settings"));
shun-iwasawa 31accf
    //}
shun-iwasawa 31accf
    m_webcamLabel->setText(m_cameraListCombo->currentText());
Jeremy Bullock f15907
  } else {
Jeremy Bullock f15907
    m_resolutionCombo->hide();
Jeremy Bullock f15907
    m_resolutionLabel->hide();
shun-iwasawa 31accf
    if (m_captureFilterSettingsBtn) m_captureFilterSettingsBtn->hide();
shun-iwasawa 31accf
    m_cameraStatusLabel->show();
shun-iwasawa 31accf
    m_dslrFrame->show();
shun-iwasawa 31accf
    m_webcamFrame->hide();
shun-iwasawa 31accf
    m_noCameraFrame->hide();
shun-iwasawa 31accf
    m_alwaysUseLiveViewImagesButton->show();
shun-iwasawa 31accf
    // if (m_tabBar->tabText(1) == tr("Options")) {
shun-iwasawa 31accf
    //  m_tabBar->insertTab(1, tr("Settings"));
shun-iwasawa 31accf
    //}
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();
shun-iwasawa 31accf
  QList<qsize> resolutions = m_stopMotion->m_webcam->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
shun-iwasawa 31accf
////-----------------------------------------------------------------------------
shun-iwasawa 31accf
//
shun-iwasawa 31accf
// void StopMotionController::onWebcamFocusFldEdited() {
shun-iwasawa 31accf
//    int value = m_webcamFocusSlider->getValue();
shun-iwasawa 31accf
//    value = value + abs((value % 5) - 5);
shun-iwasawa 31accf
//    m_stopMotion->m_webcam->setWebcamFocusValue(value);
shun-iwasawa 31accf
//}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onWebcamAutofocusToggled(bool on) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->setWebcamAutofocusStatus(!on);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onWebcamFocusSliderChanged(int value) {
shun-iwasawa 31accf
  // int value = m_webcamFocusSlider->getValue();
shun-iwasawa 31accf
  value = value + abs((value % 5) - 5);
shun-iwasawa 31accf
  m_stopMotion->m_webcam->setWebcamFocusValue(value);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onWebcamExposureSliderChanged(int value) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->setWebcamExposureValue(value);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onWebcamBrightnessSliderChanged(int value) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->setWebcamBrightnessValue(value);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onWebcamContrastSliderChanged(int value) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->setWebcamContrastValue(value);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onWebcamGainSliderChanged(int value) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->setWebcamGainValue(value);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onWebcamSaturationSliderChanged(int value) {
shun-iwasawa 31accf
  m_stopMotion->m_webcam->setWebcamSaturationValue(value);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::getWebcamStatus() {
shun-iwasawa 31accf
  m_webcamAutoFocusGB->setChecked(
shun-iwasawa 31accf
      !m_stopMotion->m_webcam->getWebcamAutofocusStatus());
shun-iwasawa 31accf
  m_webcamFocusSlider->setValue(m_stopMotion->m_webcam->getWebcamFocusValue());
shun-iwasawa 31accf
  m_webcamExposureSlider->setValue(
shun-iwasawa 31accf
      m_stopMotion->m_webcam->getWebcamExposureValue());
shun-iwasawa 31accf
  m_webcamBrightnessSlider->setValue(
shun-iwasawa 31accf
      m_stopMotion->m_webcam->getWebcamBrightnessValue());
shun-iwasawa 31accf
  m_webcamContrastSlider->setValue(
shun-iwasawa 31accf
      m_stopMotion->m_webcam->getWebcamContrastValue());
shun-iwasawa 31accf
  m_webcamGainSlider->setValue(m_stopMotion->m_webcam->getWebcamGainValue());
shun-iwasawa 31accf
  m_webcamSaturationSlider->setValue(
shun-iwasawa 31accf
      m_stopMotion->m_webcam->getWebcamSaturationValue());
shun-iwasawa 31accf
}
shun-iwasawa 31accf
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onCaptureFilterSettingsBtnPressed() {
shun-iwasawa 31accf
  if (!m_stopMotion->m_webcam->getWebcam() ||
shun-iwasawa 31accf
      m_stopMotion->m_webcam->getWebcamDeviceName().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++) {
shun-iwasawa 31accf
    if (cameras.at(c).deviceName() ==
shun-iwasawa 31accf
        m_stopMotion->m_webcam->getWebcamDeviceName()) {
Jeremy Bullock f15907
#ifdef _WIN32
shun-iwasawa 31accf
      m_stopMotion->m_webcam->openSettingsWindow();
shun-iwasawa 6bac0f
      // openCaptureFilterSettings(this, cameras.at(c).description());
shun-iwasawa 31accf
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) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_apertureSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList apertureOptions = m_stopMotion->m_canon->getApertureOptions();
shun-iwasawa 31accf
  m_stopMotion->m_canon->setAperture(
shun-iwasawa 31accf
      apertureOptions.at(m_apertureSlider->value()));
shun-iwasawa 31accf
  m_apertureSlider->setRange(0, apertureOptions.size() - 1);
shun-iwasawa 31accf
  m_apertureSlider->setValue(
shun-iwasawa 31accf
      apertureOptions.lastIndexOf(m_stopMotion->m_canon->getCurrentAperture()));
shun-iwasawa 31accf
  m_apertureLabel->setText(tr("Aperture: ") +
shun-iwasawa 31accf
                           m_stopMotion->m_canon->getCurrentAperture());
shun-iwasawa 31accf
  m_apertureSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onApertureChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_apertureSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList apertureOptions = m_stopMotion->m_canon->getApertureOptions();
shun-iwasawa 31accf
  m_apertureLabel->setText(tr("Aperture: ") +
shun-iwasawa 31accf
                           m_stopMotion->m_canon->getCurrentAperture());
shun-iwasawa 31accf
  m_apertureSlider->setRange(0, apertureOptions.size() - 1);
shun-iwasawa 31accf
  m_apertureSlider->setValue(
shun-iwasawa 31accf
      apertureOptions.lastIndexOf(m_stopMotion->m_canon->getCurrentAperture()));
shun-iwasawa 31accf
  m_apertureSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onShutterSpeedChanged(int index) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_shutterSpeedSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList shutterSpeedOptions =
shun-iwasawa 31accf
      m_stopMotion->m_canon->getShutterSpeedOptions();
shun-iwasawa 31accf
  m_stopMotion->m_canon->setShutterSpeed(
shun-iwasawa 31accf
      shutterSpeedOptions.at(m_shutterSpeedSlider->value()));
shun-iwasawa 31accf
  m_shutterSpeedSlider->setRange(0, shutterSpeedOptions.size() - 1);
shun-iwasawa 31accf
  m_shutterSpeedSlider->setValue(shutterSpeedOptions.lastIndexOf(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentShutterSpeed()));
shun-iwasawa 31accf
  m_shutterSpeedLabel->setText(tr("Shutter Speed: ") +
shun-iwasawa 31accf
                               m_stopMotion->m_canon->getCurrentShutterSpeed());
shun-iwasawa 31accf
  m_shutterSpeedSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onShutterSpeedChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_shutterSpeedSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList shutterSpeedOptions =
shun-iwasawa 31accf
      m_stopMotion->m_canon->getShutterSpeedOptions();
shun-iwasawa 31accf
  m_shutterSpeedLabel->setText(tr("Shutter Speed: ") +
shun-iwasawa 31accf
                               m_stopMotion->m_canon->getCurrentShutterSpeed());
shun-iwasawa 31accf
  m_shutterSpeedSlider->setRange(0, shutterSpeedOptions.size() - 1);
shun-iwasawa 31accf
  m_shutterSpeedSlider->setValue(shutterSpeedOptions.lastIndexOf(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentShutterSpeed()));
shun-iwasawa 31accf
  m_shutterSpeedSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onIsoChanged(int index) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_isoSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList isoOptions = m_stopMotion->m_canon->getIsoOptions();
shun-iwasawa 31accf
  m_stopMotion->m_canon->setIso(isoOptions.at(m_isoSlider->value()));
shun-iwasawa 31accf
  m_isoSlider->setRange(0, isoOptions.size() - 1);
shun-iwasawa 31accf
  m_isoSlider->setValue(
shun-iwasawa 31accf
      isoOptions.lastIndexOf(m_stopMotion->m_canon->getCurrentIso()));
shun-iwasawa 31accf
  m_isoLabel->setText(tr("Iso: ") + m_stopMotion->m_canon->getCurrentIso());
shun-iwasawa 31accf
  m_isoSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onIsoChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_isoSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList isoOptions = m_stopMotion->m_canon->getIsoOptions();
shun-iwasawa 31accf
  m_isoSlider->setRange(0, isoOptions.size() - 1);
shun-iwasawa 31accf
  m_isoSlider->setValue(
shun-iwasawa 31accf
      isoOptions.lastIndexOf(m_stopMotion->m_canon->getCurrentIso()));
shun-iwasawa 31accf
  m_isoLabel->setText(tr("Iso: ") + m_stopMotion->m_canon->getCurrentIso());
shun-iwasawa 31accf
  m_isoSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onExposureChanged(int index) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_exposureCombo->blockSignals(true);
shun-iwasawa 31accf
  m_stopMotion->m_canon->setExposureCompensation(
shun-iwasawa 31accf
      m_exposureCombo->currentText());
shun-iwasawa 31accf
  m_exposureCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onExposureChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_exposureCombo->blockSignals(true);
Jeremy Bullock f15907
  m_exposureCombo->setCurrentText(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentExposureCompensation());
shun-iwasawa 31accf
  m_exposureCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onWhiteBalanceChanged(int index) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_whiteBalanceCombo->blockSignals(true);
shun-iwasawa 31accf
  m_stopMotion->m_canon->setWhiteBalance(m_whiteBalanceCombo->currentText());
shun-iwasawa 31accf
  m_whiteBalanceCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onWhiteBalanceChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_whiteBalanceCombo->blockSignals(true);
shun-iwasawa 31accf
  m_whiteBalanceCombo->setCurrentText(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentWhiteBalance());
Jeremy Bullock f15907
  refreshColorTemperatureList();
shun-iwasawa 31accf
  m_whiteBalanceCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onColorTemperatureChanged(int index) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_kelvinSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList kelvinOptions =
shun-iwasawa 31accf
      m_stopMotion->m_canon->getColorTemperatureOptions();
shun-iwasawa 31accf
  m_stopMotion->m_canon->setColorTemperature(
shun-iwasawa 31accf
      kelvinOptions.at(m_kelvinSlider->value()));
shun-iwasawa 31accf
  m_kelvinSlider->setRange(0, kelvinOptions.size() - 1);
shun-iwasawa 31accf
  m_kelvinSlider->setValue(kelvinOptions.lastIndexOf(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentColorTemperature()));
shun-iwasawa 31accf
  m_kelvinValueLabel->setText(
shun-iwasawa 31accf
      tr("Temperature: ") +
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentColorTemperature());
shun-iwasawa 31accf
  m_kelvinSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onColorTemperatureChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_kelvinSlider->blockSignals(true);
shun-iwasawa 31accf
  QStringList kelvinOptions =
shun-iwasawa 31accf
      m_stopMotion->m_canon->getColorTemperatureOptions();
shun-iwasawa 31accf
  m_kelvinSlider->setRange(0, kelvinOptions.size() - 1);
shun-iwasawa 31accf
  m_kelvinSlider->setValue(kelvinOptions.lastIndexOf(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentColorTemperature()));
shun-iwasawa 31accf
  m_kelvinValueLabel->setText(
shun-iwasawa 31accf
      tr("Temperature: ") +
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentColorTemperature());
shun-iwasawa 31accf
  m_kelvinSlider->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onImageQualityChanged(int index) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_imageQualityCombo->blockSignals(true);
shun-iwasawa 31accf
  m_stopMotion->m_canon->setImageQuality(m_imageQualityCombo->currentText());
shun-iwasawa 31accf
  m_imageQualityCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onImageQualityChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_imageQualityCombo->blockSignals(true);
shun-iwasawa 31accf
  m_imageQualityCombo->setCurrentText(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentImageQuality());
shun-iwasawa 31accf
  m_imageQualityCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPictureStyleChanged(int index) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_pictureStyleCombo->blockSignals(true);
shun-iwasawa 31accf
  m_stopMotion->m_canon->setPictureStyle(m_pictureStyleCombo->currentText());
shun-iwasawa 31accf
  m_pictureStyleCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPictureStyleChangedSignal(QString text) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_pictureStyleCombo->blockSignals(true);
shun-iwasawa 31accf
  m_pictureStyleCombo->setCurrentText(
shun-iwasawa 31accf
      m_stopMotion->m_canon->getCurrentPictureStyle());
shun-iwasawa 31accf
  m_pictureStyleCombo->blockSignals(false);
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onFocusCheckToggled(bool on) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  if (on) {
shun-iwasawa fe0983
    m_zoomButton->setStyleSheet("border:1px solid rgba(0, 255, 0, 255);");
shun-iwasawa 31accf
  } else {
shun-iwasawa fe0983
    m_zoomButton->setStyleSheet("border:1px solid rgba(0, 0, 0, 0);");
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
  m_zoomButton->blockSignals(true);
shun-iwasawa 31accf
  m_zoomButton->setChecked(on);
shun-iwasawa 31accf
  m_zoomButton->blockSignals(false);
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::onPickFocusCheckToggled(bool on) {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  if (on) {
shun-iwasawa fe0983
    m_pickZoomButton->setStyleSheet("border:1px solid rgba(0, 255, 0, 255);");
shun-iwasawa 31accf
shun-iwasawa 31accf
  } else {
shun-iwasawa fe0983
    m_pickZoomButton->setStyleSheet("border:1px solid rgba(0, 0, 0, 0);");
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
  m_pickZoomButton->blockSignals(true);
shun-iwasawa 31accf
  m_pickZoomButton->setChecked(on);
shun-iwasawa 31accf
  m_pickZoomButton->blockSignals(false);
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onZoomPressed() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->zoomLiveView();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::onPickZoomPressed() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->toggleZoomPicking();
shun-iwasawa 31accf
#endif
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::onFocusNear() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->focusNear();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::onFocusFar() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->focusFar();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::onFocusNear2() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->focusNear2();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::onFocusFar2() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->focusFar2();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::onFocusNear3() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->focusNear3();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::onFocusFar3() {
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->focusFar3();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
shun-iwasawa 31accf
void StopMotionController::showEvent(QShowEvent *event) {
shun-iwasawa 31accf
  bool hasCanon  = false;
shun-iwasawa 31accf
  bool hasWebcam = false;
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  m_stopMotion->m_canon->initializeCanonSDK();
shun-iwasawa 31accf
  if (!m_stopMotion->m_canon->m_sessionOpen) {
shun-iwasawa 31accf
    m_dslrFrame->hide();
shun-iwasawa 31accf
    m_alwaysUseLiveViewImagesButton->hide();
shun-iwasawa 31accf
  } else {
shun-iwasawa 31accf
    m_dslrFrame->show();
shun-iwasawa 31accf
    m_alwaysUseLiveViewImagesButton->show();
shun-iwasawa 31accf
    hasCanon = true;
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
#else
shun-iwasawa 31accf
  m_dslrFrame->hide();
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->hide();
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
  if (!m_stopMotion->m_usingWebcam) {
shun-iwasawa 31accf
    m_resolutionCombo->hide();
shun-iwasawa 31accf
    m_resolutionLabel->hide();
shun-iwasawa 31accf
    m_webcamFrame->hide();
shun-iwasawa 31accf
  } else {
shun-iwasawa 31accf
    hasWebcam = true;
shun-iwasawa 31accf
    m_webcamFrame->show();
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
shun-iwasawa 31accf
  if (!hasWebcam && !hasCanon) {
shun-iwasawa 31accf
    m_noCameraFrame->show();
shun-iwasawa 31accf
  } else {
shun-iwasawa 31accf
    m_noCameraFrame->hide();
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
void StopMotionController::hideEvent(QHideEvent *event) {
shun-iwasawa 31accf
  // stop interval timer if it is active
shun-iwasawa 31accf
  if (m_timerCB->isChecked() && m_captureButton->isChecked()) {
shun-iwasawa 31accf
    m_captureButton->setChecked(false);
shun-iwasawa 31accf
    onCaptureButtonClicked(false);
shun-iwasawa 31accf
  }
Jeremy Bullock f15907
}
Jeremy Bullock f15907
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::keyPressEvent(QKeyEvent *event) {
shun-iwasawa 31accf
  int key          = event->key();
shun-iwasawa 31accf
  TFrameHandle *fh = TApp::instance()->getCurrentFrame();
shun-iwasawa 31accf
  int origFrame    = fh->getFrame();
shun-iwasawa 31accf
#ifdef WITH_CANON
shun-iwasawa 31accf
  if ((m_stopMotion->m_canon->m_pickLiveViewZoom ||
shun-iwasawa 31accf
       m_stopMotion->m_canon->m_zooming) &&
shun-iwasawa 31accf
      (key == Qt::Key_Left || key == Qt::Key_Right || key == Qt::Key_Up ||
shun-iwasawa 31accf
       key == Qt::Key_Down || key == Qt::Key_2 || key == Qt::Key_4 ||
shun-iwasawa 31accf
       key == Qt::Key_6 || key == Qt::Key_8)) {
shun-iwasawa 31accf
    if (m_stopMotion->m_canon->m_liveViewZoomReadyToPick == true) {
shun-iwasawa 31accf
      if (key == Qt::Key_Left || key == Qt::Key_4) {
shun-iwasawa 31accf
        m_stopMotion->m_canon->m_liveViewZoomPickPoint.x -= 10;
shun-iwasawa 31accf
      }
shun-iwasawa 31accf
      if (key == Qt::Key_Right || key == Qt::Key_6) {
shun-iwasawa 31accf
        m_stopMotion->m_canon->m_liveViewZoomPickPoint.x += 10;
shun-iwasawa 31accf
      }
shun-iwasawa 31accf
      if (key == Qt::Key_Up || key == Qt::Key_8) {
shun-iwasawa 31accf
        m_stopMotion->m_canon->m_liveViewZoomPickPoint.y += 10;
shun-iwasawa 31accf
      }
shun-iwasawa 31accf
      if (key == Qt::Key_Down || key == Qt::Key_2) {
shun-iwasawa 31accf
        m_stopMotion->m_canon->m_liveViewZoomPickPoint.y -= 10;
shun-iwasawa 31accf
      }
shun-iwasawa 31accf
      if (m_stopMotion->m_canon->m_zooming) {
shun-iwasawa 31accf
        m_stopMotion->m_canon->setZoomPoint();
shun-iwasawa 31accf
      }
shun-iwasawa 31accf
    }
shun-iwasawa 31accf
    m_stopMotion->m_canon->calculateZoomPoint();
shun-iwasawa 31accf
    event->accept();
shun-iwasawa 31accf
  } else if (m_stopMotion->m_canon->m_pickLiveViewZoom &&
shun-iwasawa 31accf
             (key == Qt::Key_Escape || key == Qt::Key_Enter ||
shun-iwasawa 31accf
              key == Qt::Key_Return)) {
shun-iwasawa 31accf
    m_stopMotion->m_canon->toggleZoomPicking();
shun-iwasawa 31accf
  } else
shun-iwasawa 31accf
#endif
shun-iwasawa 31accf
      if (key == Qt::Key_Up || key == Qt::Key_Left) {
shun-iwasawa 31accf
    fh->prevFrame();
shun-iwasawa 31accf
    event->accept();
shun-iwasawa 31accf
  } else if (key == Qt::Key_Down || key == Qt::Key_Right) {
shun-iwasawa 31accf
    fh->nextFrame();
shun-iwasawa 31accf
    event->accept();
shun-iwasawa 31accf
  } else if (key == Qt::Key_Home) {
shun-iwasawa 31accf
    fh->firstFrame();
shun-iwasawa 31accf
    event->accept();
shun-iwasawa 31accf
  } else if (key == Qt::Key_End) {
shun-iwasawa 31accf
    fh->lastFrame();
shun-iwasawa 31accf
    event->accept();
shun-iwasawa 31accf
  } else if (key == Qt::Key_Return || key == Qt::Key_Enter) {
shun-iwasawa 31accf
    m_captureButton->animateClick();
shun-iwasawa 31accf
    event->accept();
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
shun-iwasawa 31accf
  else
shun-iwasawa 31accf
    event->ignore();
shun-iwasawa 31accf
}
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
shun-iwasawa 31accf
void StopMotionController::onAlwaysUseLiveViewImagesButtonClicked() {
shun-iwasawa 31accf
  m_stopMotion->toggleAlwaysUseLiveViewImages();
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onAlwaysUseLiveViewImagesToggled(bool on) {
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->blockSignals(true);
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->setChecked(on);
shun-iwasawa 31accf
  m_alwaysUseLiveViewImagesButton->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
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) {
shun-iwasawa 31accf
  if (m_timerCB->isChecked()) {
shun-iwasawa 31accf
    // start interval capturing
shun-iwasawa 31accf
    if (on) {
shun-iwasawa 31accf
      m_stopMotion->startInterval();
shun-iwasawa 31accf
    }
shun-iwasawa 31accf
    // stop interval capturing
shun-iwasawa 31accf
    else {
shun-iwasawa 31accf
      m_stopMotion->stopInterval();
shun-iwasawa 31accf
    }
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
  // capture immediately
shun-iwasawa 31accf
  else {
shun-iwasawa 31accf
    m_stopMotion->captureImage();
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onIntervalTimerCBToggled(bool on) {
shun-iwasawa 31accf
  m_stopMotion->toggleInterval(on);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onIntervalSliderValueChanged(bool on) {
justburner d63640
  m_stopMotion->setIntervalDSec(m_timerIntervalFld->getValue() * 10.0);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onIntervalCaptureTimerTimeout() {
shun-iwasawa 31accf
  if (m_stopMotion->m_liveViewStatus < 1) {
shun-iwasawa 31accf
    onCaptureButtonClicked(false);
shun-iwasawa 31accf
  }
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
shun-iwasawa 31accf
void StopMotionController::onIntervalCountDownTimeout() {
shun-iwasawa 31accf
  m_captureButton->setText(QString::number(
shun-iwasawa 31accf
      m_stopMotion->m_intervalTimer->isActive()
shun-iwasawa 31accf
          ? (m_stopMotion->m_intervalTimer->remainingTime() / 1000 + 1)
shun-iwasawa 31accf
          : 0));
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
void StopMotionController::onIntervalAmountChanged(int value) {
shun-iwasawa 31accf
  m_timerIntervalFld->blockSignals(true);
justburner d63640
  m_timerIntervalFld->setValue(value / 10.0);
shun-iwasawa 31accf
  m_timerIntervalFld->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
void StopMotionController::onIntervalToggled(bool on) {
shun-iwasawa 31accf
  m_timerCB->blockSignals(true);
shun-iwasawa 31accf
  m_captureButton->setCheckable(on);
shun-iwasawa 31accf
  if (on)
shun-iwasawa 31accf
    m_captureButton->setText(tr("Start Capturing"));
shun-iwasawa 31accf
  else
shun-iwasawa 31accf
    m_captureButton->setText(tr("Capture"));
shun-iwasawa 31accf
  m_timerCB->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
void StopMotionController::onIntervalStarted() {
shun-iwasawa 31accf
  m_captureButton->setText(tr("Stop Capturing"));
shun-iwasawa 31accf
  m_timerCB->setDisabled(true);
shun-iwasawa 31accf
  m_timerIntervalFld->setDisabled(true);
shun-iwasawa 31accf
  m_captureButton->blockSignals(true);
shun-iwasawa 31accf
  m_captureButton->setChecked(true);
shun-iwasawa 31accf
  m_captureButton->blockSignals(false);
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
void StopMotionController::onIntervalStopped() {
shun-iwasawa 31accf
  m_captureButton->setText(tr("Start Capturing"));
shun-iwasawa 31accf
  m_timerCB->setDisabled(false);
shun-iwasawa 31accf
  m_timerIntervalFld->setDisabled(false);
shun-iwasawa 31accf
  m_captureButton->blockSignals(true);
shun-iwasawa 31accf
  m_captureButton->setChecked(false);
shun-iwasawa 31accf
  m_captureButton->blockSignals(false);
Jeremy Bullock f15907
}
Jeremy Bullock f15907
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
justburner d63640
void StopMotionController::onPlaySoundToggled(bool on) {
justburner d63640
  m_stopMotion->setPlayCaptureSound(on);
justburner d63640
}
justburner d63640
justburner d63640
//-----------------------------------------------------------------------------
justburner d63640
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() {
shun-iwasawa 70632f
  m_stopMotion->setFrameNumber(m_frameNumberEdit->getValue().getNumber());
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
shun-iwasawa 31accf
void StopMotionController::serialPortChanged(int index) {
shun-iwasawa 31accf
  m_stopMotion->m_serial->setSerialPort(m_controlDeviceCombo->currentText());
shun-iwasawa 31accf
}
shun-iwasawa 31accf
shun-iwasawa 31accf
//-----------------------------------------------------------------------------
shun-iwasawa 31accf
Jeremy Bullock f15907
void StopMotionController::updateStopMotion() {}