From 90cf32becc608fdd1a5e9bf815e040d7fb71b819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Gl=C3=B6ckner?= Date: Tue, 29 Mar 2016 10:43:00 +0200 Subject: refactored class ChannelMixer --- src/channelmixer.h | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/channelmixer.h') diff --git a/src/channelmixer.h b/src/channelmixer.h index fadf181..ec495ac 100644 --- a/src/channelmixer.h +++ b/src/channelmixer.h @@ -24,35 +24,34 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_CHANNELMIXER_H__ -#define __DRUMGIZMO_CHANNELMIXER_H__ +#pragma once #include #include "channel.h" -class MixerSettings { +class MixerSettings +{ public: - float gain; - Channel *output; + float gain; + const Channel* output; }; -class ChannelMixer { +class ChannelMixer +{ public: - ChannelMixer(Channels &channels, - Channel *defaultchannel = NULL, float defaultgain = 1.0); + ChannelMixer(const Channels& channels, + const Channel* defaultchannel = nullptr, float defaultgain = 1.0); - MixerSettings &lookup(InstrumentChannel *channel); + MixerSettings& lookup(const InstrumentChannel& channel); - void setDefaults(Channel *defaultchannel, float defaultgain); + void setDefaults(const Channel* defaultchannel, float defaultgain); private: - std::map mix; + std::map mix; - Channel *defaultchannel; - float defaultgain; + const Channel* defaultchannel; + float defaultgain; - Channels &channels; + const Channels& channels; }; - -#endif/*__DRUMGIZMO_CHANNELMIXER_H__*/ -- cgit v1.2.3