/
Host.js
891 lines (813 loc) · 31.7 KB
/
Host.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
/* API Version - 3.1.2 */
/**
* Defines the interface through which an extension can talk to the host application.
*/
function Host() {}
/**
* An interface representing the host application to the script.
* @global
* @type {Host}
*/
var host = new Host();
/**
* Returns the latest supported API version of the host application.
*
* @return {int} the latest supported API version of the host application
* @since API version 1
*/
Host.prototype.getHostApiVersion = function() {};
/**
* Returns the vendor of the host application.
*
* @return {string} the vendor of the host application
* @since API version 1
*/
Host.prototype.getHostVendor = function() {};
/**
* Returns the product name of the host application.
*
* @return {string} the product name of the host application
* @since API version 1
*/
Host.prototype.getHostProduct = function() {};
/**
* Returns the version number of the host application.
*
* @return {string} the version number of the host application
* @since API version 1
*/
Host.prototype.getHostVersion = function() {};
/**
* The platform type that this host is running on.
*
* @return {PlatformType}
*/
Host.prototype.getPlatformType = function() {};
/**
* Sets an email address to use for reporting errors found in this script.
*
* @param {string} address
* @since API version 2
*/
Host.prototype.setErrorReportingEMail = function(address) {};
/**
* Gets the OpenSoundControl module.
*
* @return {OscModule}
* @since API version 5
*/
Host.prototype.getOscModule = function() {};
/**
* Allocates some memory that will be automatically freed once the extension exits.
*
* @param {int} size
* @return {MemoryBlock}
* @since API version 7
*/
Host.prototype.allocateMemoryBlock = function(size) {};
/**
* Creates an offscreen bitmap that the extension can use to render into. The memory used by this bitmap is
* guaranteed to be freed once this extension exits.
*
* @param {int} width
* @param {int} height
* @param {BitmapFormat} format
* @return {Bitmap}
* @since API version 7
*/
Host.prototype.createBitmap = function(width, height, format) {};
/**
* Loads a font.
* The memory used by this font is guaranteed to be freed once this extension exits.
*
* @param {string} path
* @return {FontFace}
* @since API version 7
*/
Host.prototype.loadFontFace = function(path) {};
/**
* Creates a new FontOptions.
* This object is used to configure how the GraphicOutput will display text.
* The memory used by this object is guaranteed to be freed once this extension exits.
*
* @return {FontOptions}
* @since API version 7
*/
Host.prototype.createFontOptions = function() {};
/**
* Loads a PNG image.
* The memory used by this image is guaranteed to be freed once this extension exits.
*
* @param {string} path
* @return {Image}
* @since API version 7
*/
Host.prototype.loadPNG = function(path) {};
/**
* Loads a SVG image.
* The memory used by this image is guaranteed to be freed once this extension exits.
*
* @param {string} path
* @param {double} scale
* @return {Image}
* @since API version 7
*/
Host.prototype.loadSVG = function(path, scale) {};
/**
* Restarts this controller.
*
* @since API version 7
*/
Host.prototype.restart = function() {};
/**
* Loads the supplied API version into the calling script. This is only intended to be called from a
* controller script. It cannot be called from a Java controller extension.
*
* @param {int} version
*/
Host.prototype.loadAPI = function(version) {};
/**
* Call this method to allow your script to use Beta APIs.
*
* Beta APIs are still on development and might not be available in a future version of Bitwig Studio.
*
* Turning this flag to true, will flag your extension as being a beta extension which might not work after
* updating Bitwig Studio.
*
* @since API version 7
*/
Host.prototype.useBetaApi = function() {};
/**
* Determines whether the calling script should fail if it calls a deprecated method based on the API
* version that it requested.
*
* @return {boolean}
*/
Host.prototype.shouldFailOnDeprecatedUse = function() {};
/**
* Sets whether the calling script should fail if it calls a deprecated method based on the API version
* that it requested. This is only intended to be called from a controller script. It cannot be called from
* a Java controller extension.
*
* @param {boolean} value
*/
Host.prototype.setShouldFailOnDeprecatedUse = function(value) {};
/**
* Loads the script defined by the supplied path. This is only intended to be called from a controller
* script. It cannot be called from a Java controller extension.
*
* @param {string} path
*/
Host.prototype.load = function(path) {};
/**
* Indicates if the host platform is Windows.
*
* @return {boolean} `true` if the host platform is Windows, `false` otherwise.
* @since API version 1
*/
Host.prototype.platformIsWindows = function() {};
/**
* Indicates if the host platform is Apple Mac OS X.
*
* @return {boolean} `true` if the host platform is Mac, `false` otherwise.
* @since API version 1
*/
Host.prototype.platformIsMac = function() {};
/**
* Indicates if the host platform is Linux.
*
* @return {boolean} `true` if the host platform is Linux, `false` otherwise.
* @since API version 1
*/
Host.prototype.platformIsLinux = function() {};
/**
* Registers a controller script with the given parameters. This function must be called once at the global
* scope of the script.
*
* @param vendor
the name of the hardware vendor. Must not be <code>null</code>.
* @param name
the name of the controller script as listed in the user interface of Bitwig Studio. Must not
be <code>null</code>.
* @param version
the version of the controller script. Must not be <code>null</code>.
* @param uuid
a universal unique identifier (UUID) string that is used to distinguish one script from
another, for example `550e8400-e29b-11d4-a716-446655440000`. Must not be <code>null</code>.
For generating random UUID strings several free web tools are available.
* @param author
the name of the script author
* @since API version 1
*/
Host.prototype.defineController = function(vendor, name, version, uuid, author) {};
/**
* Defines the number of MIDI ports for input and output that the device uses. This method should be called
* once in the global scope if the script is supposed to exchange MIDI messages with the device, or if the
* script adds entries to the MIDI input/output choosers in Bitwig Studio. After calling this method the
* individual port objects can be accessed using {@link #getMidiInPort(int index)} and
* {@link #getMidiInPort(int index)}.
*
* @param numInports
the number of input ports
* @param numOutports
the number of output ports
* @since API version 1
*/
Host.prototype.defineMidiPorts = function(numInports, numOutports) {};
/**
* Returns the MIDI input port with the given index.
*
* @param index
the index of the MIDI input port, must be valid.
* @return {MidiIn} the requested MIDI input port
* @since API version 1
*/
Host.prototype.getMidiInPort = function(index) {};
/**
* Returns the MIDI output port with the given index.
*
* @param index
the index of the MIDI output port, must be valid.
* @return {MidiOut} the requested MIDI output port
* @since API version 1
*/
Host.prototype.getMidiOutPort = function(index) {};
/**
* Gets the {@link HardwareDevice} at the specified index. This index corresponds to the index of the
* {@link HardwareDeviceMatcher} specified in the
* {@link ControllerExtensionDefinition#listHardwareDevices(java.util.List)}
*
* @param {int} index
* @return {HardwareDevice}
* @since API version 7
*/
Host.prototype.hardwareDevice = function(index) {};
/**
* Registers patterns which are used to automatically detect hardware devices that can be used with the
* script.<br/>
*
* When the user clicks on the `detect` button in the Bitwig Studio controller preferences dialog, Bitwig
* Studio searches for connected controller hardware by comparing the parameters passed into this function
* are compared with the port names of the available MIDI drivers. Found controller scripts are
* automatically added with their input/output ports configured.<br/>
*
* Calling this function is optional, but can also be called multiple times in the global script scope in
* order to support alternative driver names.
*
* @param inputs
the array of strings used to detect MIDI input ports, must not be `null`.
* @param outputs
the array of strings used to detect MIDI output ports, must not be `null`.
* @since API version 1
*/
Host.prototype.addDeviceNameBasedDiscoveryPair = function(inputs, outputs) {};
/**
* Creates a preferences object that can be used to insert settings into the Controller Preferences panel
* in Bitwig Studio.
*
* @return {Preferences} an object that provides access to custom controller preferences
* @since API version 1
*/
Host.prototype.getPreferences = function() {};
/**
* Creates a document state object that can be used to insert settings into the Studio I/O Panel in Bitwig
* Studio.
*
* @return {DocumentState} an object that provides access to custom document settings
* @since API version 1
*/
Host.prototype.getDocumentState = function() {};
/**
* Returns an object that is used to configure automatic notifications. Bitwig Studio supports automatic
* visual feedback from controllers that shows up as popup notifications. For example when the selected
* track or the current device preset was changed on the controller these notifications are shown,
* depending on your configuration.
*
* @return {NotificationSettings} a configuration object used to enable/disable the various automatic notifications supported by
Bitwig Studio
* @since API version 1
*/
Host.prototype.getNotificationSettings = function() {};
/**
* Returns an object for controlling various aspects of the currently selected project.
*
* @return {Project}
* @since API version 1
*/
Host.prototype.getProject = function() {};
/**
* Returns an object for controlling and monitoring the elements of the `Transport` section in Bitwig
* Studio. This function should be called once during initialization of the script if transport access is
* desired.
*
* @return {Transport} an object that represents the `Transport` section in Bitwig Studio.
* @since API version 1
*/
Host.prototype.createTransport = function() {};
/**
* Returns an object for controlling and monitoring the `Groove` section in Bitwig Studio. This function
* should be called once during initialization of the script if groove control is desired.
*
* @return {Groove} an object that represents the `Groove` section in Bitwig Studio.
* @since API version 1
*/
Host.prototype.createGroove = function() {};
/**
* Returns an object that provides access to general application functionality, including global view
* settings, the list of open projects, and other global settings that are not related to a certain
* document.
*
* @return {Application} an application object.
* @since API version 1
*/
Host.prototype.createApplication = function() {};
/**
* Returns an object which provides access to the `Arranger` panel of Bitwig Studio. Calling this function
* is equal to `createArranger(-1)`.
*
* @return {Arranger} an arranger object
* @since API version 1
*/
Host.prototype.createArranger = function() {};
/**
* Returns an object which provides access to the `Arranger` panel inside the specified window.
*
* @param window
the index of the window where the arranger panel is shown, or -1 in case the first arranger
panel found on any window should be taken
* @return {Arranger} an arranger object
* @since API version 1
*/
Host.prototype.createArranger = function(window) {};
/**
* Returns an object which provides access to the `Mixer` panel of Bitwig Studio. Calling this function is
* equal to `createMixer(-1, null)`.
*
* @return {Mixer} a `Mixer` object
* @since API version 1
*/
Host.prototype.createMixer = function() {};
/**
* Returns an object which provides access to the `Mixer` panel that belongs to the specified panel layout.
* Calling this function is equal to `createMixer(-1, panelLayout)`.
*
* @param panelLayout
the name of the panel layout that contains the mixer panel, or `null` in case the selected
panel layout in Bitwig Studio should be followed. Empty strings or invalid names are treated
the same way as `null`. To receive the list of available panel layouts see
{@link Application#addPanelLayoutObserver}.
* @return {Mixer} a `Mixer` object
* @since API version 1
*/
Host.prototype.createMixer = function(panelLayout) {};
/**
* Returns an object which provides access to the `Mixer` panel inside the specified window. Calling this
* function is equal to `createMixer(window, null)`.
*
* @param window
the index of the window where the mixer panel is shown, or -1 in case the first mixer panel
found on any window should be taken
* @return {Mixer} a `Mixer` object
* @since API version 1
*/
Host.prototype.createMixer = function(window) {};
/**
* Returns an object which provides access to the `Mixer` panel that matches the specified parameters.
*
* @param panelLayout
the name of the panel layout that contains the mixer panel, or `null` in case the selected
panel layout in Bitwig Studio should be followed. Empty strings or invalid names are treated
the same way as `null`. To receive the list of available panel layouts see
{@link Application#addPanelLayoutObserver}.
* @param window
the index of the window where the mixer panel is shown, or -1 in case the first mixer panel
found on any window should be taken
* @return {Mixer} a `Mixer` object
* @since API version 1
*/
Host.prototype.createMixer = function(panelLayout, window) {};
/**
* Returns a track bank with the given number of tracks, sends and scenes.<br/>
*
* A track bank can be seen as a fixed-size window onto the list of tracks in the current document
* including their sends and scenes, that can be scrolled in order to access different parts of the track
* list. For example a track bank configured for 8 tracks can show track 1-8, 2-9, 3-10 and so on.<br/>
*
* The idea behind the `bank pattern` is that hardware typically is equipped with a fixed amount of channel
* strips or controls, for example consider a mixing console with 8 channels, but Bitwig Studio documents
* contain a dynamic list of tracks, most likely more tracks than the hardware can control simultaneously.
* The track bank returned by this function provides a convenient interface for controlling which tracks
* are currently shown on the hardware.<br/>
*
* Creating a track bank using this method will consider all tracks in the document, including effect
* tracks and the master track. Use {@link #createMainTrackBank} or {@link #createEffectTrackBank} in case
* you are only interested in tracks of a certain kind.
*
* @param numTracks
the number of tracks spanned by the track bank
* @param numSends
the number of sends spanned by the track bank
* @param numScenes
the number of scenes spanned by the track bank
* @return {TrackBank} an object for bank-wise navigation of tracks, sends and scenes
* @since API version 1
*/
Host.prototype.createTrackBank = function(numTracks, numSends, numScenes) {};
/**
* Returns a track bank with the given number of child tracks, sends and scenes.<br/>
*
* A track bank can be seen as a fixed-size window onto the list of tracks in the connected track group
* including their sends and scenes, that can be scrolled in order to access different parts of the track
* list. For example a track bank configured for 8 tracks can show track 1-8, 2-9, 3-10 and so on.<br/>
*
* The idea behind the `bank pattern` is that hardware typically is equipped with a fixed amount of channel
* strips or controls, for example consider a mixing console with 8 channels, but Bitwig Studio documents
* contain a dynamic list of tracks, most likely more tracks than the hardware can control simultaneously.
* The track bank returned by this function provides a convenient interface for controlling which tracks
* are currently shown on the hardware.<br/>
*
* Creating a track bank using this method will consider all tracks in the document, including effect
* tracks and the master track. Use {@link #createMainTrackBank} or {@link #createEffectTrackBank} in case
* you are only interested in tracks of a certain kind.
*
* @param numTracks
the number of child tracks spanned by the track bank
* @param numSends
the number of sends spanned by the track bank
* @param numScenes
the number of scenes spanned by the track bank
* @param hasFlatTrackList
specifies whether the track bank should operate on a flat list of all nested child tracks or
only on the direct child tracks of the connected group track.
* @return {TrackBank} an object for bank-wise navigation of tracks, sends and scenes
* @since API version 1
*/
Host.prototype.createTrackBank = function(numTracks, numSends, numScenes, hasFlatTrackList) {};
/**
* Returns a track bank with the given number of tracks, sends and scenes. Only audio tracks, instrument
* tracks and hybrid tracks are considered. For more information about track banks and the `bank pattern`
* in general, see the documentation for {@link #createTrackBank}.
*
* @param numTracks
the number of tracks spanned by the track bank
* @param numSends
the number of sends spanned by the track bank
* @param numScenes
the number of scenes spanned by the track bank
* @return {TrackBank} an object for bank-wise navigation of tracks, sends and scenes
* @since API version 1
*/
Host.prototype.createMainTrackBank = function(numTracks, numSends, numScenes) {};
/**
* Returns a track bank with the given number of effect tracks and scenes. Only effect tracks are
* considered. For more information about track banks and the `bank pattern` in general, see the
* documentation for {@link #createTrackBank}.
*
* @param numTracks
the number of tracks spanned by the track bank
* @param numScenes
the number of scenes spanned by the track bank
* @return {TrackBank} an object for bank-wise navigation of tracks, sends and scenes
* @since API version 1
*/
Host.prototype.createEffectTrackBank = function(numTracks, numScenes) {};
/**
* Returns an object that represents the master track of the document.
*
* @param numScenes
the number of scenes for bank-wise navigation of the master tracks clip launcher slots.
* @return {MasterTrack} an object representing the master track.
* @since API version 1
*/
Host.prototype.createMasterTrack = function(numScenes) {};
/**
* Returns an object that represents a named cursor track, that is independent from the arranger or mixer
* track selection in the user interface of Bitwig Studio.
*
* @param {string} id
* @param {string} name
* @param {int} numSends
* @param {int} numScenes
* @param {boolean} shouldFollowSelection
* @return {CursorTrack} an object representing the currently selected arranger track (in the future also multiple
tracks).
* @since API version 1
*/
Host.prototype.createCursorTrack = function(id, name, numSends, numScenes, shouldFollowSelection) {};
/**
* Returns a scene bank with the given number of scenes.<br/>
*
* A scene bank can be seen as a fixed-size window onto the list of scenes in the current document, that
* can be scrolled in order to access different parts of the scene list. For example a scene bank
* configured for 8 scenes can show scene 1-8, 2-9, 3-10 and so on.<br/>
*
* The idea behind the `bank pattern` is that hardware typically is equipped with a fixed amount of channel
* strips or controls, for example consider a mixing console with 8 channels, but Bitwig Studio documents
* contain a dynamic list of scenes, most likely more scenes than the hardware can control simultaneously.
* The scene bank returned by this function provides a convenient interface for controlling which scenes
* are currently shown on the hardware.<br/>
*
* @param numScenes
the number of scenes spanned by the track bank
* @return {SceneBank} an object for bank-wise navigation of scenes
* @since API version 1
*/
Host.prototype.createSceneBank = function(numScenes) {};
/**
* Returns a clip object that represents the cursor of the launcher clip selection. The gridWidth and
* gridHeight parameters specify the grid dimensions used to access the note content of the clip.
*
* @param gridWidth
the number of steps spanned by one page of the note content grid.
* @param gridHeight
the number of keys spanned by one page of the note content grid.
* @return {Clip} an object representing the currently selected cursor clip
* @since API version 1
*/
Host.prototype.createLauncherCursorClip = function(gridWidth, gridHeight) {};
/**
* Returns a clip object that represents the cursor of the arranger clip selection. The gridWidth and
* gridHeight parameters specify the grid dimensions used to access the note content of the clip.
*
* @param gridWidth
the number of steps spanned by one page of the note content grid.
* @param gridHeight
the number of keys spanned by one page of the note content grid.
* @return {Clip} an object representing the currently selected cursor clip
* @since API version 1
*/
Host.prototype.createArrangerCursorClip = function(gridWidth, gridHeight) {};
/**
* Returns an object that is used to define a bank of custom user controls. These controls are available to
* the user for free controller assignments and are typically used when bank-wise navigation is
* inconvenient.
*
* @param numControllers
the number of controls that are available for free assignments
* @return {UserControlBank} An object that represents a set of custom user controls.
* @since API version 1
*/
Host.prototype.createUserControls = function(numControllers) {};
/**
* Schedules the given callback function for execution after the given delay. For timer applications call
* this method once initially and then from within the callback function.
*
* @param callback
the callback function that will be called
* @param delay
the duration after which the callback function will be called in milliseconds
* @since API version 2
*/
Host.prototype.scheduleTask = function(callback, delay) {};
/**
* Requests that the driver's flush method gets called.
*
* @since API version 2
*/
Host.prototype.requestFlush = function() {};
/**
* Prints the given string in the control surface console window. The console window can be opened in the
* view menu of Bitwig Studio.
*
* @param s
the string to be printed
* @since API version 1
*/
Host.prototype.println = function(s) {};
/**
* Prints the given string in the control surface console window using a text style that highlights the
* string as error. The console window can be opened in the view menu of Bitwig Studio.
*
* @param s
the error string to be printed
* @since API version 1
*/
Host.prototype.errorln = function(s) {};
/**
* Shows a temporary text overlay on top of the application GUI, that will fade-out after a short interval.
* If the overlay is already shown, it will get updated with the given text.
*
* @param text
the text to be shown
* @since API version 1
*/
Host.prototype.showPopupNotification = function(text) {};
/**
* Opens a TCP (Transmission Control Protocol) host socket for allowing network connections from other
* hardware and software.
*
* @param name
a meaningful name that describes the purpose of this connection.
* @param defaultPort
the port that should be used for the connection. If the port is already in use, then another
port will be used. Check {@link RemoteSocket#getPort()} on the returned object to be sure.
* @return {RemoteSocket} the object that represents the socket
* @since API version 1
*/
Host.prototype.createRemoteConnection = function(name, defaultPort) {};
/**
* Connects to a remote TCP (Transmission Control Protocol) socket.
*
* @param host
the host name or IP address to connect to.
* @param port
the port to connect to
* @param callback
the callback function that gets called when the connection gets established. A single
{@link RemoteConnection} parameter is passed into the callback function.
* @since API version 1
*/
Host.prototype.connectToRemoteHost = function(host, port, callback) {};
/**
* Sends a UDP (User Datagram Protocol) packet with the given data to the specified host.
*
* @param host
the destination host name or IP address
* @param port
the destination port
* @param data
the data to be send. When creating a numeric byte array in JavaScript, the byte values must be
signed (in the range -128..127).
* @since API version 1
*/
Host.prototype.sendDatagramPacket = function(host, port, data) {};
/**
* Adds an observer for incoming UDP (User Datagram Protocol) packets on the selected port.
*
* @param name
a meaningful name that describes the purpose of this observer.
* @param port
the port that should be used
* @param callback
the callback function that gets called when data arrives. The function receives a single
parameter that contains the data byte array.
* @return {boolean} {@true} if was possible to bind the port, false otherwise
* @since API version 1
*/
Host.prototype.addDatagramPacketObserver = function(name, port, callback) {};
/**
* @param {int} numSends
* @param {int} numScenes
* @return {CursorTrack}
* @since API version 1
*/
Host.prototype.createCursorTrack = function(numSends, numScenes) {};
/**
* Creates a {@link PopupBrowser} that represents the pop-up browser in Bitwig Studio.
*
* @return {PopupBrowser}
* @since API version 2
*/
Host.prototype.createPopupBrowser = function() {};
/**
* {@link BeatTimeFormatter} used to format beat times by default. This will be used to format beat times
* when asking for a beat time in string format without providing any formatting options. For example by
* calling {@link BeatTimeStringValue#get()}.
*
* @return {BeatTimeFormatter}
* @since API version 2
*/
Host.prototype.defaultBeatTimeFormatter = function() {};
/**
* Sets the {@link BeatTimeFormatter} to use by default for formatting beat times.
*
* @param {BeatTimeFormatter} formatter
* @since API version 2
*/
Host.prototype.setDefaultBeatTimeFormatter = function(formatter) {};
/**
* Creates a {@link BeatTimeFormatter} that can be used to format beat times.
*
* @param separator
the character used to separate the segments of the formatted beat time, typically ":", "." or
"-"
* @param barsLen
the number of digits reserved for bars
* @param beatsLen
the number of digits reserved for beats
* @param subdivisionLen
the number of digits reserved for beat subdivisions
* @param ticksLen
the number of digits reserved for ticks
* @return {BeatTimeFormatter}
* @since API version 2
*/
Host.prototype.createBeatTimeFormatter = function(separator, barsLen, beatsLen, subdivisionLen, ticksLen) {};
/**
* Creates a {@link HardwareSurface} that can contain hardware controls.
*
* @return {HardwareSurface}
* @since API version 10
*/
Host.prototype.createHardwareSurface = function() {};
/**
* Creates a {@link HardwareActionMatcher} that is matched by either of the 2 supplied action matchers.
*
* @param {HardwareActionMatcher} matcher1
* @param {HardwareActionMatcher} matcher2
* @return {HardwareActionMatcher}
* @since API version 10
*/
Host.prototype.createOrHardwareActionMatcher = function(matcher1, matcher2) {};
/**
* Creates a {@link RelativeHardwareValueMatcher} that is matched by either of the 2 supplied action
* matchers.
*
* @param {RelativeHardwareValueMatcher} matcher1
* @param {RelativeHardwareValueMatcher} matcher2
* @return {RelativeHardwareValueMatcher}
* @since API version 10
*/
Host.prototype.createOrRelativeHardwareValueMatcher = function(matcher1, matcher2) {};
/**
* Creates a {@link AbsoluteHardwareValueMatcher} that is matched by either of the 2 supplied action
* matchers.
*
* @param {AbsoluteHardwareValueMatcher} matcher1
* @param {AbsoluteHardwareValueMatcher} matcher2
* @return {AbsoluteHardwareValueMatcher}
* @since API version 10
*/
Host.prototype.createOrAbsoluteHardwareValueMatcher = function(matcher1, matcher2) {};
/**
* An object that can be used to generate useful MIDI expression strings which can be used in
* {@link MidiIn#createActionMatcher(String)} and other related methods.
*
* @return {MidiExpressions}
* @since API version 10
*/
Host.prototype.midiExpressions = function() {};
/**
* Creates a {@link HardwareActionBindable} that can be bound to some {@link HardwareAction} (such as a
* button press) and when that action occurs the supplied {@link Runnable} will be run
*
* @param runnable
The runnable to be run
* @param descriptionProvider
Provider that can provide a description of what the runnable does (used for showing onscreen
feedback or help to the user).
* @return {HardwareActionBindable}
* @since API version 10
*/
Host.prototype.createAction = function(runnable, descriptionProvider) {};
/**
* Creates a {@link HardwareActionBindable} that can be bound to some {@link HardwareAction} (such as a
* button press) and when that action occurs the supplied {@link Runnable} will be run
*
* @param actionPressureConsumer
Consumer that will be notified of the pressure of the action
* @param descriptionProvider
Provider that can provide a description of what the runnable does (used for showing onscreen
feedback or help to the user).
* @return {HardwareActionBindable}
* @since API version 10
*/
Host.prototype.createAction = function(actionPressureConsumer, descriptionProvider) {};
/**
* Creates a {@link RelativeHardwarControlBindable} that can be used to step forwards or backwards when a
* {@link RelativeHardwareControl} is adjusted. A step is defined by the
* {@link RelativeHardwareControl#setStepSize(double)}.
*
* @param stepForwardsAction
The action that should happen when stepping forwards
* @param stepBackwardsAction
The action that should happen when stepping backwards
* @return {RelativeHardwarControlBindable}
* @since API version 10
*/
Host.prototype.createRelativeHardwareControlStepTarget = function(stepForwardsAction, stepBackwardsAction) {};
/**
* Creates a {@link RelativeHardwarControlBindable} that can be used to adjust some value in an arbitrary
* way.
*
* @param adjustmentConsumer
A consumer that will receive the relative adjustment amount when bound to a
{@link RelativeHardwareControl}.
* @return {RelativeHardwarControlBindable}
* @since API version 10
*/
Host.prototype.createRelativeHardwareControlAdjustmentTarget = function(adjustmentConsumer) {};
/**
* Creates a {@link AbsoluteHardwarControlBindable} that can be used to adjust some value in an arbitrary
* way.
*
* @param adjustmentConsumer
A consumer that will receive the absolute adjustment amount when bound to an
{@link AbsoluteHardwareControl}.
* @return {AbsoluteHardwarControlBindable}
* @since API version 10
*/
Host.prototype.createAbsoluteHardwareControlAdjustmentTarget = function(adjustmentConsumer) {};
/**
* It will delete multiple object within one undo step.
*
* @param {string} undoName
* @param {DeleteableObject} objects
*/
Host.prototype.deleteObjects = function(undoName, /*...*/objects) {};
/**
* It will delete multiple object within one undo step.
*
* @param {DeleteableObject} objects
*/
Host.prototype.deleteObjects = function(/*...*/objects) {};