@@ -125,6 +125,7 @@ declare namespace engine {
125
125
function getPlayer ( group : string ) : Player | undefined
126
126
127
127
type SettingValue = string | number | boolean ;
128
+ type SharedDataValue = string | number | boolean | object | array | undefined ;
128
129
/**
129
130
* Gets the value of a controller setting
130
131
* The value is either set in the preferences dialog,
@@ -172,6 +173,28 @@ declare namespace engine {
172
173
*/
173
174
function setParameter ( group : string , name : string , newValue : number ) : void ;
174
175
176
+ /**
177
+ * Gets the shared runtime data.
178
+ * @returns Runtime shared data value
179
+ */
180
+ function getSharedData ( ) : SharedDataValue ;
181
+
182
+ /**
183
+ * Override the the shared runtime data with a new value.
184
+ *
185
+ * It is suggested to make additive changes (e.g add new attribute to existing object) in order to ease integration with other controller mapping
186
+ * @param newValue Runtime shared data value to be set
187
+ */
188
+ function setSharedData ( newValue : SharedDataValue ) : void ;
189
+
190
+ /**
191
+ * Sets the control value specified with normalized range of 0..1
192
+ * @param group Group of the control e.g. "[Channel1]"
193
+ * @param name Name of the control e.g. "play_indicator"
194
+ * @param newValue Value to be set, normalized to a range of 0..1
195
+ */
196
+ function setParameter ( group : string , name : string , newValue : number ) : void ;
197
+
175
198
/**
176
199
* Normalizes a specified value using the range of the given control,
177
200
* to the range of 0..1
@@ -212,6 +235,7 @@ declare namespace engine {
212
235
function getDefaultParameter ( group : string , name : string ) : number ;
213
236
214
237
type CoCallback = ( value : number , group : string , name : string ) => void
238
+ type RuntimeSharedDataCallback = ( value : SharedDataValue ) => void
215
239
216
240
/**
217
241
* Connects a specified Mixxx Control with a callback function, which is executed if the value of the control changes
@@ -221,10 +245,19 @@ declare namespace engine {
221
245
* @param group Group of the control e.g. "[Channel1]"
222
246
* @param name Name of the control e.g. "play_indicator"
223
247
* @param callback JS function, which will be called every time, the value of the connected control changes.
224
- * @returns Returns script connection object on success, otherwise 'undefined''
248
+ * @returns Returns script connection object on success, otherwise 'undefined'
225
249
*/
226
250
function makeConnection ( group : string , name : string , callback : CoCallback ) : ScriptConnection | undefined ;
227
251
252
+ /**
253
+ * Register callback function to be triggered when the shared data is updated
254
+ *
255
+ * Note that local update will also trigger the callback. Make sure to make your callback safe against recursion.
256
+ * @param callback JS function, which will be called every time, the shared controller value changes.
257
+ * @returns Returns script connection object on success, otherwise 'undefined'
258
+ */
259
+ function makeSharedDataConnection ( callback : RuntimeSharedDataCallback ) : ScriptConnection | undefined ;
260
+
228
261
/**
229
262
* Connects a specified Mixxx Control with a callback function, which is executed if the value of the control changes
230
263
*
0 commit comments