3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
* Copyright (C) 2005 Christian Schoenebeck * |
* Copyright (C) 2005 - 2007 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* it under the terms of the GNU General Public License as published by * |
* it under the terms of the GNU General Public License as published by * |
23 |
|
|
24 |
#include "AudioOutputDeviceFactory.h" |
#include "AudioOutputDeviceFactory.h" |
25 |
#include "AudioOutputDevice.h" |
#include "AudioOutputDevice.h" |
26 |
|
#include "../../common/global_private.h" |
27 |
|
|
28 |
namespace LinuxSampler { |
namespace LinuxSampler { |
29 |
|
|
57 |
return true; |
return true; |
58 |
} |
} |
59 |
|
|
60 |
void AudioOutputDevice::ParameterActive::OnSetValue(bool b) throw (LinuxSamplerException) { |
void AudioOutputDevice::ParameterActive::OnSetValue(bool b) throw (Exception) { |
61 |
if (b) ((AudioOutputDevice*)pDevice)->Play(); |
if (b) ((AudioOutputDevice*)pDevice)->Play(); |
62 |
else ((AudioOutputDevice*)pDevice)->Stop(); |
else ((AudioOutputDevice*)pDevice)->Stop(); |
63 |
} |
} |
110 |
return std::vector<int>(); |
return std::vector<int>(); |
111 |
} |
} |
112 |
|
|
113 |
void AudioOutputDevice::ParameterSampleRate::OnSetValue(int i) throw (LinuxSamplerException) { |
int AudioOutputDevice::ParameterSampleRate::ValueAsInt() { |
114 |
|
return (pDevice) ? (int) ((AudioOutputDevice*)pDevice)->SampleRate() |
115 |
|
: DeviceCreationParameterInt::ValueAsInt(); |
116 |
|
} |
117 |
|
|
118 |
|
void AudioOutputDevice::ParameterSampleRate::OnSetValue(int i) throw (Exception) { |
119 |
/* cannot happen, as parameter is fix */ |
/* cannot happen, as parameter is fix */ |
120 |
} |
} |
121 |
|
|
156 |
} |
} |
157 |
|
|
158 |
optional<int> AudioOutputDevice::ParameterChannels::RangeMinAsInt(std::map<String,String> Parameters) { |
optional<int> AudioOutputDevice::ParameterChannels::RangeMinAsInt(std::map<String,String> Parameters) { |
159 |
return optional<int>::nothing; |
return 1; |
160 |
} |
} |
161 |
|
|
162 |
optional<int> AudioOutputDevice::ParameterChannels::RangeMaxAsInt(std::map<String,String> Parameters) { |
optional<int> AudioOutputDevice::ParameterChannels::RangeMaxAsInt(std::map<String,String> Parameters) { |
167 |
return std::vector<int>(); |
return std::vector<int>(); |
168 |
} |
} |
169 |
|
|
170 |
void AudioOutputDevice::ParameterChannels::OnSetValue(int i) throw (LinuxSamplerException) { |
void AudioOutputDevice::ParameterChannels::OnSetValue(int i) throw (Exception) { |
171 |
((AudioOutputDevice*)pDevice)->AcquireChannels(i); |
((AudioOutputDevice*)pDevice)->AcquireChannels(i); |
172 |
} |
} |
173 |
|
|
239 |
} |
} |
240 |
} |
} |
241 |
|
|
242 |
|
uint AudioOutputDevice::ChannelCount() { |
243 |
|
return Channels.size(); |
244 |
|
} |
245 |
|
|
246 |
std::map<String,DeviceCreationParameter*> AudioOutputDevice::DeviceParameters() { |
std::map<String,DeviceCreationParameter*> AudioOutputDevice::DeviceParameters() { |
247 |
return Parameters; |
return Parameters; |
248 |
} |
} |