diff --git a/docs/assets/js/sounds/soundassetmap.js b/docs/assets/js/sounds/soundassetmap.js new file mode 100644 index 0000000..faa51cb --- /dev/null +++ b/docs/assets/js/sounds/soundassetmap.js @@ -0,0 +1,5 @@ + +// A mapping of asset names to their files +let soundAssets = { + +} \ No newline at end of file diff --git a/docs/assets/js/sounds/soundcontext.js b/docs/assets/js/sounds/soundcontext.js new file mode 100644 index 0000000..555b202 --- /dev/null +++ b/docs/assets/js/sounds/soundcontext.js @@ -0,0 +1,27 @@ + +class SoundChannel{ + + /** + * Create a sound channel + * @param {number} max_queue_size Maximum number of sounds that can be queued before sounds are skipped + */ + constructor(max_queue_size) { + this.max_size = max_queue_size + } +} + + +class SoundContext{ + + constructor() { + + // Define all sound channels + this.channels = { + bgm: new SoundChannel(2) + } + } + +} + +// The global context for sounds +let globalSoundContext = new SoundContext(); \ No newline at end of file diff --git a/docs/assets/js/sounds/sounds.js b/docs/assets/js/sounds/sounds.js new file mode 100644 index 0000000..547b678 --- /dev/null +++ b/docs/assets/js/sounds/sounds.js @@ -0,0 +1,13 @@ + +// All available sounds +let sounds = { + +} + +/** + * Cache all sounds in browser, then notify a callback of success + * @param {function} callback Callback for completion + */ +function preCacheSounds(callback) { + +} \ No newline at end of file diff --git a/docs/assets/js/sounds/soundsnippet.js b/docs/assets/js/sounds/soundsnippet.js new file mode 100644 index 0000000..6ee8178 --- /dev/null +++ b/docs/assets/js/sounds/soundsnippet.js @@ -0,0 +1,28 @@ + +class SoundSnippet{ + + /** + * Load a sound asset to a snipper + * @param {string} asset_name Asset name as defined in soundassetmap.js + */ + constructor(asset_name) { + + } + + /** + * Cache this sound, then notify a callback of completion + * @param {function} callback callback to notify + */ + cache(callback) { + + } + + + play() { + + } + + stop() { + + } +} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e925d13..08c34f0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -32,6 +32,14 @@ + + + + + + + +