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, 2006 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 * |
30 |
return InnerFactories[ParameterName]->Create(val); |
return InnerFactories[ParameterName]->Create(val); |
31 |
} |
} |
32 |
|
|
33 |
DeviceCreationParameter* DeviceParameterFactory::Create(String ParameterName) throw (Exception) { |
DeviceCreationParameter* DeviceParameterFactory::Create(String ParameterName, std::map<String,String> Parameters) throw (Exception) { |
34 |
if (!InnerFactories.count(ParameterName)) throw Exception("No such parameter: '" + ParameterName + "'."); |
if (!InnerFactories.count(ParameterName)) throw Exception("No such parameter: '" + ParameterName + "'."); |
35 |
return InnerFactories[ParameterName]->Create(); |
return InnerFactories[ParameterName]->Create(Parameters); |
36 |
} |
} |
37 |
|
|
38 |
/* This method is used by the device factory to create parameters _before_ creating a device |
/* This method is used by the device factory to create parameters _before_ creating a device |
48 |
if (Parameters.count(paramName)) { //Parameter with this name was specified |
if (Parameters.count(paramName)) { //Parameter with this name was specified |
49 |
param = iter->second->Create(Parameters[paramName]); |
param = iter->second->Create(Parameters[paramName]); |
50 |
} else { //Not specified, create default |
} else { //Not specified, create default |
51 |
param = iter->second->Create(); |
param = iter->second->Create(Parameters); |
52 |
} |
} |
53 |
result[paramName] = param; |
result[paramName] = param; |
54 |
} |
} |