Olive
effectfield.h
1 #ifndef EFFECTFIELD_H
2 #define EFFECTFIELD_H
3 
4 enum EffectFieldType {
5  EFFECT_FIELD_DOUBLE,
6  EFFECT_FIELD_COLOR,
7  EFFECT_FIELD_STRING,
8  EFFECT_FIELD_BOOL,
9  EFFECT_FIELD_COMBO,
10  EFFECT_FIELD_FONT,
11  EFFECT_FIELD_FILE
12 };
13 
14 #include <QObject>
15 #include <QVariant>
16 #include <QVector>
17 
18 #include "keyframe.h"
19 
20 class EffectRow;
21 class ComboAction;
22 
23 class EffectField : public QObject {
24  Q_OBJECT
25 public:
26  EffectField(EffectRow* parent, int t, const QString& i);
27  ~EffectField();
28 
29  EffectRow* parent_row;
30  int type;
31  QString id;
32 
33  double get_validated_keyframe_handle(int key, bool post);
34 
35  QVariant get_previous_data();
36  QVariant get_current_data();
37  double frameToTimecode(long frame);
38  long timecodeToFrame(double timecode);
39  void set_current_data(const QVariant&);
40  void get_keyframe_data(double timecode, int& before, int& after, double& d);
41  QVariant validate_keyframe_data(double timecode, bool async = false);
42 
43  double get_double_value(double timecode, bool async = false);
44  void set_double_value(double v);
45  void set_double_default_value(double v);
46  void set_double_minimum_value(double v);
47  void set_double_maximum_value(double v);
48 
49  QString get_string_value(double timecode, bool async = false);
50  void set_string_value(const QString &s);
51 
52  void add_combo_item(const QString& name, const QVariant &data);
53  int get_combo_index(double timecode, bool async = false);
54  QVariant get_combo_data(double timecode);
55  QString get_combo_string(double timecode);
56  void set_combo_index(int index);
57  void set_combo_string(const QString& s);
58 
59  bool get_bool_value(double timecode, bool async = false);
60  void set_bool_value(bool b);
61 
62  QString get_font_name(double timecode, bool async = false);
63  void set_font_name(const QString& s);
64 
65  QColor get_color_value(double timecode, bool async = false);
66  void set_color_value(QColor color);
67 
68  QString get_filename(double timecode, bool async = false);
69  void set_filename(const QString& s);
70 
71  QWidget* get_ui_element();
72  bool is_enabled();
73  void set_enabled(bool e);
74  QVector<EffectKeyframe> keyframes;
75  QWidget* ui_element;
76 
77  void make_key_from_change(ComboAction* ca);
78 public slots:
79  void ui_element_change();
80 private:
81  bool hasKeyframes();
82 signals:
83  void changed();
84  void toggled(bool);
85  void clicked();
86 };
87 
88 #endif // EFFECTFIELD_H
Definition: undo.h:32
Definition: effectrow.h:17
Definition: effectfield.h:23