Skip to content

Commit 816bb98

Browse files
committed
2.1.4
1 parent 9bbdfd0 commit 816bb98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+105
-110
lines changed

.github/workflows/release-package.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

browser/midiwriter.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var MidiWriter = (function () {
66
* @return {Constants}
77
*/
88
var Constants = {
9-
VERSION: '2.1.3',
9+
VERSION: '2.1.4',
1010
HEADER_CHUNK_TYPE: [0x4d, 0x54, 0x68, 0x64],
1111
// Mthd
1212
HEADER_CHUNK_LENGTH: [0x00, 0x00, 0x00, 0x06],
@@ -1283,6 +1283,12 @@ var MidiWriter = (function () {
12831283
return _this.events.push(e);
12841284
});
12851285
}
1286+
} else if (event instanceof EndTrackEvent) {
1287+
// Only one EndTrackEvent is allowed, so remove
1288+
// any existing ones before adding.
1289+
_this.removeEventsByType('end-track');
1290+
1291+
_this.events.push(event);
12861292
} else {
12871293
_this.events.push(event);
12881294
}
@@ -1301,9 +1307,12 @@ var MidiWriter = (function () {
13011307
var _this2 = this;
13021308

13031309
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1304-
// Remove existing end track event and add one.
1305-
// This makes sure it's at the very end of the event list.
1306-
this.removeEventsByType('end-track').addEvent(new EndTrackEvent()); // Reset
1310+
1311+
// If the last event isn't EndTrackEvent, then tack it onto the data.
1312+
if (!this.events.length || !(this.events[this.events.length - 1] instanceof EndTrackEvent)) {
1313+
this.addEvent(new EndTrackEvent());
1314+
} // Reset
1315+
13071316

13081317
this.data = [];
13091318
this.size = [];
@@ -1384,8 +1393,14 @@ var MidiWriter = (function () {
13841393
}, {
13851394
key: "mergeSingleEvent",
13861395
value: function mergeSingleEvent(event) {
1387-
// Find index of existing event we need to follow with
1388-
var lastEventIndex = 0;
1396+
// There are no events yet, so just add it in.
1397+
if (!this.events.length) {
1398+
this.addEvent(event);
1399+
return;
1400+
} // Find index of existing event we need to follow with
1401+
1402+
1403+
var lastEventIndex;
13891404

13901405
for (var i = 0; i < this.events.length; i++) {
13911406
if (this.events[i].tick > event.tick) break;

docs/ControllerChangeEvent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Returns:</h5>
238238
<br class="clear">
239239

240240
<footer>
241-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
241+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
242242
</footer>
243243

244244
<script>prettyPrint();</script>

docs/CopyrightEvent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Returns:</h5>
238238
<br class="clear">
239239

240240
<footer>
241-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
241+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
242242
</footer>
243243

244244
<script>prettyPrint();</script>

docs/CuePointEvent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Returns:</h5>
238238
<br class="clear">
239239

240240
<footer>
241-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
241+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
242242
</footer>
243243

244244
<script>prettyPrint();</script>

docs/EndTrackEvent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Returns:</h5>
238238
<br class="clear">
239239

240240
<footer>
241-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
241+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
242242
</footer>
243243

244244
<script>prettyPrint();</script>

docs/HeaderChunk.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Returns:</h5>
238238
<br class="clear">
239239

240240
<footer>
241-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
241+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
242242
</footer>
243243

244244
<script>prettyPrint();</script>

docs/InstrumentNameEvent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Returns:</h5>
238238
<br class="clear">
239239

240240
<footer>
241-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
241+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
242242
</footer>
243243

244244
<script>prettyPrint();</script>

docs/KeySignatureEvent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ <h5>Returns:</h5>
186186
<br class="clear">
187187

188188
<footer>
189-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
189+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
190190
</footer>
191191

192192
<script>prettyPrint();</script>

docs/LyricEvent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ <h5>Returns:</h5>
238238
<br class="clear">
239239

240240
<footer>
241-
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Sat Dec 03 2022 13:51:57 GMT-0800 (Pacific Standard Time) using the Minami theme.
241+
Generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.10</a> on Wed Dec 07 2022 23:32:46 GMT-0800 (Pacific Standard Time) using the Minami theme.
242242
</footer>
243243

244244
<script>prettyPrint();</script>

0 commit comments

Comments
 (0)