1 #pragma once
2 
3 #ifndef TFFXHANDLE_H
4 #define TFFXHANDLE_H
5 
6 #include <QObject>
7 #include <QString>
8 
9 #include "tcommon.h"
10 
11 #undef DVAPI
12 #undef DVVAR
13 #ifdef TOONZLIB_EXPORTS
14 #define DVAPI DV_EXPORT_API
15 #define DVVAR DV_EXPORT_VAR
16 #else
17 #define DVAPI DV_IMPORT_API
18 #define DVVAR DV_IMPORT_VAR
19 #endif
20 
21 class TFx;
22 
23 //=============================================================================
24 // TFxHandle
25 //-----------------------------------------------------------------------------
26 
27 class DVAPI TFxHandle final : public QObject {
28   Q_OBJECT
29 
30 private:
31   TFx *m_fx;
32   // for reperoducing the last fx-creation command in the Schematic
33   QString m_previousActionString;
34 
35 public:
36   TFxHandle();
37   ~TFxHandle();
38 
getFx()39   TFx *getFx() const { return m_fx; }
40 
41   // do not switch fx settings when single-clicking the fx node in the schematic
42   void setFx(TFx *fx, bool doSwitchFxSettings = true);
43 
notifyFxChanged()44   void notifyFxChanged() { emit fxChanged(); }
notifyFxPresetSaved()45   void notifyFxPresetSaved() { emit fxPresetSaved(); }
notifyFxPresetRemoved()46   void notifyFxPresetRemoved() { emit fxPresetRemoved(); }
47 
onFxNodeDoubleClicked()48   void onFxNodeDoubleClicked() { emit fxSettingsShouldBeSwitched(); }
49 
setPreviousActionString(QString str)50   void setPreviousActionString(QString str) { m_previousActionString = str; }
getPreviousActionString()51   QString getPreviousActionString() { return m_previousActionString; }
52 
53 public slots:
54   void onColumnChanged();
55 
56 signals:
57   void fxSwitched();
58   void fxChanged();
59   void fxPresetSaved();
60   void fxPresetRemoved();
61 
62   void fxSettingsShouldBeSwitched();
63 };
64 
65 #endif  // TFRAMEHANDLE_H
66