Rumba C++ SDK
ModificationContext.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2020
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "Export.h"
18 
19 namespace maquina
20 {
22  {
23  public:
24  enum class SetValueMode
25  {
26  no_undo,
27  undoable,
28  layer,
29  animated,
30  };
31 
32  ModificationContext(SetValueMode set_value_mode, float frame = ModificationContext::current_frame, bool layer_value = false);
33 
34  static SetValueMode lower(SetValueMode a, SetValueMode b);
35  static SetValueMode higher(SetValueMode a, SetValueMode b);
36 
38  float frame() const;
39 
41  bool is_current_frame() const;
42 
44  bool layer_value;
45  private:
46  float _frame; // The frame at which the value should be set or ModificationContext::current_frame for the current frame
47 
48  public:
50  const static ModificationContext layer;
53  const static float current_frame;
54  };
55 
57  {
58  return _frame == current_frame;
59  }
60 
61 }
static const ModificationContext no_undo
Set values directly in the plugs, without possible undo.
Definition: ModificationContext.h:52
static const ModificationContext layer
Set values in the active layer but do not require to be animated.
Definition: ModificationContext.h:50
SetValueMode
Definition: ModificationContext.h:24
bool is_current_frame() const
Returns true if the modification is done at the current frame.
Definition: ModificationContext.h:56
static const ModificationContext animated
Set values which must have an animation.
Definition: ModificationContext.h:49
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
Definition: ModificationContext.h:21
static const ModificationContext undoable
Set undoable values but do not require to be done in a layer.
Definition: ModificationContext.h:51
bool layer_value
If true, the value is a layer value, it means, it has to be stored direclty in the layer...
Definition: ModificationContext.h:44
#define MAQUINA_EXPORT
Definition: Export.h:31
SetValueMode set_value_mode
The mode to set the value.
Definition: ModificationContext.h:43
static const float current_frame
Definition: ModificationContext.h:53