diff options
Diffstat (limited to 'src/devices/sound/bbd.h')
-rw-r--r-- | src/devices/sound/bbd.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/devices/sound/bbd.h b/src/devices/sound/bbd.h index 799fae790c1..aa307d283c2 100644 --- a/src/devices/sound/bbd.h +++ b/src/devices/sound/bbd.h @@ -14,13 +14,19 @@ template<int Entries, int Outputs> class bbd_device_base : public device_t, public device_sound_interface { +public: + // configuration + template <typename... T> void set_cv_handler(T &&... args) + { + m_cv_handler.set(std::forward<T>(args)...); + } + protected: + using cv_delegate = device_delegate<attoseconds_t (attotime const &)>; + // internal constructor bbd_device_base(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, device_type type); - // override to convert clock to sample rate - virtual u32 sample_rate() const { return clock(); } - // device-level overrides virtual void device_start() override; virtual void device_clock_changed() override; @@ -29,9 +35,15 @@ protected: virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override; protected: + // override to convert clock to sample rate + stream_buffer::sample_t outputval(s32 index) const { return m_buffer[m_curpos + Entries + index]; } + virtual u32 sample_rate() const { return clock(); } + sound_stream * m_stream; u32 m_curpos; - stream_buffer::sample_t m_buffer[Entries]; + cv_delegate m_cv_handler; + attotime m_next_bbdtime; + stream_buffer::sample_t m_buffer[Entries + 1]; }; |