ableton-js 3.1.9 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +2 -5
- package/index.d.ts +36 -4
- package/index.js +316 -528
- package/midi-script/version.py +1 -1
- package/ns/application-view.d.ts +3 -3
- package/ns/application-view.js +30 -116
- package/ns/application-view.spec.js +7 -57
- package/ns/application.js +10 -68
- package/ns/application.spec.js +7 -57
- package/ns/clip-slot.js +26 -43
- package/ns/clip.js +68 -132
- package/ns/cue-point.js +10 -67
- package/ns/device-parameter.js +9 -26
- package/ns/device.js +12 -29
- package/ns/index.d.ts +2 -2
- package/ns/index.js +47 -98
- package/ns/internal.js +11 -73
- package/ns/midi.js +18 -36
- package/ns/mixer-device.js +20 -37
- package/ns/mixer-device.spec.js +9 -64
- package/ns/scene.js +14 -73
- package/ns/song-view.js +21 -79
- package/ns/song-view.spec.js +7 -57
- package/ns/song.js +105 -271
- package/ns/song.spec.js +25 -112
- package/ns/track.js +23 -44
- package/package.json +5 -5
- package/util/cache.d.ts +3 -3
- package/util/cache.js +1 -3
- package/util/color.js +21 -33
- package/util/note.d.ts +1 -1
- package/util/note.js +4 -4
- package/util/package-version.js +5 -5
- package/util/package-version.spec.js +6 -6
- package/util/tests.js +12 -62
package/ns/song-view.js
CHANGED
|
@@ -1,91 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
3
|
exports.SongView = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
highlighted_clip_slot: function (slot) { return new clip_slot_1.ClipSlot(ableton, slot); },
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const track_1 = require("./track");
|
|
6
|
+
const scene_1 = require("./scene");
|
|
7
|
+
const device_parameter_1 = require("./device-parameter");
|
|
8
|
+
const clip_slot_1 = require("./clip-slot");
|
|
9
|
+
class SongView extends _1.Namespace {
|
|
10
|
+
constructor(ableton) {
|
|
11
|
+
super(ableton, "song-view");
|
|
12
|
+
this.transformers = {
|
|
13
|
+
selected_parameter: (param) => new device_parameter_1.DeviceParameter(ableton, param),
|
|
14
|
+
selected_track: (track) => new track_1.Track(ableton, track),
|
|
15
|
+
selected_scene: (scene) => new scene_1.Scene(ableton, scene),
|
|
16
|
+
highlighted_clip_slot: (slot) => new clip_slot_1.ClipSlot(ableton, slot),
|
|
69
17
|
};
|
|
70
|
-
|
|
18
|
+
this.cachedProps = {
|
|
71
19
|
selected_parameter: true,
|
|
72
20
|
selected_track: true,
|
|
73
21
|
selected_scene: true,
|
|
74
22
|
highlighted_clip_slot: true,
|
|
75
23
|
};
|
|
76
|
-
return _this;
|
|
77
24
|
}
|
|
78
|
-
|
|
79
|
-
return
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
name: "select_device",
|
|
84
|
-
args: { device_id: device.raw.id },
|
|
85
|
-
})];
|
|
86
|
-
});
|
|
25
|
+
async selectDevice(device) {
|
|
26
|
+
return this.ableton.sendCommand({
|
|
27
|
+
ns: this.ns,
|
|
28
|
+
name: "select_device",
|
|
29
|
+
args: { device_id: device.raw.id },
|
|
87
30
|
});
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
}(_1.Namespace));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
91
33
|
exports.SongView = SongView;
|
package/ns/song-view.spec.js
CHANGED
|
@@ -1,43 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
|
|
40
|
-
|
|
3
|
+
const tests_1 = require("../util/tests");
|
|
4
|
+
const gettableProps = [
|
|
41
5
|
"detail_clip",
|
|
42
6
|
"draw_mode",
|
|
43
7
|
"follow_song",
|
|
@@ -47,24 +11,10 @@ var gettableProps = [
|
|
|
47
11
|
"selected_scene",
|
|
48
12
|
"selected_track",
|
|
49
13
|
];
|
|
50
|
-
describe("Song View",
|
|
51
|
-
it("should be able to read all properties without erroring",
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
case 0: return [4 /*yield*/, tests_1.withAbleton(function (ab) { return __awaiter(void 0, void 0, void 0, function () {
|
|
55
|
-
return __generator(this, function (_a) {
|
|
56
|
-
switch (_a.label) {
|
|
57
|
-
case 0: return [4 /*yield*/, Promise.all(gettableProps.map(function (p) { return ab.song.view.get(p); }))];
|
|
58
|
-
case 1:
|
|
59
|
-
_a.sent();
|
|
60
|
-
return [2 /*return*/];
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
}); })];
|
|
64
|
-
case 1:
|
|
65
|
-
_a.sent();
|
|
66
|
-
return [2 /*return*/];
|
|
67
|
-
}
|
|
14
|
+
describe("Song View", () => {
|
|
15
|
+
it("should be able to read all properties without erroring", async () => {
|
|
16
|
+
await (0, tests_1.withAbleton)(async (ab) => {
|
|
17
|
+
await Promise.all(gettableProps.map((p) => ab.song.view.get(p)));
|
|
68
18
|
});
|
|
69
|
-
});
|
|
19
|
+
});
|
|
70
20
|
});
|
package/ns/song.js
CHANGED
|
@@ -1,62 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
3
|
exports.Song = exports.RecordingQuantization = exports.Quantization = exports.TimeFormat = void 0;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const track_1 = require("./track");
|
|
6
|
+
const cue_point_1 = require("./cue-point");
|
|
7
|
+
const song_view_1 = require("./song-view");
|
|
8
|
+
const scene_1 = require("./scene");
|
|
60
9
|
var TimeFormat;
|
|
61
10
|
(function (TimeFormat) {
|
|
62
11
|
TimeFormat[TimeFormat["MsTime"] = 0] = "MsTime";
|
|
@@ -65,7 +14,7 @@ var TimeFormat;
|
|
|
65
14
|
TimeFormat[TimeFormat["Smpte29"] = 3] = "Smpte29";
|
|
66
15
|
TimeFormat[TimeFormat["Smpte30"] = 4] = "Smpte30";
|
|
67
16
|
TimeFormat[TimeFormat["Smpte30Drop"] = 5] = "Smpte30Drop";
|
|
68
|
-
})(TimeFormat
|
|
17
|
+
})(TimeFormat || (exports.TimeFormat = TimeFormat = {}));
|
|
69
18
|
var Quantization;
|
|
70
19
|
(function (Quantization) {
|
|
71
20
|
Quantization["q_2_bars"] = "q_2_bars";
|
|
@@ -82,7 +31,7 @@ var Quantization;
|
|
|
82
31
|
Quantization["q_sixtenth"] = "q_sixtenth";
|
|
83
32
|
Quantization["q_sixtenth_triplet"] = "q_sixtenth_triplet";
|
|
84
33
|
Quantization["q_thirtytwoth"] = "q_thirtytwoth";
|
|
85
|
-
})(Quantization
|
|
34
|
+
})(Quantization || (exports.Quantization = Quantization = {}));
|
|
86
35
|
var RecordingQuantization;
|
|
87
36
|
(function (RecordingQuantization) {
|
|
88
37
|
RecordingQuantization["rec_q_eight"] = "rec_q_eight";
|
|
@@ -94,21 +43,19 @@ var RecordingQuantization;
|
|
|
94
43
|
RecordingQuantization["rec_q_sixtenth_sixtenth_triplet"] = "rec_q_sixtenth_sixtenth_triplet";
|
|
95
44
|
RecordingQuantization["rec_q_sixtenth_triplet"] = "rec_q_sixtenth_triplet";
|
|
96
45
|
RecordingQuantization["rec_q_thirtysecond"] = "rec_q_thirtysecond";
|
|
97
|
-
})(RecordingQuantization
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
visible_tracks: function (tracks) { return tracks.map(function (t) { return new track_1.Track(ableton, t); }); },
|
|
109
|
-
scenes: function (scenes) { return scenes.map(function (s) { return new scene_1.Scene(ableton, s); }); },
|
|
46
|
+
})(RecordingQuantization || (exports.RecordingQuantization = RecordingQuantization = {}));
|
|
47
|
+
class Song extends _1.Namespace {
|
|
48
|
+
constructor(ableton) {
|
|
49
|
+
super(ableton, "song");
|
|
50
|
+
this.transformers = {
|
|
51
|
+
cue_points: (points) => points.map((c) => new cue_point_1.CuePoint(ableton, c)),
|
|
52
|
+
master_track: (track) => new track_1.Track(ableton, track),
|
|
53
|
+
return_tracks: (tracks) => tracks.map((t) => new track_1.Track(ableton, t)),
|
|
54
|
+
tracks: (tracks) => tracks.map((t) => new track_1.Track(ableton, t)),
|
|
55
|
+
visible_tracks: (tracks) => tracks.map((t) => new track_1.Track(ableton, t)),
|
|
56
|
+
scenes: (scenes) => scenes.map((s) => new scene_1.Scene(ableton, s)),
|
|
110
57
|
};
|
|
111
|
-
|
|
58
|
+
this.cachedProps = {
|
|
112
59
|
cue_points: true,
|
|
113
60
|
master_track: true,
|
|
114
61
|
return_tracks: true,
|
|
@@ -116,204 +63,91 @@ var Song = /** @class */ (function (_super) {
|
|
|
116
63
|
visible_tracks: true,
|
|
117
64
|
scenes: true,
|
|
118
65
|
};
|
|
119
|
-
return _this;
|
|
120
66
|
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
return
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return __generator(this, function (_a) {
|
|
208
|
-
return [2 /*return*/, this.sendCachedCommand("get_data", { key: key })];
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
Song.prototype.getCurrentSmpteSongTime = function (timeFormat) {
|
|
213
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
214
|
-
return __generator(this, function (_a) {
|
|
215
|
-
return [2 /*return*/, this.sendCommand("get_current_smpte_song_time", { timeFormat: timeFormat })];
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
};
|
|
219
|
-
Song.prototype.isCuePointSelected = function () {
|
|
220
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
221
|
-
return __generator(this, function (_a) {
|
|
222
|
-
return [2 /*return*/, this.sendCommand("is_cue_point_selected")];
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
};
|
|
226
|
-
Song.prototype.jumpBy = function (amount) {
|
|
227
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
228
|
-
return __generator(this, function (_a) {
|
|
229
|
-
return [2 /*return*/, this.sendCommand("jump_by", [amount])];
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
};
|
|
233
|
-
Song.prototype.jumpToNextCue = function () {
|
|
234
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
235
|
-
return __generator(this, function (_a) {
|
|
236
|
-
return [2 /*return*/, this.sendCommand("jump_to_next_cue")];
|
|
237
|
-
});
|
|
238
|
-
});
|
|
239
|
-
};
|
|
240
|
-
Song.prototype.jumpToPrevCue = function () {
|
|
241
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
242
|
-
return __generator(this, function (_a) {
|
|
243
|
-
return [2 /*return*/, this.sendCommand("jump_to_prev_cue")];
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
};
|
|
247
|
-
Song.prototype.playSelection = function () {
|
|
248
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
249
|
-
return __generator(this, function (_a) {
|
|
250
|
-
return [2 /*return*/, this.sendCommand("play_selection")];
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
Song.prototype.redo = function () {
|
|
255
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
256
|
-
return __generator(this, function (_a) {
|
|
257
|
-
return [2 /*return*/, this.sendCommand("redo")];
|
|
258
|
-
});
|
|
259
|
-
});
|
|
260
|
-
};
|
|
261
|
-
Song.prototype.scrubBy = function (amount) {
|
|
262
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
263
|
-
return __generator(this, function (_a) {
|
|
264
|
-
return [2 /*return*/, this.sendCommand("scrub_by", [amount])];
|
|
265
|
-
});
|
|
266
|
-
});
|
|
267
|
-
};
|
|
268
|
-
Song.prototype.setData = function (key, value) {
|
|
269
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
270
|
-
return __generator(this, function (_a) {
|
|
271
|
-
return [2 /*return*/, this.sendCommand("set_data", [key, value])];
|
|
272
|
-
});
|
|
273
|
-
});
|
|
274
|
-
};
|
|
275
|
-
Song.prototype.setOrDeleteCue = function () {
|
|
276
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
277
|
-
return __generator(this, function (_a) {
|
|
278
|
-
return [2 /*return*/, this.sendCommand("set_or_delete_cue")];
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
Song.prototype.startPlaying = function () {
|
|
283
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
284
|
-
return __generator(this, function (_a) {
|
|
285
|
-
return [2 /*return*/, this.sendCommand("start_playing")];
|
|
286
|
-
});
|
|
287
|
-
});
|
|
288
|
-
};
|
|
289
|
-
Song.prototype.stopAllClips = function () {
|
|
290
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
291
|
-
return __generator(this, function (_a) {
|
|
292
|
-
return [2 /*return*/, this.sendCommand("stop_all_clips")];
|
|
293
|
-
});
|
|
294
|
-
});
|
|
295
|
-
};
|
|
296
|
-
Song.prototype.stopPlaying = function () {
|
|
297
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
298
|
-
return __generator(this, function (_a) {
|
|
299
|
-
return [2 /*return*/, this.sendCommand("stop_playing")];
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
};
|
|
303
|
-
Song.prototype.tapTempo = function () {
|
|
304
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
305
|
-
return __generator(this, function (_a) {
|
|
306
|
-
return [2 /*return*/, this.sendCommand("tap_tempo")];
|
|
307
|
-
});
|
|
308
|
-
});
|
|
309
|
-
};
|
|
310
|
-
Song.prototype.undo = function () {
|
|
311
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
312
|
-
return __generator(this, function (_a) {
|
|
313
|
-
return [2 /*return*/, this.sendCommand("undo")];
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
return Song;
|
|
318
|
-
}(_1.Namespace));
|
|
67
|
+
view = new song_view_1.SongView(this.ableton);
|
|
68
|
+
async beginUndoStep() {
|
|
69
|
+
return this.sendCommand("begin_undo_step");
|
|
70
|
+
}
|
|
71
|
+
async continuePlaying() {
|
|
72
|
+
return this.sendCommand("continue_playing");
|
|
73
|
+
}
|
|
74
|
+
async createAudioTrack(index) {
|
|
75
|
+
return this.sendCommand("create_audio_track", { index });
|
|
76
|
+
}
|
|
77
|
+
async createMidiTrack(index) {
|
|
78
|
+
return this.sendCommand("create_midi_track", { index });
|
|
79
|
+
}
|
|
80
|
+
async createReturnTrack() {
|
|
81
|
+
return this.sendCommand("create_return_track");
|
|
82
|
+
}
|
|
83
|
+
async createScene(index) {
|
|
84
|
+
return this.sendCommand("create_scene", [index]);
|
|
85
|
+
}
|
|
86
|
+
async deleteReturnTrack(index) {
|
|
87
|
+
return this.sendCommand("delete_return_track", [index]);
|
|
88
|
+
}
|
|
89
|
+
async deleteScene(index) {
|
|
90
|
+
return this.sendCommand("delete_scene", [index]);
|
|
91
|
+
}
|
|
92
|
+
async deleteTrack(index) {
|
|
93
|
+
return this.sendCommand("delete_track", [index]);
|
|
94
|
+
}
|
|
95
|
+
async duplicateScene(index) {
|
|
96
|
+
return this.sendCommand("duplicate_scene", [index]);
|
|
97
|
+
}
|
|
98
|
+
async duplicateTrack(index) {
|
|
99
|
+
return this.sendCommand("duplicate_track", [index]);
|
|
100
|
+
}
|
|
101
|
+
async endUndoStep() {
|
|
102
|
+
return this.sendCommand("end_undo_step");
|
|
103
|
+
}
|
|
104
|
+
async getData(key) {
|
|
105
|
+
return this.sendCachedCommand("get_data", { key });
|
|
106
|
+
}
|
|
107
|
+
async getCurrentSmpteSongTime(timeFormat) {
|
|
108
|
+
return this.sendCommand("get_current_smpte_song_time", { timeFormat });
|
|
109
|
+
}
|
|
110
|
+
async isCuePointSelected() {
|
|
111
|
+
return this.sendCommand("is_cue_point_selected");
|
|
112
|
+
}
|
|
113
|
+
async jumpBy(amount) {
|
|
114
|
+
return this.sendCommand("jump_by", [amount]);
|
|
115
|
+
}
|
|
116
|
+
async jumpToNextCue() {
|
|
117
|
+
return this.sendCommand("jump_to_next_cue");
|
|
118
|
+
}
|
|
119
|
+
async jumpToPrevCue() {
|
|
120
|
+
return this.sendCommand("jump_to_prev_cue");
|
|
121
|
+
}
|
|
122
|
+
async playSelection() {
|
|
123
|
+
return this.sendCommand("play_selection");
|
|
124
|
+
}
|
|
125
|
+
async redo() {
|
|
126
|
+
return this.sendCommand("redo");
|
|
127
|
+
}
|
|
128
|
+
async scrubBy(amount) {
|
|
129
|
+
return this.sendCommand("scrub_by", [amount]);
|
|
130
|
+
}
|
|
131
|
+
async setData(key, value) {
|
|
132
|
+
return this.sendCommand("set_data", [key, value]);
|
|
133
|
+
}
|
|
134
|
+
async setOrDeleteCue() {
|
|
135
|
+
return this.sendCommand("set_or_delete_cue");
|
|
136
|
+
}
|
|
137
|
+
async startPlaying() {
|
|
138
|
+
return this.sendCommand("start_playing");
|
|
139
|
+
}
|
|
140
|
+
async stopAllClips() {
|
|
141
|
+
return this.sendCommand("stop_all_clips");
|
|
142
|
+
}
|
|
143
|
+
async stopPlaying() {
|
|
144
|
+
return this.sendCommand("stop_playing");
|
|
145
|
+
}
|
|
146
|
+
async tapTempo() {
|
|
147
|
+
return this.sendCommand("tap_tempo");
|
|
148
|
+
}
|
|
149
|
+
async undo() {
|
|
150
|
+
return this.sendCommand("undo");
|
|
151
|
+
}
|
|
152
|
+
}
|
|
319
153
|
exports.Song = Song;
|