@waveform-playlist/engine 14.0.0-next.6 → 14.0.0-next.8

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/index.mjs CHANGED
@@ -44,6 +44,11 @@ function calculateSplitPoint(splitSample, samplesPerPixel) {
44
44
  function splitClip(clip, splitSample) {
45
45
  const leftDuration = splitSample - clip.startSample;
46
46
  const rightDuration = clip.durationSamples - leftDuration;
47
+ const midi = {
48
+ midiNotes: clip.midiNotes,
49
+ midiChannel: clip.midiChannel,
50
+ midiProgram: clip.midiProgram
51
+ };
47
52
  const leftName = clip.name ? `${clip.name} (1)` : void 0;
48
53
  const rightName = clip.name ? `${clip.name} (2)` : void 0;
49
54
  const left = {
@@ -59,7 +64,8 @@ function splitClip(clip, splitSample) {
59
64
  fadeIn: clip.fadeIn,
60
65
  audioBuffer: clip.audioBuffer,
61
66
  waveformData: clip.waveformData,
62
- src: clip.src
67
+ src: clip.src,
68
+ ...midi
63
69
  }),
64
70
  id: clip.id
65
71
  };
@@ -75,7 +81,8 @@ function splitClip(clip, splitSample) {
75
81
  fadeOut: clip.fadeOut,
76
82
  audioBuffer: clip.audioBuffer,
77
83
  waveformData: clip.waveformData,
78
- src: clip.src
84
+ src: clip.src,
85
+ ...midi
79
86
  });
80
87
  return { left, right };
81
88
  }
@@ -1179,7 +1186,7 @@ var ArrangementImpl = class {
1179
1186
  }
1180
1187
  /** Be told after every change. See `Arrangement.subscribe`. */
1181
1188
  subscribe(listener) {
1182
- const entry = () => listener();
1189
+ const entry = (change) => listener(change);
1183
1190
  this._subscribers.add(entry);
1184
1191
  return () => {
1185
1192
  this._subscribers.delete(entry);
@@ -1876,9 +1883,10 @@ var ArrangementImpl = class {
1876
1883
  }
1877
1884
  }
1878
1885
  }
1886
+ const info = Object.freeze({ type: next.change.type });
1879
1887
  for (const subscriber of [...this._subscribers]) {
1880
1888
  try {
1881
- subscriber();
1889
+ subscriber(info);
1882
1890
  } catch (error) {
1883
1891
  console.warn("[waveform-playlist] Error in an arrangement subscriber:", error);
1884
1892
  }