@@ -36,6 +36,7 @@ declare interface ScriptConnection {
36
36
37
37
declare namespace engine {
38
38
type SettingValue = string | number | boolean ;
39
+ type SharedDataValue = string | number | boolean | object | array | undefined ;
39
40
/**
40
41
* Gets the value of a controller setting
41
42
* The value is either set in the preferences dialog,
@@ -83,6 +84,28 @@ declare namespace engine {
83
84
*/
84
85
function setParameter ( group : string , name : string , newValue : number ) : void ;
85
86
87
+ /**
88
+ * Gets the shared runtime data.
89
+ * @returns Runtime shared data value
90
+ */
91
+ function getSharedData ( ) : SharedDataValue ;
92
+
93
+ /**
94
+ * Override the the shared runtime data with a new value.
95
+ *
96
+ * It is suggested to make additive changes (e.g add new attribute to existing object) in order to ease integration with other controller mapping
97
+ * @param newValue Runtime shared data value to be set
98
+ */
99
+ function setSharedData ( newValue : SharedDataValue ) : void ;
100
+
101
+ /**
102
+ * Sets the control value specified with normalized range of 0..1
103
+ * @param group Group of the control e.g. "[Channel1]"
104
+ * @param name Name of the control e.g. "play_indicator"
105
+ * @param newValue Value to be set, normalized to a range of 0..1
106
+ */
107
+ function setParameter ( group : string , name : string , newValue : number ) : void ;
108
+
86
109
/**
87
110
* Normalizes a specified value using the range of the given control,
88
111
* to the range of 0..1
@@ -123,6 +146,7 @@ declare namespace engine {
123
146
function getDefaultParameter ( group : string , name : string ) : number ;
124
147
125
148
type CoCallback = ( value : number , group : string , name : string ) => void
149
+ type RuntimeSharedDataCallback = ( value : SharedDataValue ) => void
126
150
127
151
/**
128
152
* Connects a specified Mixxx Control with a callback function, which is executed if the value of the control changes
@@ -132,10 +156,19 @@ declare namespace engine {
132
156
* @param group Group of the control e.g. "[Channel1]"
133
157
* @param name Name of the control e.g. "play_indicator"
134
158
* @param callback JS function, which will be called every time, the value of the connected control changes.
135
- * @returns Returns script connection object on success, otherwise 'undefined''
159
+ * @returns Returns script connection object on success, otherwise 'undefined'
136
160
*/
137
161
function makeConnection ( group : string , name : string , callback : CoCallback ) : ScriptConnection | undefined ;
138
162
163
+ /**
164
+ * Register callback function to be triggered when the shared data is updated
165
+ *
166
+ * Note that local update will also trigger the callback. Make sure to make your callback safe against recursion.
167
+ * @param callback JS function, which will be called every time, the shared controller value changes.
168
+ * @returns Returns script connection object on success, otherwise 'undefined'
169
+ */
170
+ function makeSharedDataConnection ( callback : RuntimeSharedDataCallback ) : ScriptConnection | undefined ;
171
+
139
172
/**
140
173
* Connects a specified Mixxx Control with a callback function, which is executed if the value of the control changes
141
174
*
0 commit comments