diff options
Diffstat (limited to 'src/emu/disound.h')
-rw-r--r-- | src/emu/disound.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/emu/disound.h b/src/emu/disound.h index 7c57b12b9bc..da968abd789 100644 --- a/src/emu/disound.h +++ b/src/emu/disound.h @@ -17,6 +17,8 @@ #ifndef MAME_EMU_DISOUND_H #define MAME_EMU_DISOUND_H +#include <functional> + //************************************************************************** // CONSTANTS @@ -66,13 +68,12 @@ public: class sound_route { public: - sound_route(int output, int input, float gain, const char *target, u32 mixoutput); - - u32 m_output; // output index, or ALL_OUTPUTS - u32 m_input; // target input index - u32 m_mixoutput; // target mixer output - float m_gain; // gain - std::string m_target; // target tag + u32 m_output; // output index, or ALL_OUTPUTS + u32 m_input; // target input index + u32 m_mixoutput; // target mixer output + float m_gain; // gain + std::reference_wrapper<device_t> m_base; // target search base + std::string m_target; // target tag }; // construction/destruction @@ -82,13 +83,12 @@ public: virtual bool issound() { return true; } /// HACK: allow devices to hide from the ui // configuration access - const std::vector<std::unique_ptr<sound_route>> &routes() const { return m_route_list; } + std::vector<sound_route> const &routes() const { return m_route_list; } - // inline configuration helpers - void add_route(u32 output, const char *target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0) - { - m_route_list.push_back(std::make_unique<sound_route>(output, input, gain, target, mixoutput)); - } + // configuration helpers + void add_route(u32 output, const char *target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0); + void add_route(u32 output, device_sound_interface &target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0); + void add_route(u32 output, speaker_device &target, double gain, u32 input = AUTO_ALLOC_INPUT, u32 mixoutput = 0); void reset_routes() { m_route_list.clear(); } // sound stream update overrides @@ -107,6 +107,9 @@ public: int inputnum_from_device(device_t &device, int outputnum = 0) const; protected: + // configuration access + std::vector<sound_route> &routes() { return m_route_list; } + // optional operation overrides virtual void interface_validity_check(validity_checker &valid) const override; virtual void interface_pre_start() override; @@ -114,7 +117,7 @@ protected: virtual void interface_pre_reset() override; // internal state - std::vector<std::unique_ptr<sound_route>> m_route_list; // list of sound routes + std::vector<sound_route> m_route_list; // list of sound routes int m_outputs; // number of outputs from this instance int m_auto_allocated_inputs; // number of auto-allocated inputs targeting us }; |