summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/flt_vol.h
blob: 96bc61af20014c3661d59cc35e993a8ffd4d6750 (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
// license:BSD-3-Clause
// copyright-holders:Derrick Renaud, Couriersud
#ifndef MAME_SOUND_FLT_VOL_H
#define MAME_SOUND_FLT_VOL_H

#pragma once


//**************************************************************************
//  TYPE DEFINITIONS
//**************************************************************************

// ======================> filter_volume_device

class filter_volume_device : public device_t, public device_sound_interface
{
public:
	filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);

	filter_volume_device &set_gain(float gain); // also may be used in mcfg to set initial value (default is 1.0)
	float gain() { return m_gain; }

protected:
	// device-level overrides
	virtual void device_start() override ATTR_COLD;

	// sound stream update overrides
	virtual void sound_stream_update(sound_stream &stream) override;

private:
	sound_stream* m_stream;
	float m_gain;
};

DECLARE_DEVICE_TYPE(FILTER_VOLUME, filter_volume_device)

#endif // MAME_SOUND_FLT_VOL_H