summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/sound/js_sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/sound/js_sound.cpp')
-rw-r--r--src/osd/modules/sound/js_sound.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/osd/modules/sound/js_sound.cpp b/src/osd/modules/sound/js_sound.cpp
index afcf6ec8f2b..1473ef9de2a 100644
--- a/src/osd/modules/sound/js_sound.cpp
+++ b/src/osd/modules/sound/js_sound.cpp
@@ -11,7 +11,7 @@
#include "sound_module.h"
#include "modules/osdmodule.h"
-#if (defined(SDLMAME_EMSCRIPTEN))
+#if defined(SDLMAME_EMSCRIPTEN)
#include "emscripten.h"
@@ -19,36 +19,30 @@ class sound_js : public osd_module, public sound_module
{
public:
- sound_js()
- : osd_module(OSD_SOUND_PROVIDER, "js"), sound_module()
+ sound_js() : osd_module(OSD_SOUND_PROVIDER, "js"), sound_module()
{
}
virtual ~sound_js() { }
- virtual int init(const osd_options &options) { return 0; }
+ virtual int init(osd_interface &osd, const osd_options &options) { return 0; }
virtual void exit() { }
// sound_module
- virtual void update_audio_stream(bool is_throttled, const int16_t *buffer, int samples_this_frame)
+ virtual void stream_sink_update(uint32_t, const int16_t *buffer, int samples_this_frame)
{
- EM_ASM_ARGS({
- // Forward audio stream update on to JS backend implementation.
- jsmame_update_audio_stream($0, $1);
- }, (unsigned int)buffer, samples_this_frame);
+ EM_ASM_ARGS(
+ {
+ // Forward audio stream update on to JS backend implementation.
+ jsmame_steam_update($1, $2);
+ },
+ (unsigned int)buffer,
+ samples_this_frame);
}
- virtual void set_mastervolume(int attenuation)
- {
- EM_ASM_ARGS({
- // Forward volume update on to JS backend implementation.
- jsmame_set_mastervolume($0);
- }, attenuation);
- }
-
};
-#else /* SDLMAME_UNIX */
+#else // SDLMAME_EMSCRIPTEN
MODULE_NOT_SUPPORTED(sound_js, OSD_SOUND_PROVIDER, "js")
-#endif
+#endif // SDLMAME_EMSCRIPTEN
MODULE_DEFINITION(SOUND_JS, sound_js)