summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti8x/tispeaker.h
blob: 157c94ab0604c9eea1a7c98681ca9ac4497ebfd4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// license:BSD-3-Clause
// copyright-holders:Vas Crabb
#ifndef MAME_DEVICES_BUS_TI8X_TISPEAKER_H
#define MAME_DEVICES_BUS_TI8X_TISPEAKER_H

#pragma once

#include "ti8x.h"
#include "sound/spkrdev.h"


namespace bus { namespace ti8x {

class stereo_speaker_device : public device_t, public device_ti8x_link_port_interface
{
public:
	stereo_speaker_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);

protected:
	virtual void device_add_mconfig(machine_config &config) override;
	virtual void device_start() override;

	virtual DECLARE_WRITE_LINE_MEMBER(input_tip) override;
	virtual DECLARE_WRITE_LINE_MEMBER(input_ring) override;

	required_device<speaker_sound_device> m_left_speaker;
	required_device<speaker_sound_device> m_right_speaker;
};


class mono_speaker_device : public device_t, public device_ti8x_link_port_interface
{
public:
	mono_speaker_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);

protected:
	virtual void device_add_mconfig(machine_config &config) override;
	virtual void device_start() override;

	virtual DECLARE_WRITE_LINE_MEMBER(input_tip) override;
	virtual DECLARE_WRITE_LINE_MEMBER(input_ring) override;

	required_device<speaker_sound_device> m_speaker;

private:
	bool m_tip_state, m_ring_state;
};

} } // namespace bus::ti8x


DECLARE_DEVICE_TYPE_NS(TI8X_SPEAKER_STEREO, bus::ti8x, stereo_speaker_device)
DECLARE_DEVICE_TYPE_NS(TI8X_SPEAKER_MONO,   bus::ti8x, mono_speaker_device)

#endif // MAME_DEVICES_BUS_TI8X_TISPEAKER_H