summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti8x/tispeaker.h
blob: 308b316b3bf216d83cdb1877669c4ce063d33609 (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"


extern device_type const TI8X_SPEAKER_STEREO;
extern device_type const TI8X_SPEAKER_MONO;


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 machine_config_constructor device_mconfig_additions() const 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 machine_config_constructor device_mconfig_additions() const 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

#endif // MAME_DEVICES_BUS_TI8X_TISPEAKER_H