summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/disound.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-02-25 19:21:35 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-02-25 19:21:35 +0000
commit1ff793a4a83fd9b89f589d22418bcff8d7e215f1 (patch)
tree10e52fda9dad3ec5b4b4f436715be3a188e1d66f /src/emu/disound.h
parent19d720efc1b0b0eeddd3b50902a3a6df19548d8d (diff)
Create a new device_mixer_interface, derived from device_sound_interface,
which mixes all its inputs to a single output stream. Redefined the SPEAKER device to use this and remove the duplicate underlying logic. The main purpose of this new interface is to allow device-ification of an entire sound board, which can itself become a mixer of all of its sound components to a single output stream. This stream can then be routed by the device's owner to the appropriate speakers. A real-life example will show up soon.
Diffstat (limited to 'src/emu/disound.h')
-rw-r--r--src/emu/disound.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/emu/disound.h b/src/emu/disound.h
index c94187337c4..365b59891da 100644
--- a/src/emu/disound.h
+++ b/src/emu/disound.h
@@ -152,4 +152,29 @@ protected:
// iterator
typedef device_interface_iterator<device_sound_interface> sound_interface_iterator;
+
+
+// ======================> device_mixer_interface
+
+class device_mixer_interface : public device_sound_interface
+{
+public:
+ // construction/destruction
+ device_mixer_interface(const machine_config &mconfig, device_t &device, int outputs = 1);
+ virtual ~device_mixer_interface();
+
+protected:
+ // optional operation overrides
+ virtual void interface_pre_start();
+ virtual void interface_post_load();
+
+ // sound interface overrides
+ virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples);
+
+ // internal state
+ UINT8 m_outputs; // number of outputs
+ sound_stream * m_mixer_stream; // mixing stream
+};
+
+
#endif /* __DISOUND_H__ */