var BASIC_ROM = ... $INSERT_BASE64_BASIC_HERE$ ...; var CHAR_ROM = ... $INSERT_BASE64_CHARGEN_HERE$ ...; var KERNAL_ROM = ... $INSERT_BASE64_KERNAL_HERE$ ...;
var playerWrapper = function () { var _ = this; _.webSidBackend = new SIDBackendAdapter(BASIC_ROM, CHAR_ROM, KERNAL_ROM); window.ScriptNodePlayer.createInstance( _.webSidBackend, '', [], false, (function(){}), (function(){}), (function(){}), undefined, undefined, 16384 ); _.webSid = window.ScriptNodePlayer.getInstance(); _.play = function (link, subtune) { if (typeof(subtune) === "undefined") subtune = 0; _.webSid.loadMusicFromURL(link, options, (function(){}), (function(){}), (function(){})); } _.stop = function () { _.webSid.pause(); } }
var player = new playerWrapper(); // play a SID, subtune is optional player.play(url, subtune); // stop a playing SID player.stop();
Not only is subtune optional, it's not even used. :)
var playerWrapper = function () { var _ = this; _.webSidBackend = new SIDBackendAdapter(BASIC_ROM, CHAR_ROM, KERNAL_ROM); window.ScriptNodePlayer.createInstance( _.webSidBackend, '', [], false, (function(){}), (function(){}), (function(){}), undefined, undefined, 16384 ); _.webSid = window.ScriptNodePlayer.getInstance(); _.play = function (link, subtune) { if (typeof(subtune) === "undefined") subtune = 0; var options = { track: subtune }; _.webSid.loadMusicFromURL(link, options, (function(){}), (function(){}), (function(){})); } _.stop = function () { _.webSid.pause(); } }