tahoma2d/toonz/sources/stopmotion/stopmotioncontroller.h

224 lines
6.9 KiB
C
Raw Normal View History

#pragma once
#ifndef STOPMOTIONCONTROLLER_H
#define STOPMOTIONCONTROLLER_H
// TnzCore includes
#include "stopmotion.h"
#include "penciltestpopup.h"
// TnzQt includes
#include "toonzqt/tabbar.h"
#include "toonzqt/gutil.h"
// Qt includes
#include <QWidget>
#include <QFrame>
#include <QTabBar>
#include <QSlider>
#include <QScrollArea>
#include <QPointF>
#undef DVAPI
#undef DVVAR
#ifdef TOONZQT_EXPORTS
#define DVAPI DV_EXPORT_API
#define DVVAR DV_EXPORT_VAR
#else
#define DVAPI DV_IMPORT_API
#define DVVAR DV_IMPORT_VAR
#endif
//=============================================
// Forward declarations
class TColorStyle;
class TPalette;
class TXshLevelHandle;
class QGridLayout;
class QLabel;
class QStackedWidget;
class QSlider;
class QRadioButton;
class QButtonGroup;
class QPushButton;
class QTabWidget;
class QToolBar;
class QTimer;
//=============================================================================
// StopMotionController
//-----------------------------------------------------------------------------
class StopMotionController final : public QWidget {
Q_OBJECT
StopMotion *m_stopMotion;
QWidget *m_parent;
TXshLevelHandle
*m_levelHandle; //!< for clearing the level cache when the color changed
DVGui::TabBar *m_tabBar;
QFrame *m_mainControlsPage;
QFrame *m_cameraSettingsPage;
QFrame *m_optionsPage;
2020-04-19 14:29:13 +12:00
// QFrame* m_controlPage;
QStackedWidget *m_stackedChooser;
TabBarContainter *m_tabBarContainer; //!< Tabs container for style types.
QPushButton *m_toggleLiveViewButton, *m_setToCurrentXSheetFrameButton;
QPushButton *m_fileFormatOptionButton, *m_captureButton, *m_zoomButton,
*m_pickZoomButton, *m_focusNearButton, *m_focusFarButton,
*m_focusNear2Button, *m_focusNear3Button, *m_focusFar2Button,
*m_focusFar3Button, *m_captureFilterSettingsBtn;
QHBoxLayout *m_focusAndZoomLayout;
QLabel *m_frameInfoLabel, *m_cameraSettingsLabel, *m_cameraModeLabel,
2020-04-14 09:21:13 +12:00
*m_resolutionLabel, *m_directShowLabel, *m_cameraStatusLabel,
*m_apertureLabel, *m_kelvinValueLabel, *m_isoLabel, *m_shutterSpeedLabel;
QToolButton *m_previousLevelButton, *m_previousFrameButton,
*m_previousXSheetFrameButton;
2020-04-14 09:21:13 +12:00
QSlider *m_apertureSlider, *m_shutterSpeedSlider, *m_isoSlider,
*m_kelvinSlider;
QComboBox *m_cameraListCombo, *m_fileTypeCombo, *m_exposureCombo,
*m_whiteBalanceCombo, *m_resolutionCombo, *m_imageQualityCombo,
2020-04-19 14:29:13 +12:00
*m_pictureStyleCombo, *m_controlDeviceCombo;
LevelNameLineEdit *m_levelNameEdit;
QCheckBox *m_blackScreenForCapture, *m_useScaledFullSizeImages,
*m_placeOnXSheetCB, *m_directShowCB, *m_liveViewOnAllFramesCB,
2020-04-19 18:09:59 +12:00
*m_useMjpgCB, *m_useNumpadCB, *m_drawBeneathCB, *m_timerCB;
DVGui::FileField *m_saveInFileFld;
DVGui::IntLineEdit *m_xSheetFrameNumberEdit;
FrameNumberLineEdit *m_frameNumberEdit;
DVGui::IntField *m_onionOpacityFld, *m_postCaptureReviewFld,
*m_subsamplingFld;
PencilTestSaveInFolderPopup *m_saveInFolderPopup;
2020-04-19 18:09:59 +12:00
DVGui::IntField *m_timerIntervalFld;
QTimer *m_captureTimer, *m_countdownTimer;
public:
StopMotionController(QWidget *parent = 0);
~StopMotionController();
protected:
void updateStopMotion();
void showEvent(QShowEvent *event);
void hideEvent(QHideEvent *event);
// void mousePressEvent(QMouseEvent *event) override;
// void keyPressEvent(QKeyEvent *event);
2020-04-09 15:45:17 +12:00
void keyPressEvent(QKeyEvent *event) override;
protected slots:
2020-04-16 10:02:02 +12:00
void refreshCameraList(QString activeCamera = "");
void refreshCameraListCalled();
void refreshOptionsLists();
2020-04-10 11:06:47 +12:00
void onCameraListComboActivated(int index);
void onResolutionComboActivated(const QString &itemText);
void onCaptureFilterSettingsBtnPressed();
void onFileFormatOptionButtonPressed();
void onLevelNameEdited();
void onNextName();
void onPreviousName();
void onNextFrame();
void onPreviousFrame();
void onNextNewLevel();
void onLastFrame();
void onFileTypeActivated();
void onFrameNumberChanged();
void onXSheetFrameNumberChanged();
void onFrameCaptured(QImage &image);
void onOnionOpacityFldEdited();
void onOnionOpacitySliderChanged(bool ignore);
void onLiveViewToggleClicked();
void onCaptureButtonClicked(bool);
void setPage(int);
void onScaleFullSizeImagesChanged(int checked);
void onBlackScreenForCaptureChanged(int checked);
void onPlaceOnXSheetChanged(int checked);
void onUseMjpgChanged(int checked);
void onUseDirectShowChanged(int checked);
void onLiveViewOnAllFramesChanged(int checked);
void onUseNumpadChanged(int checked);
2020-04-10 18:01:27 +12:00
void onDrawBeneathChanged(int checked);
void updateDimensions();
void onSaveInPathEdited();
void onSceneSwitched();
void onPreviousXSheetFrame();
void onNextXSheetFrame();
void setToCurrentXSheetFrame();
2020-04-19 14:29:13 +12:00
void serialPortChanged(int);
2020-04-19 18:09:59 +12:00
void onTimerCBToggled(bool);
void onCaptureTimerTimeout();
void onCountDown();
2020-04-10 11:06:47 +12:00
2020-04-10 16:46:04 +12:00
// canon stuff
void onApertureChanged(int index);
void onShutterSpeedChanged(int index);
void onIsoChanged(int index);
void onExposureChanged(int index);
void onWhiteBalanceChanged(int index);
void onColorTemperatureChanged(int index);
void onImageQualityChanged(int index);
void onPictureStyleChanged(int index);
void onZoomPressed();
void onPickZoomPressed();
void onFocusNear();
void onFocusFar();
void onFocusNear2();
void onFocusFar2();
void onFocusNear3();
void onFocusFar3();
2020-04-10 11:06:47 +12:00
void onApertureChangedSignal(QString);
void onIsoChangedSignal(QString);
void onShutterSpeedChangedSignal(QString);
void onExposureChangedSignal(QString);
void onWhiteBalanceChangedSignal(QString);
void onColorTemperatureChangedSignal(QString);
void onImageQualityChangedSignal(QString);
void onPictureStyleChangedSignal(QString);
void refreshApertureList();
void refreshShutterSpeedList();
void refreshIsoList();
void refreshExposureList();
void refreshWhiteBalanceList();
void refreshColorTemperatureList();
void refreshImageQualityList();
void refreshPictureStyleList();
void refreshMode();
2020-04-16 10:02:02 +12:00
void onFocusCheckToggled(bool on);
void onPickFocusCheckToggled(bool on);
2020-04-10 11:06:47 +12:00
void onCaptureReviewFldEdited();
void onCaptureReviewSliderChanged(bool ignore);
void onSubsamplingFldEdited();
void onSubsamplingSliderChanged(bool ignore);
void onSubsamplingChanged(int);
void onFilePathChanged(QString);
void onLevelNameChanged(QString);
void onFileTypeChanged(QString);
void onXSheetFrameNumberChanged(int);
void onFrameNumberChanged(int);
void onFrameInfoTextChanged(QString);
void onOpacityChanged(int opacity);
void onScaleFullSizeImagesSignal(bool);
void onBlackCaptureSignal(bool);
void onLiveViewOnAllFramesSignal(bool);
void onPlaceOnXSheetSignal(bool);
void onUseMjpgSignal(bool);
void onUseDirectShowSignal(bool);
void onReviewTimeChangedSignal(int);
void onUseNumpadSignal(bool);
2020-04-10 18:01:27 +12:00
void onDrawBeneathSignal(bool);
void onLiveViewChanged(bool);
void onNewCameraSelected(int, bool);
void onWebcamResolutionsChanged();
void onNewWebcamResolutionSelected(int);
public slots:
void openSaveInFolderPopup();
};
#endif // STOPMOTIONCONTROLLER_H