forked from einfachfelixverdammt/Maschine-Jam-for-Bitwig
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ClipMode.js
65 lines (55 loc) · 1.58 KB
/
ClipMode.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
var FlashStates = {
NONE: 0,
QUEUED: 1,
RECQUEUE: 2,
REC: 3
};
/**
* @classdesc Represents the general Clip Launching Mode
* @class
* @augments JamMode
*
* @param {ClipLaunchView} clipView
* @param {TrackViewContainer} trackView
* @param {SceneView} sceneView
*/
function ClipMode(clipView, trackView, sceneView, trackStates) {
JamMode.call(this, clipView, trackView, sceneView);
this.mainView.setTrackStates(trackStates);
this.mainView.setSceneStates(sceneView.sceneStates());
var blinkstate = 0;
this.recalcView = function () {
this.mainView.recalcView();
};
this.navigate = function (direction) {
this.mainView.navigate(direction);
sceneView.navigate(direction);
};
this.handleBlink = function () {
blinkstate = (blinkstate + 1) % 8;
this.mainView.blink(blinkstate);
};
this.setIndication = function (indication) {
this.mainView.setIndication(indication);
};
this.notifyModifier = function (modifierState) {
if (modifierState === 0) {
clipView.resetDuplicateCopyToggle();
clipView.update();
}
if (modifierState === 5) {
globalClipView.duplicateContent(); // Duplicate + Shift
}
};
/**
* @return {ClipView}
*/
this.getClipView = function () {
return clipLauncher;
};
this.postEnter = function () {
modifiers.setLockButtonState(false);
modifiers.setLockButtonHandler(function (value) {
});
};
}