Jeremy Bullock f15907
#pragma once
Jeremy Bullock f15907
Jeremy Bullock f15907
#ifndef STOPMOTIONCONTROLLER_H
Jeremy Bullock f15907
#define STOPMOTIONCONTROLLER_H
Jeremy Bullock f15907
Jeremy Bullock f15907
// TnzCore includes
Jeremy Bullock f15907
#include "stopmotion.h"
Jeremy Bullock f15907
#include "penciltestpopup.h"
Jeremy Bullock f15907
Jeremy Bullock f15907
// TnzQt includes
Jeremy Bullock f15907
#include "toonzqt/tabbar.h"
Jeremy Bullock f15907
#include "toonzqt/gutil.h"
Jeremy Bullock f15907
Jeremy Bullock f15907
// Qt includes
Jeremy Bullock f15907
#include <qwidget></qwidget>
Jeremy Bullock f15907
#include <qframe></qframe>
Jeremy Bullock f15907
#include <qtabbar></qtabbar>
Jeremy Bullock f15907
#include <qslider></qslider>
Jeremy Bullock f15907
#include <qscrollarea></qscrollarea>
Jeremy Bullock f15907
#include <qpointf></qpointf>
Jeremy Bullock f15907
Jeremy Bullock f15907
#undef DVAPI
Jeremy Bullock f15907
#undef DVVAR
Jeremy Bullock f15907
#ifdef TOONZQT_EXPORTS
Jeremy Bullock f15907
#define DVAPI DV_EXPORT_API
Jeremy Bullock f15907
#define DVVAR DV_EXPORT_VAR
Jeremy Bullock f15907
#else
Jeremy Bullock f15907
#define DVAPI DV_IMPORT_API
Jeremy Bullock f15907
#define DVVAR DV_IMPORT_VAR
Jeremy Bullock f15907
#endif
Jeremy Bullock f15907
Jeremy Bullock f15907
//=============================================
Jeremy Bullock f15907
Jeremy Bullock f15907
//    Forward declarations
Jeremy Bullock f15907
Jeremy Bullock f15907
class TColorStyle;
Jeremy Bullock f15907
class TPalette;
Jeremy Bullock f15907
Jeremy Bullock f15907
class TXshLevelHandle;
Jeremy Bullock f15907
Jeremy Bullock f15907
class QGridLayout;
Jeremy Bullock f15907
class QLabel;
Jeremy Bullock f15907
class QStackedWidget;
Jeremy Bullock f15907
class QSlider;
Jeremy Bullock f15907
class QRadioButton;
Jeremy Bullock f15907
class QButtonGroup;
Jeremy Bullock f15907
class QPushButton;
Jeremy Bullock f15907
class QTabWidget;
Jeremy Bullock f15907
class QToolBar;
Jeremy Bullock f15907
class QTimer;
Jeremy Bullock f15907
Jeremy Bullock f15907
//=============================================================================
Jeremy Bullock f15907
// StopMotionController
Jeremy Bullock f15907
//-----------------------------------------------------------------------------
Jeremy Bullock f15907
Jeremy Bullock f15907
class StopMotionController final : public QWidget {
Jeremy Bullock f15907
  Q_OBJECT
Jeremy Bullock f15907
  StopMotion *m_stopMotion;
Jeremy Bullock f15907
Jeremy Bullock f15907
  QWidget *m_parent;
Jeremy Bullock f15907
  TXshLevelHandle
Jeremy Bullock f15907
      *m_levelHandle;  //!< for clearing the level cache when the color changed
Jeremy Bullock f15907
Jeremy Bullock f15907
  DVGui::TabBar *m_tabBar;
Jeremy Bullock f15907
  QFrame *m_mainControlsPage;
Jeremy Bullock f15907
  QFrame *m_cameraSettingsPage;
Jeremy Bullock f15907
  QFrame *m_optionsPage;
Jeremy Bullock f15907
  QStackedWidget *m_stackedChooser;
Jeremy Bullock f15907
  TabBarContainter *m_tabBarContainer;  //!< Tabs container for style types.
Jeremy Bullock f15907
  QPushButton *m_toggleLiveViewButton, *m_setToCurrentXSheetFrameButton;
Jeremy Bullock f15907
  QPushButton *m_fileFormatOptionButton, *m_captureButton, *m_zoomButton,
Jeremy Bullock f15907
      *m_pickZoomButton, *m_focusNearButton, *m_focusFarButton,
Jeremy Bullock f15907
      *m_focusNear2Button, *m_focusNear3Button, *m_focusFar2Button,
Jeremy Bullock f15907
      *m_focusFar3Button, *m_captureFilterSettingsBtn;
Jeremy Bullock f15907
  QHBoxLayout *m_focusAndZoomLayout;
Jeremy Bullock f15907
  QLabel *m_frameInfoLabel, *m_cameraSettingsLabel, *m_cameraModeLabel,
Jeremy Bullock f15907
      *m_kelvinLabel, *m_resolutionLabel, *m_directShowLabel;
Jeremy Bullock f15907
  QToolButton *m_previousLevelButton, *m_previousFrameButton,
Jeremy Bullock f15907
      *m_previousXSheetFrameButton;
Jeremy Bullock f15907
Jeremy Bullock f15907
  QComboBox *m_cameraListCombo, *m_fileTypeCombo, *m_isoCombo,
Jeremy Bullock f15907
      *m_shutterSpeedCombo, *m_exposureCombo, *m_apertureCombo,
Jeremy Bullock f15907
      *m_whiteBalanceCombo, *m_kelvinCombo, *m_resolutionCombo,
Jeremy Bullock f15907
      *m_imageQualityCombo, *m_pictureStyleCombo;
Jeremy Bullock f15907
  LevelNameLineEdit *m_levelNameEdit;
Jeremy Bullock f15907
  QCheckBox *m_blackScreenForCapture, *m_useScaledFullSizeImages,
Jeremy Bullock f15907
      *m_placeOnXSheetCB, *m_directShowCB, *m_liveViewOnAllFramesCB,
Jeremy Bullock f15907
      *m_useMjpgCB, *m_useNumpadCB;
Jeremy Bullock f15907
  DVGui::FileField *m_saveInFileFld;
Jeremy Bullock f15907
  DVGui::IntLineEdit *m_xSheetFrameNumberEdit;
Jeremy Bullock f15907
  FrameNumberLineEdit *m_frameNumberEdit;
Jeremy Bullock f15907
  DVGui::IntField *m_onionOpacityFld, *m_postCaptureReviewFld,
Jeremy Bullock f15907
      *m_subsamplingFld;
Jeremy Bullock f15907
  PencilTestSaveInFolderPopup *m_saveInFolderPopup;
Jeremy Bullock f15907
Jeremy Bullock f15907
public:
Jeremy Bullock f15907
  StopMotionController(QWidget *parent = 0);
Jeremy Bullock f15907
  ~StopMotionController();
Jeremy Bullock f15907
Jeremy Bullock f15907
protected:
Jeremy Bullock f15907
  void updateStopMotion();
Jeremy Bullock f15907
  void showEvent(QShowEvent *event);
Jeremy Bullock f15907
  void hideEvent(QHideEvent *event);
Jeremy Bullock f15907
  // void mousePressEvent(QMouseEvent *event) override;
Jeremy Bullock f15907
  // void keyPressEvent(QKeyEvent *event);
Jeremy Bullock f15907
Jeremy Bullock f15907
protected slots:
Jeremy Bullock f15907
  void refreshCameraList();
Jeremy Bullock f15907
  void refreshCameraListCalled();
Jeremy Bullock f15907
  void refreshOptionsLists();
Jeremy Bullock f15907
  void refreshApertureList();
Jeremy Bullock f15907
  void refreshShutterSpeedList();
Jeremy Bullock f15907
  void refreshIsoList();
Jeremy Bullock f15907
  void refreshExposureList();
Jeremy Bullock f15907
  void refreshWhiteBalanceList();
Jeremy Bullock f15907
  void refreshColorTemperatureList();
Jeremy Bullock f15907
  void refreshImageQualityList();
Jeremy Bullock f15907
  void refreshPictureStyleList();
Jeremy Bullock f15907
  void onCameraListComboActivated(int index);
Jeremy Bullock f15907
  void onResolutionComboActivated(const QString &itemText);
Jeremy Bullock f15907
  void onCaptureFilterSettingsBtnPressed();
Jeremy Bullock f15907
  void onFileFormatOptionButtonPressed();
Jeremy Bullock f15907
  void onLevelNameEdited();
Jeremy Bullock f15907
  void onNextName();
Jeremy Bullock f15907
  void onPreviousName();
Jeremy Bullock f15907
  void onNextFrame();
Jeremy Bullock f15907
  void onPreviousFrame();
Jeremy Bullock f15907
  void onNextNewLevel();
Jeremy Bullock f15907
  void onLastFrame();
Jeremy Bullock f15907
  void onFileTypeActivated();
Jeremy Bullock f15907
  void onFrameNumberChanged();
Jeremy Bullock f15907
  void onXSheetFrameNumberChanged();
Jeremy Bullock f15907
  void onFrameCaptured(QImage &image);
Jeremy Bullock f15907
  void onOnionOpacityFldEdited();
Jeremy Bullock f15907
  void onOnionOpacitySliderChanged(bool ignore);
Jeremy Bullock f15907
  void onLiveViewToggleClicked();
Jeremy Bullock f15907
  void onCaptureButtonClicked(bool);
Jeremy Bullock f15907
  void setPage(int);
Jeremy Bullock f15907
  void onScaleFullSizeImagesChanged(int checked);
Jeremy Bullock f15907
  void onBlackScreenForCaptureChanged(int checked);
Jeremy Bullock f15907
  void onPlaceOnXSheetChanged(int checked);
Jeremy Bullock f15907
  void onUseMjpgChanged(int checked);
Jeremy Bullock f15907
  void onUseDirectShowChanged(int checked);
Jeremy Bullock f15907
  void onLiveViewOnAllFramesChanged(int checked);
Jeremy Bullock f15907
  void onUseNumpadChanged(int checked);
Jeremy Bullock f15907
  void updateDimensions();
Jeremy Bullock f15907
  void onSaveInPathEdited();
Jeremy Bullock f15907
  void onSceneSwitched();
Jeremy Bullock f15907
  void onPreviousXSheetFrame();
Jeremy Bullock f15907
  void onNextXSheetFrame();
Jeremy Bullock f15907
  void setToCurrentXSheetFrame();
Jeremy Bullock f15907
  void onApertureChanged(int index);
Jeremy Bullock f15907
  void onShutterSpeedChanged(int index);
Jeremy Bullock f15907
  void onIsoChanged(int index);
Jeremy Bullock f15907
  void onExposureChanged(int index);
Jeremy Bullock f15907
  void onWhiteBalanceChanged(int index);
Jeremy Bullock f15907
  void onColorTemperatureChanged(int index);
Jeremy Bullock f15907
  void onImageQualityChanged(int index);
Jeremy Bullock f15907
  void onPictureStyleChanged(int index);
Jeremy Bullock f15907
  void refreshMode();
Jeremy Bullock f15907
  void onZoomPressed();
Jeremy Bullock f15907
  void onPickZoomPressed();
Jeremy Bullock f15907
  void onFocusNear();
Jeremy Bullock f15907
  void onFocusFar();
Jeremy Bullock f15907
  void onFocusNear2();
Jeremy Bullock f15907
  void onFocusFar2();
Jeremy Bullock f15907
  void onFocusNear3();
Jeremy Bullock f15907
  void onFocusFar3();
Jeremy Bullock f15907
  void onCaptureReviewFldEdited();
Jeremy Bullock f15907
  void onCaptureReviewSliderChanged(bool ignore);
Jeremy Bullock f15907
  void onSubsamplingFldEdited();
Jeremy Bullock f15907
  void onSubsamplingSliderChanged(bool ignore);
Jeremy Bullock f15907
  void onSubsamplingChanged(int);
Jeremy Bullock f15907
  void onFilePathChanged(QString);
Jeremy Bullock f15907
  void onLevelNameChanged(QString);
Jeremy Bullock f15907
  void onFileTypeChanged(QString);
Jeremy Bullock f15907
  void onXSheetFrameNumberChanged(int);
Jeremy Bullock f15907
  void onFrameNumberChanged(int);
Jeremy Bullock f15907
  void onFrameInfoTextChanged(QString);
Jeremy Bullock f15907
  void onOpacityChanged(int opacity);
Jeremy Bullock f15907
  void onScaleFullSizeImagesSignal(bool);
Jeremy Bullock f15907
  void onBlackCaptureSignal(bool);
Jeremy Bullock f15907
  void onLiveViewOnAllFramesSignal(bool);
Jeremy Bullock f15907
  void onPlaceOnXSheetSignal(bool);
Jeremy Bullock f15907
  void onUseMjpgSignal(bool);
Jeremy Bullock f15907
  void onUseDirectShowSignal(bool);
Jeremy Bullock f15907
  void onReviewTimeChangedSignal(int);
Jeremy Bullock f15907
  void onUseNumpadSignal(bool);
Jeremy Bullock f15907
  void onLiveViewChanged(bool);
Jeremy Bullock f15907
  void onNewCameraSelected(int, bool);
Jeremy Bullock f15907
  void onWebcamResolutionsChanged();
Jeremy Bullock f15907
  void onNewWebcamResolutionSelected(int);
Jeremy Bullock f15907
  void onApertureChangedSignal(QString);
Jeremy Bullock f15907
  void onIsoChangedSignal(QString);
Jeremy Bullock f15907
  void onShutterSpeedChangedSignal(QString);
Jeremy Bullock f15907
  void onExposureChangedSignal(QString);
Jeremy Bullock f15907
  void onWhiteBalanceChangedSignal(QString);
Jeremy Bullock f15907
  void onColorTemperatureChangedSignal(QString);
Jeremy Bullock f15907
  void onImageQualityChangedSignal(QString);
Jeremy Bullock f15907
  void onPictureStyleChangedSignal(QString);
Jeremy Bullock f15907
Jeremy Bullock f15907
public slots:
Jeremy Bullock f15907
  void openSaveInFolderPopup();
Jeremy Bullock f15907
};
Jeremy Bullock f15907
Jeremy Bullock f15907
#endif  // STOPMOTIONCONTROLLER_H