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  static SetValueMode default_set_value_mode();
37 
39  float frame() const;
40 
42  bool is_current_frame() const;
43 
45  bool layer_value;
46  private:
47  float _frame; // The frame at which the value should be set or ModificationContext::current_frame for the current frame
48 
49  public:
51  const static ModificationContext layer;
54  const static float current_frame;
55 
56  static const ModificationContext& default_mc();
57  };
58 
60  {
61  return _frame == current_frame;
62  }
63 
64 }
static const ModificationContext no_undo
A static instance of ModificationContext to set values directly in the plugs, without possible undo...
Definition: ModificationContext.h:53
static const ModificationContext layer
A static instance of ModificationContext to set values in the active layer but do not require to be a...
Definition: ModificationContext.h:51
SetValueMode
Definition: ModificationContext.h:24
bool is_current_frame() const
Returns true if the modification is done at the current frame.
Definition: ModificationContext.h:59
static const ModificationContext animated
A static instance of ModificationContext to set values which must have an animation.
Definition: ModificationContext.h:50
The channel is animable but not keyed by default. It has to be explicitly keyed.
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
A static instance of ModificationContext to set undoable values but do not require to be done in a la...
Definition: ModificationContext.h:52
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:45
#define MAQUINA_EXPORT
Definition: Export.h:31
SetValueMode set_value_mode
The mode to set the value.
Definition: ModificationContext.h:44
static const float current_frame
Definition: ModificationContext.h:54