diff options
Diffstat (limited to 'src/devices/sound/beep.h')
-rw-r--r-- | src/devices/sound/beep.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/src/devices/sound/beep.h b/src/devices/sound/beep.h index 388d0fa6261..651ad143985 100644 --- a/src/devices/sound/beep.h +++ b/src/devices/sound/beep.h @@ -1,5 +1,11 @@ // license:BSD-3-Clause // copyright-holders:Kevin Thacker +/********************************************************************** + + Simple beeper sound driver + +**********************************************************************/ + #ifndef MAME_SOUND_BEEP_H #define MAME_SOUND_BEEP_H @@ -9,31 +15,27 @@ // TYPE DEFINITIONS //************************************************************************** -// ======================> beep_device - -class beep_device : public device_t, - public device_sound_interface +class beep_device : public device_t, public device_sound_interface { public: beep_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + void set_state(int state); // enable/disable sound output + void set_clock(uint32_t frequency); // output frequency + protected: // device-level overrides - virtual void device_start() override; + virtual void device_start() override ATTR_COLD; // sound stream update overrides - virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override; - -public: - DECLARE_WRITE_LINE_MEMBER(set_state); // enable/disable sound output - void set_clock(uint32_t frequency); // output frequency + virtual void sound_stream_update(sound_stream &stream) override; private: - sound_stream *m_stream; /* stream number */ - int m_enable; /* enable beep */ - int m_frequency; /* set frequency - this can be changed using the appropriate function */ - int m_incr; /* initial wave state */ - int16_t m_signal; /* current signal */ + sound_stream *m_stream; // stream number + bool m_enable; // enable beep + uint32_t m_frequency; // set frequency - this can be changed using the appropriate function + int32_t m_incr; // initial wave state + sound_stream::sample_t m_signal; // current signal }; DECLARE_DEVICE_TYPE(BEEP, beep_device) |