diff options
author | 2014-09-13 14:28:14 +0000 | |
---|---|---|
committer | 2014-09-13 14:28:14 +0000 | |
commit | c709f7f5f6f022a22b56a47de2a90af9f57a2dfb (patch) | |
tree | 5529f02afe383178e6a74b0380b727ee76759909 /src/emu/sound/speaker.h | |
parent | e85610005dd2145fc7ec2db923bbf8bc92d9c706 (diff) |
static_config removed from speaker (nw)
Diffstat (limited to 'src/emu/sound/speaker.h')
-rw-r--r-- | src/emu/sound/speaker.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/emu/sound/speaker.h b/src/emu/sound/speaker.h index 642d30110fd..cc61ddf1101 100644 --- a/src/emu/sound/speaker.h +++ b/src/emu/sound/speaker.h @@ -17,27 +17,23 @@ enum FILTER_LENGTH = 64 }; - -struct speaker_interface -{ - int m_num_levels; /* optional: number of levels (if not two) */ - const INT16 *m_levels; /* optional: pointer to level lookup table */ -}; - +#define MCFG_SPEAKER_LEVELS(_num, _levels) \ + speaker_sound_device::static_set_levels(*device, _num, _levels); class speaker_sound_device : public device_t, - public device_sound_interface, - public speaker_interface + public device_sound_interface { public: speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ~speaker_sound_device() {} + + // static configuration + static void static_set_levels(device_t &device, int num_levels, const INT16 *levels) { downcast<speaker_sound_device &>(device).m_num_levels = num_levels; downcast<speaker_sound_device &>(device).m_levels = levels;} void level_w(int new_level); protected: // device-level overrides - virtual void device_config_complete(); virtual void device_start(); virtual void device_reset(); @@ -84,6 +80,9 @@ private: // DC blocker state double m_prevx, m_prevy; + + int m_num_levels; /* optional: number of levels (if not two) */ + const INT16 *m_levels; /* optional: pointer to level lookup table */ }; extern const device_type SPEAKER_SOUND; |