1 // license:GPL-2.0+
2 // copyright-holders:Juergen Buchmueller
3 #ifndef MAME_AUDIO_GEEBEE_H
4 #define MAME_AUDIO_GEEBEE_H
5 
6 #pragma once
7 
8 class geebee_sound_device : public device_t, public device_sound_interface
9 {
10 public:
11 	geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
12 
13 	enum
14 	{
15 		TIMER_VOLUME_DECAY
16 	};
17 
18 	void sound_w(u8 data);
19 
20 protected:
21 	// device-level overrides
22 	virtual void device_start() override;
23 
24 	// sound stream update overrides
25 	virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
26 
27 	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
28 
29 private:
30 	// internal state
31 	std::unique_ptr<uint16_t[]> m_decay;
32 	sound_stream *m_channel;
33 	int m_sound_latch;
34 	int m_sound_signal;
35 	int m_volume;
36 	emu_timer *m_volume_timer;
37 	int m_noise;
38 	int m_vcount;
39 };
40 
41 DECLARE_DEVICE_TYPE(GEEBEE_SOUND, geebee_sound_device)
42 
43 #endif // MAME_AUDIO_GEEBEE_H
44