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 - 2007 Christian Schoenebeck * |
* Copyright (C) 2005 - 2009 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This library is free software; you can redistribute it and/or modify * |
* This library 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 * |
156 |
} |
} |
157 |
|
|
158 |
DeviceCreationParameter* AudioOutputDeviceFactory::GetDriverParameter(String DriverName, String ParameterName) throw (Exception) { |
DeviceCreationParameter* AudioOutputDeviceFactory::GetDriverParameter(String DriverName, String ParameterName) throw (Exception) { |
159 |
std::map<String,DeviceCreationParameter*> parameters = GetAvailableDriverParameters(DriverName); |
if (!InnerFactories.count(DriverName)) throw Exception("There is no audio output driver '" + DriverName + "'."); |
160 |
if (!parameters.count(ParameterName)) throw Exception("Audio output driver '" + DriverName + "' does not have a parameter '" + ParameterName + "'."); |
DeviceParameterFactory* pParamFactory = ParameterFactories[DriverName]; |
161 |
return parameters[ParameterName]; |
if (pParamFactory) { |
162 |
|
try { return pParamFactory->Create(ParameterName); } |
163 |
|
catch(Exception e) { } |
164 |
|
} |
165 |
|
throw Exception("Audio output driver '" + DriverName + "' does not have a parameter '" + ParameterName + "'."); |
166 |
} |
} |
167 |
|
|
168 |
String AudioOutputDeviceFactory::GetDriverDescription(String DriverName) throw (Exception) { |
String AudioOutputDeviceFactory::GetDriverDescription(String DriverName) throw (Exception) { |
175 |
return InnerFactories[DriverName]->Version(); |
return InnerFactories[DriverName]->Version(); |
176 |
} |
} |
177 |
|
|
178 |
|
void AudioOutputDeviceFactory::Unregister(String DriverName) { |
179 |
|
std::map<String, InnerFactory*>::iterator iter = InnerFactories.find(DriverName); |
180 |
|
if (iter != InnerFactories.end()) { |
181 |
|
delete iter->second; |
182 |
|
InnerFactories.erase(iter); |
183 |
|
} |
184 |
|
|
185 |
|
std::map<String, DeviceParameterFactory*>::iterator iterpf = ParameterFactories.find(DriverName); |
186 |
|
if (iterpf != ParameterFactories.end()) { |
187 |
|
delete iterpf->second; |
188 |
|
ParameterFactories.erase(iterpf); |
189 |
|
} |
190 |
|
} |
191 |
|
|
192 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |