19 |
***************************************************************************/ |
***************************************************************************/ |
20 |
|
|
21 |
#include "AudioOutputDevicePlugin.h" |
#include "AudioOutputDevicePlugin.h" |
22 |
|
#include "../../common/global_private.h" |
23 |
|
#include <algorithm> |
24 |
|
|
25 |
namespace LinuxSampler { |
namespace LinuxSampler { |
26 |
|
|
32 |
} |
} |
33 |
|
|
34 |
|
|
35 |
|
// *************** ParameterChannelsPlugin *************** |
36 |
|
// * |
37 |
|
|
38 |
|
void AudioOutputDevicePlugin::ParameterChannelsPlugin::ForceSetValue(int channels) { |
39 |
|
OnSetValue(channels); |
40 |
|
iVal = channels; |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
// *************** ParameterFragmentSize *************** |
// *************** ParameterFragmentSize *************** |
45 |
// * |
// * |
46 |
|
|
153 |
bool AudioOutputDevicePlugin::isAutonomousDriver() { |
bool AudioOutputDevicePlugin::isAutonomousDriver() { |
154 |
return false; |
return false; |
155 |
} |
} |
156 |
|
|
157 |
|
|
158 |
|
void AudioOutputDevicePlugin::AddChannels(int newChannels) { |
159 |
|
static_cast<ParameterChannelsPlugin*>( |
160 |
|
Parameters["CHANNELS"])->ForceSetValue(Channels.size() + newChannels); |
161 |
|
} |
162 |
|
|
163 |
|
void AudioOutputDevicePlugin::RemoveChannel(AudioChannel* pChannel) { |
164 |
|
std::vector<AudioChannel*>::iterator i = find(Channels.begin(), Channels.end(), pChannel); |
165 |
|
int channelNumber = i - Channels.begin(); |
166 |
|
delete *i; |
167 |
|
Channels.erase(i); |
168 |
|
|
169 |
|
for ( ; channelNumber < Channels.size() ; channelNumber++) { |
170 |
|
static_cast<AudioChannelPlugin*>(Channels[channelNumber])->ChannelNr = channelNumber; |
171 |
|
Channels[channelNumber]->ChannelParameters()["NAME"]->SetValue("Channel " + ToString(channelNumber)); |
172 |
|
} |
173 |
|
static_cast<ParameterChannelsPlugin*>( |
174 |
|
Parameters["CHANNELS"])->ForceSetValue(Channels.size()); |
175 |
|
} |
176 |
} |
} |