1 // license:BSD-3-Clause
2 // copyright-holders:Krzysztof Strzecha
3 /*****************************************************************************
4  *
5  * dai_snd.h
6  *
7  ****************************************************************************/
8 
9 #ifndef MAME_AUDIO_DAI_SND_H
10 #define MAME_AUDIO_DAI_SND_H
11 
12 
13 // ======================> dai_sound_device
14 
15 class dai_sound_device : public device_t, public device_sound_interface
16 {
17 public:
18 	// construction/destruction
19 	dai_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
20 
21 	DECLARE_WRITE_LINE_MEMBER(set_input_ch0);
22 	DECLARE_WRITE_LINE_MEMBER(set_input_ch1);
23 	DECLARE_WRITE_LINE_MEMBER(set_input_ch2);
24 	void set_volume(offs_t offset, uint8_t data);
25 
26 protected:
27 	// device-level overrides
28 	virtual void device_start() override;
29 	virtual void device_reset() override;
30 	virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
31 
32 private:
33 	sound_stream *      m_mixer_channel;
34 	int                 m_dai_input[3];
35 	uint8_t             m_osc_volume[3];
36 	uint8_t             m_noise_volume;
37 
38 	static const uint16_t s_osc_volume_table[];
39 	static const uint16_t s_noise_volume_table[];
40 };
41 
42 DECLARE_DEVICE_TYPE(DAI_SOUND, dai_sound_device)
43 
44 #endif // MAME_AUDIO_DAI_SND_H
45