@opendaw/studio-adapters 0.0.48 → 0.0.50
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/dist/AutomatableParameterFieldAdapter.js +86 -73
- package/dist/BoxAdapterCollection.js +30 -17
- package/dist/BoxAdapters.d.ts.map +1 -1
- package/dist/BoxAdapters.js +87 -72
- package/dist/BoxAdaptersContext.d.ts +2 -2
- package/dist/BoxAdaptersContext.d.ts.map +1 -1
- package/dist/EngineProcessorAttachment.d.ts +2 -1
- package/dist/EngineProcessorAttachment.d.ts.map +1 -1
- package/dist/FieldAdapter.js +45 -32
- package/dist/IndexedBoxAdapterCollection.js +45 -32
- package/dist/NoteBroadcaster.js +25 -12
- package/dist/NoteStreamReceiver.js +29 -16
- package/dist/ParameterAdapterSet.js +24 -11
- package/dist/ParameterFieldAdapters.js +19 -6
- package/dist/Parsing.d.ts +5 -0
- package/dist/Parsing.d.ts.map +1 -0
- package/dist/Parsing.js +10 -0
- package/dist/PianoModeAdapter.js +32 -19
- package/dist/RootBoxAdapter.js +37 -24
- package/dist/Validator.d.ts +10 -0
- package/dist/Validator.d.ts.map +1 -0
- package/dist/Validator.js +35 -0
- package/dist/audio/AudioFileBoxAdapter.js +23 -10
- package/dist/audio-unit/AudioBusBoxAdapter.d.ts +1 -1
- package/dist/audio-unit/AudioBusBoxAdapter.d.ts.map +1 -1
- package/dist/audio-unit/AudioBusBoxAdapter.js +31 -18
- package/dist/audio-unit/AudioUnitBoxAdapter.js +74 -63
- package/dist/audio-unit/AudioUnitInput.d.ts +1 -1
- package/dist/audio-unit/AudioUnitInput.d.ts.map +1 -1
- package/dist/audio-unit/AudioUnitInput.js +43 -30
- package/dist/audio-unit/AudioUnitOutput.js +33 -20
- package/dist/audio-unit/AudioUnitTracks.js +39 -26
- package/dist/audio-unit/AuxSendBoxAdapter.js +47 -34
- package/dist/devices/audio-effects/CompressorDeviceBoxAdapter.js +49 -37
- package/dist/devices/audio-effects/CrusherDeviceBoxAdapter.js +41 -29
- package/dist/devices/audio-effects/DelayDeviceBoxAdapter.js +51 -39
- package/dist/devices/audio-effects/FoldDeviceBoxAdapter.js +39 -27
- package/dist/devices/audio-effects/ModularDeviceBoxAdapter.js +33 -20
- package/dist/devices/audio-effects/RevampDeviceBoxAdapter.js +46 -34
- package/dist/devices/audio-effects/ReverbDeviceBoxAdapter.js +45 -33
- package/dist/devices/audio-effects/StereoToolDeviceBoxAdapter.js +43 -31
- package/dist/devices/audio-effects/TidalDeviceBoxAdapter.d.ts +36 -0
- package/dist/devices/audio-effects/TidalDeviceBoxAdapter.d.ts.map +1 -0
- package/dist/devices/audio-effects/TidalDeviceBoxAdapter.js +63 -0
- package/dist/devices/audio-effects/UnknownAudioEffectDeviceBoxAdapter.js +30 -17
- package/dist/devices/instruments/MIDIOutputDeviceBoxAdapter.js +42 -29
- package/dist/devices/instruments/NanoDeviceBoxAdapter.js +38 -26
- package/dist/devices/instruments/Playfield/PlayfieldSampleBoxAdapter.js +101 -89
- package/dist/devices/instruments/PlayfieldDeviceBoxAdapter.d.ts +0 -1
- package/dist/devices/instruments/PlayfieldDeviceBoxAdapter.d.ts.map +1 -1
- package/dist/devices/instruments/PlayfieldDeviceBoxAdapter.js +36 -24
- package/dist/devices/instruments/SoundfontDeviceBoxAdapter.js +84 -72
- package/dist/devices/instruments/TapeDeviceBoxAdapter.js +40 -28
- package/dist/devices/instruments/VaporisateurDeviceBoxAdapter.d.ts +26 -4
- package/dist/devices/instruments/VaporisateurDeviceBoxAdapter.d.ts.map +1 -1
- package/dist/devices/instruments/VaporisateurDeviceBoxAdapter.js +70 -33
- package/dist/devices/instruments/VaporisateurSettings.d.ts +17 -0
- package/dist/devices/instruments/VaporisateurSettings.d.ts.map +1 -0
- package/dist/devices/instruments/VaporisateurSettings.js +24 -0
- package/dist/devices/midi-effects/ArpeggioDeviceBoxAdapter.js +51 -39
- package/dist/devices/midi-effects/PitchDeviceBoxAdapter.js +40 -28
- package/dist/devices/midi-effects/UnknownMidiEffectDeviceBoxAdapter.js +30 -17
- package/dist/devices/midi-effects/VelocityDeviceBoxAdapter.js +47 -35
- package/dist/devices/midi-effects/ZeitgeistDeviceBoxAdapter.js +32 -19
- package/dist/editing/UserEditing.js +33 -20
- package/dist/editing/UserEditingManager.js +28 -15
- package/dist/factories/AudioBusFactory.d.ts +7 -0
- package/dist/factories/AudioBusFactory.d.ts.map +1 -0
- package/dist/factories/AudioBusFactory.js +29 -0
- package/dist/factories/AudioUnitFactory.d.ts +13 -0
- package/dist/factories/AudioUnitFactory.d.ts.map +1 -0
- package/dist/factories/AudioUnitFactory.js +44 -0
- package/dist/factories/AudioUnitOrdering.d.ts +3 -0
- package/dist/factories/AudioUnitOrdering.d.ts.map +1 -0
- package/dist/factories/AudioUnitOrdering.js +7 -0
- package/dist/factories/ColorCodes.d.ts +7 -0
- package/dist/factories/ColorCodes.d.ts.map +1 -0
- package/dist/factories/ColorCodes.js +32 -0
- package/dist/factories/Colors.d.ts +15 -0
- package/dist/factories/Colors.d.ts.map +1 -0
- package/dist/factories/Colors.js +23 -0
- package/dist/factories/InstrumentBox.d.ts +3 -0
- package/dist/factories/InstrumentBox.d.ts.map +1 -0
- package/dist/factories/InstrumentBox.js +1 -0
- package/dist/factories/InstrumentFactories.d.ts +34 -0
- package/dist/factories/InstrumentFactories.d.ts.map +1 -0
- package/dist/factories/InstrumentFactories.js +137 -0
- package/dist/factories/InstrumentFactory.d.ts +13 -0
- package/dist/factories/InstrumentFactory.d.ts.map +1 -0
- package/dist/factories/InstrumentFactory.js +1 -0
- package/dist/factories/InstrumentOptions.d.ts +9 -0
- package/dist/factories/InstrumentOptions.d.ts.map +1 -0
- package/dist/factories/InstrumentOptions.js +1 -0
- package/dist/factories/InstrumentProduct.d.ts +8 -0
- package/dist/factories/InstrumentProduct.d.ts.map +1 -0
- package/dist/factories/InstrumentProduct.js +1 -0
- package/dist/grooves/GrooveShuffleBoxAdapter.js +47 -35
- package/dist/index.d.ts +20 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -3
- package/dist/modular/abstract.js +37 -24
- package/dist/modular/connection.js +20 -7
- package/dist/modular/connector.js +29 -16
- package/dist/modular/modular.js +49 -36
- package/dist/modular/modules/audio-input.js +17 -4
- package/dist/modular/modules/audio-output.js +17 -4
- package/dist/modular/modules/delay.js +24 -11
- package/dist/modular/modules/gain.js +24 -11
- package/dist/modular/modules/multiplier.js +21 -8
- package/dist/modular/user-interface.js +25 -12
- package/dist/preset/PresetDecoder.d.ts +11 -0
- package/dist/preset/PresetDecoder.d.ts.map +1 -0
- package/dist/preset/PresetDecoder.js +154 -0
- package/dist/preset/PresetEncoder.d.ts +5 -0
- package/dist/preset/PresetEncoder.d.ts.map +1 -0
- package/dist/preset/PresetEncoder.js +19 -0
- package/dist/preset/PresetHeader.d.ts +5 -0
- package/dist/preset/PresetHeader.d.ts.map +1 -0
- package/dist/preset/PresetHeader.js +5 -0
- package/dist/project/ProjectQueries.d.ts +5 -0
- package/dist/project/ProjectQueries.d.ts.map +1 -0
- package/dist/project/ProjectQueries.js +10 -0
- package/dist/project/ProjectSkeleton.d.ts +10 -1
- package/dist/project/ProjectSkeleton.d.ts.map +1 -1
- package/dist/project/ProjectSkeleton.js +100 -1
- package/dist/project/ProjectUtils.d.ts +13 -0
- package/dist/project/ProjectUtils.d.ts.map +1 -0
- package/dist/project/ProjectUtils.js +142 -0
- package/dist/protocols.d.ts.map +1 -1
- package/dist/selection/FilteredSelection.js +47 -34
- package/dist/selection/VertexSelection.js +66 -55
- package/dist/soundfont/SoundfontFileBoxAdapter.js +21 -8
- package/dist/timeline/MarkerBoxAdapter.js +33 -20
- package/dist/timeline/MarkerTrackAdapter.js +34 -22
- package/dist/timeline/TimelineBoxAdapter.js +24 -11
- package/dist/timeline/TrackBoxAdapter.d.ts.map +1 -1
- package/dist/timeline/TrackBoxAdapter.js +97 -85
- package/dist/timeline/TrackClips.js +27 -14
- package/dist/timeline/TrackRegions.js +40 -27
- package/dist/timeline/TrackType.d.ts +1 -1
- package/dist/timeline/TrackType.d.ts.map +1 -1
- package/dist/timeline/TrackType.js +1 -1
- package/dist/timeline/clip/AudioClipBoxAdapter.js +66 -53
- package/dist/timeline/clip/NoteClipBoxAdapter.js +66 -53
- package/dist/timeline/clip/ValueClipBoxAdapter.js +67 -54
- package/dist/timeline/collection/NoteEventCollectionBoxAdapter.js +85 -73
- package/dist/timeline/collection/ValueEventCollectionBoxAdapter.js +53 -40
- package/dist/timeline/event/NoteEventBoxAdapter.js +43 -30
- package/dist/timeline/event/ValueEventBoxAdapter.js +67 -54
- package/dist/timeline/region/AudioRegionBoxAdapter.d.ts +17 -9
- package/dist/timeline/region/AudioRegionBoxAdapter.d.ts.map +1 -1
- package/dist/timeline/region/AudioRegionBoxAdapter.js +149 -83
- package/dist/timeline/region/MutableRegion.d.ts +8 -0
- package/dist/timeline/region/MutableRegion.d.ts.map +1 -0
- package/dist/timeline/region/MutableRegion.js +1 -0
- package/dist/timeline/region/NoteRegionBoxAdapter.d.ts +6 -1
- package/dist/timeline/region/NoteRegionBoxAdapter.d.ts.map +1 -1
- package/dist/timeline/region/NoteRegionBoxAdapter.js +78 -61
- package/dist/timeline/region/ValueRegionBoxAdapter.d.ts +6 -1
- package/dist/timeline/region/ValueRegionBoxAdapter.d.ts.map +1 -1
- package/dist/timeline/region/ValueRegionBoxAdapter.js +79 -62
- package/package.json +8 -8
- package/dist/IconSymbol.d.ts +0 -126
- package/dist/IconSymbol.d.ts.map +0 -1
- package/dist/IconSymbol.js +0 -126
- package/dist/UpdateClockRate.d.ts +0 -2
- package/dist/UpdateClockRate.d.ts.map +0 -1
- package/dist/UpdateClockRate.js +0 -2
- package/dist/project/ProjectDecoder.d.ts +0 -10
- package/dist/project/ProjectDecoder.d.ts.map +0 -1
- package/dist/project/ProjectDecoder.js +0 -36
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _ValueEventCollectionBoxAdapter_instances, _ValueEventCollectionBoxAdapter_terminator, _ValueEventCollectionBoxAdapter_context, _ValueEventCollectionBoxAdapter_box, _ValueEventCollectionBoxAdapter_changeNotifier, _ValueEventCollectionBoxAdapter_adapters, _ValueEventCollectionBoxAdapter_events, _ValueEventCollectionBoxAdapter_onEventsChanged;
|
|
1
13
|
import { ValueEventBox, ValueEventCollectionBox } from "@opendaw/studio-boxes";
|
|
2
14
|
import { asDefined, Curve, linear, Notifier, Option, panic, Terminator, UUID } from "@opendaw/lib-std";
|
|
3
15
|
import { EventCollection, Interpolation, ValueEvent } from "@opendaw/lib-dsp";
|
|
@@ -5,46 +17,47 @@ import { Pointers } from "@opendaw/studio-enums";
|
|
|
5
17
|
import { ValueEventBoxAdapter } from "../event/ValueEventBoxAdapter";
|
|
6
18
|
import { InterpolationFieldAdapter } from "../event/InterpolationFieldAdapter";
|
|
7
19
|
export class ValueEventCollectionBoxAdapter {
|
|
8
|
-
#terminator = new Terminator();
|
|
9
|
-
#context;
|
|
10
|
-
#box;
|
|
11
|
-
#changeNotifier;
|
|
12
|
-
#adapters;
|
|
13
|
-
#events;
|
|
14
20
|
constructor(context, box) {
|
|
15
|
-
this
|
|
16
|
-
this
|
|
17
|
-
this
|
|
18
|
-
|
|
19
|
-
this
|
|
21
|
+
_ValueEventCollectionBoxAdapter_instances.add(this);
|
|
22
|
+
_ValueEventCollectionBoxAdapter_terminator.set(this, new Terminator());
|
|
23
|
+
_ValueEventCollectionBoxAdapter_context.set(this, void 0);
|
|
24
|
+
_ValueEventCollectionBoxAdapter_box.set(this, void 0);
|
|
25
|
+
_ValueEventCollectionBoxAdapter_changeNotifier.set(this, void 0);
|
|
26
|
+
_ValueEventCollectionBoxAdapter_adapters.set(this, void 0);
|
|
27
|
+
_ValueEventCollectionBoxAdapter_events.set(this, void 0);
|
|
28
|
+
__classPrivateFieldSet(this, _ValueEventCollectionBoxAdapter_context, context, "f");
|
|
29
|
+
__classPrivateFieldSet(this, _ValueEventCollectionBoxAdapter_box, box, "f");
|
|
30
|
+
__classPrivateFieldSet(this, _ValueEventCollectionBoxAdapter_changeNotifier, new Notifier(), "f");
|
|
31
|
+
__classPrivateFieldSet(this, _ValueEventCollectionBoxAdapter_adapters, UUID.newSet(adapter => adapter.uuid), "f");
|
|
32
|
+
__classPrivateFieldSet(this, _ValueEventCollectionBoxAdapter_events, EventCollection.create(ValueEventBoxAdapter.Comparator), "f");
|
|
20
33
|
const addValueProcedure = (box) => {
|
|
21
34
|
const adapter = asDefined(box.accept({
|
|
22
|
-
visitValueEventBox: (box) => this
|
|
35
|
+
visitValueEventBox: (box) => __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_context, "f").boxAdapters.adapterFor(box, ValueEventBoxAdapter)
|
|
23
36
|
}), `Could not find adapter for ${box}`);
|
|
24
|
-
if (this
|
|
25
|
-
this
|
|
26
|
-
this
|
|
37
|
+
if (__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_adapters, "f").add(adapter)) {
|
|
38
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_events, "f").add(adapter);
|
|
39
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_instances, "m", _ValueEventCollectionBoxAdapter_onEventsChanged).call(this);
|
|
27
40
|
}
|
|
28
41
|
};
|
|
29
|
-
this
|
|
30
|
-
this
|
|
42
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").events.pointerHub.incoming().forEach(({ box }) => addValueProcedure(box));
|
|
43
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_terminator, "f").own(__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").events.pointerHub.subscribe({
|
|
31
44
|
onAdded: ({ box }) => addValueProcedure(box),
|
|
32
45
|
onRemoved: ({ box: { address: { uuid } } }) => {
|
|
33
|
-
this
|
|
34
|
-
this
|
|
46
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_events, "f").remove(__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_adapters, "f").removeByKey(uuid));
|
|
47
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_instances, "m", _ValueEventCollectionBoxAdapter_onEventsChanged).call(this);
|
|
35
48
|
}
|
|
36
49
|
}));
|
|
37
|
-
this
|
|
38
|
-
onAdded: () => this
|
|
39
|
-
onRemoved: () => this
|
|
50
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_terminator, "f").own(__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").owners.pointerHub.subscribe({
|
|
51
|
+
onAdded: () => __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_changeNotifier, "f").notify(this),
|
|
52
|
+
onRemoved: () => __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_changeNotifier, "f").notify(this)
|
|
40
53
|
}));
|
|
41
54
|
}
|
|
42
|
-
valueAt(position, fallback) { return ValueEvent.valueAt(this
|
|
55
|
+
valueAt(position, fallback) { return ValueEvent.valueAt(__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_events, "f"), position, fallback); }
|
|
43
56
|
copy() {
|
|
44
|
-
const graph = this
|
|
57
|
+
const graph = __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_context, "f").boxGraph;
|
|
45
58
|
const boxCopy = ValueEventCollectionBox.create(graph, UUID.generate());
|
|
46
|
-
this
|
|
47
|
-
return this
|
|
59
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_events, "f").asArray().forEach(source => source.copyTo({ events: boxCopy.events }));
|
|
60
|
+
return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_context, "f").boxAdapters.adapterFor(boxCopy, ValueEventCollectionBoxAdapter);
|
|
48
61
|
}
|
|
49
62
|
cut(position) {
|
|
50
63
|
const low = this.events.lowerEqual(position);
|
|
@@ -112,28 +125,28 @@ export class ValueEventCollectionBoxAdapter {
|
|
|
112
125
|
}
|
|
113
126
|
return panic("Unknown interpolation type");
|
|
114
127
|
}
|
|
115
|
-
subscribeChange(observer) { return this
|
|
128
|
+
subscribeChange(observer) { return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_changeNotifier, "f").subscribe(observer); }
|
|
116
129
|
createEvent({ position, index, value, interpolation }) {
|
|
117
|
-
const eventBox = ValueEventBox.create(this
|
|
130
|
+
const eventBox = ValueEventBox.create(__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_context, "f").boxGraph, UUID.generate(), box => {
|
|
118
131
|
box.position.setValue(position);
|
|
119
132
|
box.index.setValue(index);
|
|
120
133
|
box.value.setValue(value);
|
|
121
|
-
box.events.refer(this
|
|
134
|
+
box.events.refer(__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").events);
|
|
122
135
|
});
|
|
123
136
|
InterpolationFieldAdapter.write(eventBox.interpolation, interpolation);
|
|
124
|
-
return this
|
|
137
|
+
return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_context, "f").boxAdapters.adapterFor(eventBox, ValueEventBoxAdapter);
|
|
125
138
|
}
|
|
126
139
|
requestSorting() {
|
|
127
|
-
this
|
|
140
|
+
__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_events, "f").onIndexingChanged();
|
|
128
141
|
this.onEventPropertyChanged();
|
|
129
142
|
}
|
|
130
|
-
onEventPropertyChanged() { this
|
|
131
|
-
terminate() { this
|
|
132
|
-
get box() { return this
|
|
133
|
-
get uuid() { return this
|
|
134
|
-
get address() { return this
|
|
135
|
-
get numOwners() { return this
|
|
136
|
-
get events() { return this
|
|
137
|
-
toString() { return `{ValueEventCollectionBox ${UUID.toString(this
|
|
138
|
-
#onEventsChanged() { this.#changeNotifier.notify(this); }
|
|
143
|
+
onEventPropertyChanged() { __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_instances, "m", _ValueEventCollectionBoxAdapter_onEventsChanged).call(this); }
|
|
144
|
+
terminate() { __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_terminator, "f").terminate(); }
|
|
145
|
+
get box() { return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f"); }
|
|
146
|
+
get uuid() { return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").address.uuid; }
|
|
147
|
+
get address() { return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").address; }
|
|
148
|
+
get numOwners() { return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").owners.pointerHub.filter(Pointers.ValueEventCollection).length; }
|
|
149
|
+
get events() { return __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_events, "f"); }
|
|
150
|
+
toString() { return `{ValueEventCollectionBox ${UUID.toString(__classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_box, "f").address.uuid)}}`; }
|
|
139
151
|
}
|
|
152
|
+
_ValueEventCollectionBoxAdapter_terminator = new WeakMap(), _ValueEventCollectionBoxAdapter_context = new WeakMap(), _ValueEventCollectionBoxAdapter_box = new WeakMap(), _ValueEventCollectionBoxAdapter_changeNotifier = new WeakMap(), _ValueEventCollectionBoxAdapter_adapters = new WeakMap(), _ValueEventCollectionBoxAdapter_events = new WeakMap(), _ValueEventCollectionBoxAdapter_instances = new WeakSet(), _ValueEventCollectionBoxAdapter_onEventsChanged = function _ValueEventCollectionBoxAdapter_onEventsChanged() { __classPrivateFieldGet(this, _ValueEventCollectionBoxAdapter_changeNotifier, "f").notify(this); };
|
|
@@ -1,26 +1,38 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _NoteEventBoxAdapter_context, _NoteEventBoxAdapter_box, _NoteEventBoxAdapter_subscription, _NoteEventBoxAdapter_isSelected;
|
|
1
13
|
import { NoteEvent } from "@opendaw/lib-dsp";
|
|
2
14
|
import { Arrays, UUID } from "@opendaw/lib-std";
|
|
3
15
|
import { NoteEventBox } from "@opendaw/studio-boxes";
|
|
4
16
|
import { Propagation } from "@opendaw/lib-box";
|
|
5
17
|
import { NoteEventCollectionBoxAdapter } from "../collection/NoteEventCollectionBoxAdapter";
|
|
6
18
|
export class NoteEventBoxAdapter {
|
|
7
|
-
type = "note-event";
|
|
8
|
-
#context;
|
|
9
|
-
#box;
|
|
10
|
-
#subscription;
|
|
11
|
-
#isSelected = false;
|
|
12
19
|
constructor(context, box) {
|
|
13
|
-
this
|
|
14
|
-
this
|
|
15
|
-
|
|
20
|
+
this.type = "note-event";
|
|
21
|
+
_NoteEventBoxAdapter_context.set(this, void 0);
|
|
22
|
+
_NoteEventBoxAdapter_box.set(this, void 0);
|
|
23
|
+
_NoteEventBoxAdapter_subscription.set(this, void 0);
|
|
24
|
+
_NoteEventBoxAdapter_isSelected.set(this, false);
|
|
25
|
+
__classPrivateFieldSet(this, _NoteEventBoxAdapter_context, context, "f");
|
|
26
|
+
__classPrivateFieldSet(this, _NoteEventBoxAdapter_box, box, "f");
|
|
27
|
+
__classPrivateFieldSet(this, _NoteEventBoxAdapter_subscription, __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").subscribe(Propagation.Children, (update) => {
|
|
16
28
|
if (this.collection.isEmpty()) {
|
|
17
29
|
return;
|
|
18
30
|
}
|
|
19
31
|
if (update.type === "primitive" || update.type === "pointer") {
|
|
20
32
|
const collection = this.collection.unwrap();
|
|
21
33
|
const updatedFieldKeys = update.address.fieldKeys;
|
|
22
|
-
const pitchChanged = Arrays.equals(this
|
|
23
|
-
const positionChanged = Arrays.equals(this
|
|
34
|
+
const pitchChanged = Arrays.equals(__classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").pitch.address.fieldKeys, updatedFieldKeys);
|
|
35
|
+
const positionChanged = Arrays.equals(__classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").position.address.fieldKeys, updatedFieldKeys);
|
|
24
36
|
if (pitchChanged || positionChanged) {
|
|
25
37
|
collection.requestSorting();
|
|
26
38
|
}
|
|
@@ -28,33 +40,33 @@ export class NoteEventBoxAdapter {
|
|
|
28
40
|
collection.onEventPropertyChanged();
|
|
29
41
|
}
|
|
30
42
|
}
|
|
31
|
-
});
|
|
43
|
+
}), "f");
|
|
32
44
|
}
|
|
33
45
|
onSelected() {
|
|
34
|
-
this
|
|
46
|
+
__classPrivateFieldSet(this, _NoteEventBoxAdapter_isSelected, true, "f");
|
|
35
47
|
this.collection.ifSome(region => region.onEventPropertyChanged());
|
|
36
48
|
}
|
|
37
49
|
onDeselected() {
|
|
38
|
-
this
|
|
50
|
+
__classPrivateFieldSet(this, _NoteEventBoxAdapter_isSelected, false, "f");
|
|
39
51
|
this.collection.ifSome(region => region.onEventPropertyChanged());
|
|
40
52
|
}
|
|
41
|
-
terminate() { this
|
|
42
|
-
get box() { return this
|
|
43
|
-
get uuid() { return this
|
|
44
|
-
get address() { return this
|
|
45
|
-
get position() { return this
|
|
46
|
-
get duration() { return this
|
|
53
|
+
terminate() { __classPrivateFieldGet(this, _NoteEventBoxAdapter_subscription, "f").terminate(); }
|
|
54
|
+
get box() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f"); }
|
|
55
|
+
get uuid() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").address.uuid; }
|
|
56
|
+
get address() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").address; }
|
|
57
|
+
get position() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").position.getValue(); }
|
|
58
|
+
get duration() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").duration.getValue(); }
|
|
47
59
|
get complete() { return this.position + this.duration; }
|
|
48
|
-
get velocity() { return this
|
|
49
|
-
get pitch() { return this
|
|
50
|
-
get cent() { return this
|
|
51
|
-
get chance() { return this
|
|
52
|
-
get playCount() { return this
|
|
53
|
-
get playCurve() { return this
|
|
54
|
-
get isSelected() { return this
|
|
60
|
+
get velocity() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").velocity.getValue(); } // 0.0...1.0
|
|
61
|
+
get pitch() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").pitch.getValue(); } // 0...127
|
|
62
|
+
get cent() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").cent.getValue(); } // -50.0...+50.0
|
|
63
|
+
get chance() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").chance.getValue(); } // 0...100%
|
|
64
|
+
get playCount() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").playCount.getValue(); } // 1...16
|
|
65
|
+
get playCurve() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").playCurve.getValue(); } // -1...+1
|
|
66
|
+
get isSelected() { return __classPrivateFieldGet(this, _NoteEventBoxAdapter_isSelected, "f"); }
|
|
55
67
|
get collection() {
|
|
56
|
-
return this
|
|
57
|
-
.map(vertex => this
|
|
68
|
+
return __classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").events.targetVertex
|
|
69
|
+
.map(vertex => __classPrivateFieldGet(this, _NoteEventBoxAdapter_context, "f").boxAdapters.adapterFor(vertex.box, NoteEventCollectionBoxAdapter));
|
|
58
70
|
}
|
|
59
71
|
normalizedPitch() {
|
|
60
72
|
if (this.collection.isEmpty()) {
|
|
@@ -74,7 +86,7 @@ export class NoteEventBoxAdapter {
|
|
|
74
86
|
};
|
|
75
87
|
}
|
|
76
88
|
copyTo(options) {
|
|
77
|
-
return this
|
|
89
|
+
return __classPrivateFieldGet(this, _NoteEventBoxAdapter_context, "f").boxAdapters.adapterFor(NoteEventBox.create(__classPrivateFieldGet(this, _NoteEventBoxAdapter_context, "f").boxGraph, UUID.generate(), box => {
|
|
78
90
|
box.position.setValue(options?.position ?? this.position);
|
|
79
91
|
box.duration.setValue(options?.duration ?? this.duration);
|
|
80
92
|
box.pitch.setValue(options?.pitch ?? this.pitch);
|
|
@@ -100,7 +112,8 @@ export class NoteEventBoxAdapter {
|
|
|
100
112
|
events
|
|
101
113
|
});
|
|
102
114
|
}, playCount);
|
|
103
|
-
this
|
|
115
|
+
__classPrivateFieldGet(this, _NoteEventBoxAdapter_box, "f").delete();
|
|
104
116
|
return adapters;
|
|
105
117
|
}
|
|
106
118
|
}
|
|
119
|
+
_NoteEventBoxAdapter_context = new WeakMap(), _NoteEventBoxAdapter_box = new WeakMap(), _NoteEventBoxAdapter_subscription = new WeakMap(), _NoteEventBoxAdapter_isSelected = new WeakMap();
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _ValueEventBoxAdapter_terminator, _ValueEventBoxAdapter_context, _ValueEventBoxAdapter_box, _ValueEventBoxAdapter_interpolation, _ValueEventBoxAdapter_interpolationSubscription, _ValueEventBoxAdapter_isSelected;
|
|
1
13
|
import { Arrays, Cache, Terminable, Terminator, UUID } from "@opendaw/lib-std";
|
|
2
14
|
import { Propagation } from "@opendaw/lib-box";
|
|
3
15
|
import { Pointers } from "@opendaw/studio-enums";
|
|
@@ -5,41 +17,30 @@ import { ValueEventBox } from "@opendaw/studio-boxes";
|
|
|
5
17
|
import { ValueEventCollectionBoxAdapter } from "../collection/ValueEventCollectionBoxAdapter";
|
|
6
18
|
import { InterpolationFieldAdapter } from "./InterpolationFieldAdapter";
|
|
7
19
|
export class ValueEventBoxAdapter {
|
|
8
|
-
static Comparator = (a, b) => {
|
|
9
|
-
const positionDiff = a.position - b.position;
|
|
10
|
-
if (positionDiff !== 0) {
|
|
11
|
-
return positionDiff;
|
|
12
|
-
}
|
|
13
|
-
const indexDiff = a.index - b.index;
|
|
14
|
-
if (indexDiff !== 0) {
|
|
15
|
-
return indexDiff;
|
|
16
|
-
}
|
|
17
|
-
throw new Error(`${a} and ${b} are identical in terms of comparison`);
|
|
18
|
-
};
|
|
19
|
-
type = "value-event";
|
|
20
|
-
#terminator = new Terminator();
|
|
21
|
-
#context;
|
|
22
|
-
#box;
|
|
23
|
-
#interpolation;
|
|
24
|
-
#interpolationSubscription;
|
|
25
|
-
#isSelected = false;
|
|
26
20
|
constructor(context, box) {
|
|
27
|
-
this
|
|
28
|
-
this
|
|
29
|
-
|
|
21
|
+
this.type = "value-event";
|
|
22
|
+
_ValueEventBoxAdapter_terminator.set(this, new Terminator());
|
|
23
|
+
_ValueEventBoxAdapter_context.set(this, void 0);
|
|
24
|
+
_ValueEventBoxAdapter_box.set(this, void 0);
|
|
25
|
+
_ValueEventBoxAdapter_interpolation.set(this, void 0);
|
|
26
|
+
_ValueEventBoxAdapter_interpolationSubscription.set(this, void 0);
|
|
27
|
+
_ValueEventBoxAdapter_isSelected.set(this, false);
|
|
28
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_context, context, "f");
|
|
29
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_box, box, "f");
|
|
30
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_interpolation, __classPrivateFieldGet(this, _ValueEventBoxAdapter_terminator, "f").own(new Cache(() => InterpolationFieldAdapter.read(__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").interpolation))), "f");
|
|
30
31
|
const invalidateInterpolation = () => {
|
|
31
|
-
this
|
|
32
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_interpolation, "f").invalidate();
|
|
32
33
|
this.collection.ifSome(collection => collection.onEventPropertyChanged());
|
|
33
34
|
};
|
|
34
|
-
this
|
|
35
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_terminator, "f").ownAll(__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").subscribe(Propagation.Children, (update) => {
|
|
35
36
|
if (this.collection.isEmpty()) {
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
if (update.type === "primitive" || update.type === "pointer") {
|
|
39
40
|
const collection = this.collection.unwrap();
|
|
40
41
|
const updatedFieldKeys = update.address.fieldKeys;
|
|
41
|
-
const indexChanged = Arrays.equals(this
|
|
42
|
-
const positionChanged = Arrays.equals(this
|
|
42
|
+
const indexChanged = Arrays.equals(__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").index.address.fieldKeys, updatedFieldKeys);
|
|
43
|
+
const positionChanged = Arrays.equals(__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").position.address.fieldKeys, updatedFieldKeys);
|
|
43
44
|
if (indexChanged || positionChanged) {
|
|
44
45
|
collection.requestSorting();
|
|
45
46
|
}
|
|
@@ -47,66 +48,78 @@ export class ValueEventBoxAdapter {
|
|
|
47
48
|
collection.onEventPropertyChanged();
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
|
-
}), this
|
|
51
|
+
}), __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").interpolation.subscribe(invalidateInterpolation), __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").interpolation.pointerHub.subscribe({
|
|
51
52
|
onAdded: ({ box }) => {
|
|
52
|
-
this
|
|
53
|
-
this
|
|
53
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_interpolationSubscription, "f").terminate();
|
|
54
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_interpolationSubscription, box.subscribe(Propagation.Children, invalidateInterpolation), "f");
|
|
54
55
|
invalidateInterpolation();
|
|
55
56
|
},
|
|
56
57
|
onRemoved: () => {
|
|
57
|
-
this
|
|
58
|
-
this
|
|
58
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_interpolationSubscription, "f").terminate();
|
|
59
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_interpolationSubscription, Terminable.Empty, "f");
|
|
59
60
|
invalidateInterpolation();
|
|
60
61
|
}
|
|
61
62
|
}));
|
|
62
|
-
this
|
|
63
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_interpolationSubscription, __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").interpolation.pointerHub
|
|
63
64
|
.filter(Pointers.ValueInterpolation)
|
|
64
65
|
.at(0)?.box
|
|
65
66
|
.subscribe(Propagation.Children, invalidateInterpolation)
|
|
66
|
-
?? Terminable.Empty;
|
|
67
|
+
?? Terminable.Empty, "f");
|
|
67
68
|
}
|
|
68
69
|
onSelected() {
|
|
69
|
-
this
|
|
70
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_isSelected, true, "f");
|
|
70
71
|
this.collection.ifSome(region => region.onEventPropertyChanged());
|
|
71
72
|
}
|
|
72
73
|
onDeselected() {
|
|
73
|
-
this
|
|
74
|
+
__classPrivateFieldSet(this, _ValueEventBoxAdapter_isSelected, false, "f");
|
|
74
75
|
this.collection.ifSome(region => region.onEventPropertyChanged());
|
|
75
76
|
}
|
|
76
77
|
terminate() {
|
|
77
|
-
this
|
|
78
|
-
this
|
|
78
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_interpolationSubscription, "f").terminate();
|
|
79
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_terminator, "f").terminate();
|
|
79
80
|
}
|
|
80
|
-
get box() { return this
|
|
81
|
-
get uuid() { return this
|
|
82
|
-
get address() { return this
|
|
83
|
-
get position() { return this
|
|
84
|
-
get index() { return this
|
|
85
|
-
set interpolation(value) { InterpolationFieldAdapter.write(this
|
|
86
|
-
get interpolation() { return this
|
|
87
|
-
get value() { return this
|
|
88
|
-
get isSelected() { return this
|
|
81
|
+
get box() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f"); }
|
|
82
|
+
get uuid() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").address.uuid; }
|
|
83
|
+
get address() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").address; }
|
|
84
|
+
get position() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").position.getValue(); }
|
|
85
|
+
get index() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").index.getValue(); }
|
|
86
|
+
set interpolation(value) { InterpolationFieldAdapter.write(__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").interpolation, value); }
|
|
87
|
+
get interpolation() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_interpolation, "f").get(); }
|
|
88
|
+
get value() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").value.getValue(); }
|
|
89
|
+
get isSelected() { return __classPrivateFieldGet(this, _ValueEventBoxAdapter_isSelected, "f"); }
|
|
89
90
|
get collection() {
|
|
90
|
-
return this
|
|
91
|
-
.map(vertex => this
|
|
91
|
+
return __classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").events.targetVertex
|
|
92
|
+
.map(vertex => __classPrivateFieldGet(this, _ValueEventBoxAdapter_context, "f").boxAdapters.adapterFor(vertex.box, ValueEventCollectionBoxAdapter));
|
|
92
93
|
}
|
|
93
94
|
copyTo(options) {
|
|
94
|
-
const eventBox = ValueEventBox.create(this
|
|
95
|
+
const eventBox = ValueEventBox.create(__classPrivateFieldGet(this, _ValueEventBoxAdapter_context, "f").boxGraph, UUID.generate(), box => {
|
|
95
96
|
box.position.setValue(options?.position ?? this.position);
|
|
96
97
|
box.index.setValue(options?.index ?? this.index);
|
|
97
98
|
box.events.refer(options?.events ?? this.collection.unwrap().box.events);
|
|
98
99
|
box.value.setValue(options?.value ?? this.value);
|
|
99
100
|
});
|
|
100
101
|
InterpolationFieldAdapter.write(eventBox.interpolation, options?.interpolation ?? this.interpolation);
|
|
101
|
-
return this
|
|
102
|
+
return __classPrivateFieldGet(this, _ValueEventBoxAdapter_context, "f").boxAdapters.adapterFor(eventBox, ValueEventBoxAdapter);
|
|
102
103
|
}
|
|
103
104
|
copyFrom(options) {
|
|
104
|
-
this
|
|
105
|
-
this
|
|
106
|
-
this
|
|
107
|
-
this
|
|
108
|
-
InterpolationFieldAdapter.write(this
|
|
105
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").position.setValue(options?.position ?? this.position);
|
|
106
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").index.setValue(options?.index ?? this.index);
|
|
107
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").events.refer(options?.events ?? this.collection.unwrap().box.events);
|
|
108
|
+
__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").value.setValue(options?.value ?? this.value);
|
|
109
|
+
InterpolationFieldAdapter.write(__classPrivateFieldGet(this, _ValueEventBoxAdapter_box, "f").interpolation, options?.interpolation ?? this.interpolation);
|
|
109
110
|
return this;
|
|
110
111
|
}
|
|
111
112
|
toString() { return `{ValueEventBoxAdapter position: ${this.position} index: ${this.index}}`; }
|
|
112
113
|
}
|
|
114
|
+
_ValueEventBoxAdapter_terminator = new WeakMap(), _ValueEventBoxAdapter_context = new WeakMap(), _ValueEventBoxAdapter_box = new WeakMap(), _ValueEventBoxAdapter_interpolation = new WeakMap(), _ValueEventBoxAdapter_interpolationSubscription = new WeakMap(), _ValueEventBoxAdapter_isSelected = new WeakMap();
|
|
115
|
+
ValueEventBoxAdapter.Comparator = (a, b) => {
|
|
116
|
+
const positionDiff = a.position - b.position;
|
|
117
|
+
if (positionDiff !== 0) {
|
|
118
|
+
return positionDiff;
|
|
119
|
+
}
|
|
120
|
+
const indexDiff = a.index - b.index;
|
|
121
|
+
if (indexDiff !== 0) {
|
|
122
|
+
return indexDiff;
|
|
123
|
+
}
|
|
124
|
+
throw new Error(`${a} and ${b} are identical in terms of comparison`);
|
|
125
|
+
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { AudioRegionBox } from "@opendaw/studio-boxes";
|
|
2
1
|
import { int, Maybe, Observer, Option, Subscription, UUID } from "@opendaw/lib-std";
|
|
3
|
-
import {
|
|
2
|
+
import { ppqn, TimeBase } from "@opendaw/lib-dsp";
|
|
4
3
|
import { Address, Field } from "@opendaw/lib-box";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { AudioPlayback, Pointers } from "@opendaw/studio-enums";
|
|
5
|
+
import { AudioRegionBox } from "@opendaw/studio-boxes";
|
|
7
6
|
import { LoopableRegionBoxAdapter, RegionBoxAdapter, RegionBoxAdapterVisitor } from "../RegionBoxAdapter";
|
|
7
|
+
import { TrackBoxAdapter } from "../TrackBoxAdapter";
|
|
8
8
|
import { BoxAdaptersContext } from "../../BoxAdaptersContext";
|
|
9
9
|
import { AudioFileBoxAdapter } from "../../audio/AudioFileBoxAdapter";
|
|
10
|
+
import { MutableRegion } from "./MutableRegion";
|
|
10
11
|
type CopyToParams = {
|
|
11
12
|
track?: Field<Pointers.RegionCollection>;
|
|
12
13
|
position?: ppqn;
|
|
@@ -14,7 +15,7 @@ type CopyToParams = {
|
|
|
14
15
|
loopOffset?: ppqn;
|
|
15
16
|
loopDuration?: ppqn;
|
|
16
17
|
};
|
|
17
|
-
export declare class AudioRegionBoxAdapter implements LoopableRegionBoxAdapter<never
|
|
18
|
+
export declare class AudioRegionBoxAdapter implements LoopableRegionBoxAdapter<never>, MutableRegion {
|
|
18
19
|
#private;
|
|
19
20
|
readonly type = "audio-region";
|
|
20
21
|
constructor(context: BoxAdaptersContext, box: AudioRegionBox);
|
|
@@ -23,13 +24,12 @@ export declare class AudioRegionBoxAdapter implements LoopableRegionBoxAdapter<n
|
|
|
23
24
|
onSelected(): void;
|
|
24
25
|
onDeselected(): void;
|
|
25
26
|
get isSelected(): boolean;
|
|
26
|
-
terminate(): void;
|
|
27
27
|
get box(): AudioRegionBox;
|
|
28
28
|
get uuid(): UUID.Bytes;
|
|
29
29
|
get address(): Address;
|
|
30
|
-
get position():
|
|
31
|
-
get duration():
|
|
32
|
-
get complete():
|
|
30
|
+
get position(): ppqn;
|
|
31
|
+
get duration(): ppqn;
|
|
32
|
+
get complete(): ppqn;
|
|
33
33
|
get loopOffset(): ppqn;
|
|
34
34
|
get loopDuration(): ppqn;
|
|
35
35
|
get offset(): ppqn;
|
|
@@ -37,16 +37,24 @@ export declare class AudioRegionBoxAdapter implements LoopableRegionBoxAdapter<n
|
|
|
37
37
|
get hue(): int;
|
|
38
38
|
get gain(): number;
|
|
39
39
|
get file(): AudioFileBoxAdapter;
|
|
40
|
+
get timeBase(): TimeBase;
|
|
40
41
|
get hasCollection(): boolean;
|
|
41
42
|
get optCollection(): Option<never>;
|
|
42
43
|
get label(): string;
|
|
43
44
|
get isMirrowed(): boolean;
|
|
44
45
|
get canMirror(): boolean;
|
|
45
46
|
get trackBoxAdapter(): Option<TrackBoxAdapter>;
|
|
47
|
+
set position(value: ppqn);
|
|
48
|
+
set duration(value: ppqn);
|
|
49
|
+
set loopOffset(value: ppqn);
|
|
50
|
+
set loopDuration(value: ppqn);
|
|
51
|
+
get playback(): AudioPlayback;
|
|
52
|
+
setPlayback(value: AudioPlayback, keepCurrentStretch?: boolean): void;
|
|
46
53
|
copyTo(params?: CopyToParams): AudioRegionBoxAdapter;
|
|
47
54
|
consolidate(): void;
|
|
48
55
|
canFlatten(_regions: ReadonlyArray<RegionBoxAdapter<unknown>>): boolean;
|
|
49
56
|
flatten(_regions: ReadonlyArray<RegionBoxAdapter<unknown>>): Option<AudioRegionBox>;
|
|
57
|
+
terminate(): void;
|
|
50
58
|
toString(): string;
|
|
51
59
|
}
|
|
52
60
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AudioRegionBoxAdapter.d.ts","sourceRoot":"","sources":["../../../src/timeline/region/AudioRegionBoxAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AudioRegionBoxAdapter.d.ts","sourceRoot":"","sources":["../../../src/timeline/region/AudioRegionBoxAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,GAAG,EACH,KAAK,EAEL,QAAQ,EACR,MAAM,EAEN,YAAY,EAGZ,IAAI,EACP,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAoB,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAAC,OAAO,EAAE,KAAK,EAAoC,MAAM,kBAAkB,CAAA;AAClF,OAAO,EAAC,aAAa,EAAE,QAAQ,EAAC,MAAM,uBAAuB,CAAA;AAC7D,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAC,wBAAwB,EAAE,gBAAgB,EAAE,uBAAuB,EAAC,MAAM,qBAAqB,CAAA;AACvG,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAA;AAClD,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAA;AAE7C,KAAK,YAAY,GAAG;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAA;IACxC,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,QAAQ,CAAC,EAAE,IAAI,CAAA;IACf,UAAU,CAAC,EAAE,IAAI,CAAA;IACjB,YAAY,CAAC,EAAE,IAAI,CAAA;CACtB,CAAA;AAED,qBAAa,qBACT,YAAW,wBAAwB,CAAC,KAAK,CAAC,EAAE,aAAa;;IACzD,QAAQ,CAAC,IAAI,kBAAiB;gBAmBlB,OAAO,EAAE,kBAAkB,EAAE,GAAG,EAAE,cAAc;IAwD5D,eAAe,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,YAAY;IAEvD,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC;IAIxD,UAAU,IAAI,IAAI;IAKlB,YAAY,IAAI,IAAI;IAKpB,IAAI,UAAU,IAAI,OAAO,CAA0B;IAEnD,IAAI,GAAG,IAAI,cAAc,CAAmB;IAC5C,IAAI,IAAI,IAAI,IAAI,CAAC,KAAK,CAAgC;IACtD,IAAI,OAAO,IAAI,OAAO,CAA2B;IACjD,IAAI,QAAQ,IAAI,IAAI,CAAuC;IAC3D,IAAI,QAAQ,IAAI,IAAI,CAA0C;IAC9D,IAAI,QAAQ,IAAI,IAAI,CAAuC;IAC3D,IAAI,UAAU,IAAI,IAAI,CAA4C;IAClE,IAAI,YAAY,IAAI,IAAI,CAA8C;IACtE,IAAI,MAAM,IAAI,IAAI,CAAyC;IAC3D,IAAI,IAAI,IAAI,OAAO,CAAmC;IACtD,IAAI,GAAG,IAAI,GAAG,CAAkC;IAChD,IAAI,IAAI,IAAI,MAAM,CAAmC;IACrD,IAAI,IAAI,IAAI,mBAAmB,CAAyD;IACxF,IAAI,QAAQ,IAAI,QAAQ,CAA8D;IACtF,IAAI,aAAa,YAAwC;IACzD,IAAI,aAAa,IAAI,MAAM,CAAC,KAAK,CAAC,CAAqB;IACvD,IAAI,KAAK,IAAI,MAAM,CAMlB;IACD,IAAI,UAAU,IAAI,OAAO,CAAe;IACxC,IAAI,SAAS,IAAI,OAAO,CAAe;IACvC,IAAI,eAAe,IAAI,MAAM,CAAC,eAAe,CAAC,CAG7C;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,EAAsC;IAC9D,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,EAA2C;IACnE,IAAI,UAAU,CAAC,KAAK,EAAE,IAAI,EAA6C;IACvE,IAAI,YAAY,CAAC,KAAK,EAAE,IAAI,EAA+C;IAC3E,IAAI,QAAQ,IAAI,aAAa,CAAmE;IAEhG,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,kBAAkB,GAAE,OAAe;IAwCrE,MAAM,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,qBAAqB;IAkBpD,WAAW,IAAI,IAAI;IAGnB,UAAU,CAAC,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO;IACvE,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC;IAKnF,SAAS;IAET,QAAQ,IAAI,MAAM;CAOrB"}
|