LMMS
Loading...
Searching...
No Matches
automations.h
Go to the documentation of this file.
1#pragma once
2#include <rtosc/ports.h>
3#include <rtosc/rtosc.h>
4#include <cassert>
5namespace rtosc {
7{
8 //0 - linear
9 //1 - log
11
12 //0 - simple linear (only first four control points are used)
13 //1 - piecewise linear
15
19
20 float gain;
21 float offset;
22};
23
25{
26 //If automation is allocated to anything or not
27 bool used;
28
29 //If automation is used or not
30 bool active;
31
32 //relative or absolute
34
35 //Cached infomation
37 char param_path[128];
39 float param_min;
40 float param_max;
41 float param_step; //resolution of parameter. Useful for:
42 //- integer valued controls
44};
45
46#define RTOSC_AUTOMATION_SLOT_NAME_LEN
48{
49 //If automation slot has active automations or not
50 bool active;
51
52 //If automation slot has active automations or not
53 bool used;
54
55 //Non-negative if a new MIDI binding is being learned
57
58 //-1 or a valid MIDI CC + MIDI Channel
60
61 //Current state supplied by MIDI value or host
63
64 //Current name
65 char name[128];
66
67 //Collection of automations
69};
70
72{
73 public:
74 AutomationMgr(int slots, int per_slot, int control_points);
75 ~AutomationMgr(void);
76
85 void createBinding(int slot, const char *path, bool start_midi_learn);
86
87 void updateMapping(int slot, int sub);
88
89
90
91 //Get/Set Automation Slot values 0..1
92 void setSlot(int slot_id, float value);
93 void setSlotSub(int slot_id, int sub, float value);
94 float getSlot(int slot_id);
95
96 void clearSlot(int slot_id);
97 void clearSlotSub(int slot_id, int sub);
98
99
100 void setSlotSubGain(int slot_id, int sub, float f);
101 float getSlotSubGain(int slot_id, int sub);
102 void setSlotSubOffset(int slot_id, int sub, float f);
103 float getSlotSubOffset(int slot_id, int sub);
104
105
106
107 void setName(int slot_id, const char *msg);
108 const char * getName(int slot_id);
109
110 bool handleMidi(int channel, int cc, int val);
111
112 void set_ports(const struct Ports &p);
113
114 void set_instance(void *v);
115
116 void simpleSlope(int slot, int au, float slope, float offset);
117
118 int free_slot(void) const;
119
125 struct AutomationMgrImpl *impl;
127 void *instance;
128
129 std::function<void(const char *)> backend;
130
132};
133};
AutomationSlot * slots
Definition automations.h:120
void setSlotSubOffset(int slot_id, int sub, float f)
Definition automations.cpp:235
~AutomationMgr(void)
Definition automations.cpp:28
std::function< void(const char *)> backend
Definition automations.h:129
bool handleMidi(int channel, int cc, int val)
Definition automations.cpp:263
void setSlotSubGain(int slot_id, int sub, float f)
Definition automations.cpp:221
void createBinding(int slot, const char *path, bool start_midi_learn)
Definition automations.cpp:32
const rtosc::Ports * p
Definition automations.h:126
float getSlotSubGain(int slot_id, int sub)
Definition automations.cpp:228
int learn_queue_len
Definition automations.h:124
const char * getName(int slot_id)
Definition automations.cpp:257
void setSlot(int slot_id, float value)
Definition automations.cpp:113
int nslots
Definition automations.h:121
void clearSlotSub(int slot_id, int sub)
Definition automations.cpp:201
int per_slot
Definition automations.h:122
int damaged
Definition automations.h:131
float getSlot(int slot_id)
Definition automations.cpp:171
void setName(int slot_id, const char *msg)
Definition automations.cpp:250
void simpleSlope(int slot, int au, float slope, float offset)
Definition automations.cpp:307
void set_ports(const struct Ports &p)
Definition automations.cpp:295
void updateMapping(int slot, int sub)
Definition automations.cpp:93
int free_slot(void) const
Definition automations.cpp:320
int active_slot
Definition automations.h:123
void set_instance(void *v)
Definition automations.cpp:302
AutomationMgr(int slots, int per_slot, int control_points)
Definition automations.cpp:6
void setSlotSub(int slot_id, int sub, float value)
Definition automations.cpp:123
struct AutomationMgrImpl * impl
Definition automations.h:125
void * instance
Definition automations.h:127
float getSlotSubOffset(int slot_id, int sub)
Definition automations.cpp:242
void clearSlot(int slot_id)
Definition automations.cpp:179
unsigned v[N_MAX]
Definition inflate.c:1584
unsigned f
Definition inflate.c:1572
static PuglViewHint int value
Definition pugl.h:1708
int val
Definition jpeglib.h:956
const char * msg
Definition missing_descriptor.c:20
Definition globals.h:37
Definition automations.h:25
char param_type
Definition automations.h:38
float param_step
Definition automations.h:41
char param_path[128]
Definition automations.h:37
float param_max
Definition automations.h:40
bool relative
Definition automations.h:33
AutomationMapping map
Definition automations.h:43
float param_base_value
Definition automations.h:36
bool used
Definition automations.h:27
float param_min
Definition automations.h:39
bool active
Definition automations.h:30
Definition automations.h:7
float offset
Definition automations.h:21
int upoints
Definition automations.h:18
float gain
Definition automations.h:20
int control_scale
Definition automations.h:10
int control_type
Definition automations.h:14
float * control_points
Definition automations.h:16
int npoints
Definition automations.h:17
Definition automations.h:48
bool active
Definition automations.h:50
char name[128]
Definition automations.h:65
bool used
Definition automations.h:53
Automation * automations
Definition automations.h:68
float current_state
Definition automations.h:62
int learning
Definition automations.h:56
int midi_cc
Definition automations.h:59
Definition ports.h:161
#define void
Definition unzip.h:396