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 * |
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 * |
61 |
REGISTER_MIDI_INPUT_DRIVER_PARAMETER(MidiInputDeviceMidiShare, ParameterPorts); |
REGISTER_MIDI_INPUT_DRIVER_PARAMETER(MidiInputDeviceMidiShare, ParameterPorts); |
62 |
#endif // HAVE_MIDISHARE |
#endif // HAVE_MIDISHARE |
63 |
|
|
64 |
MidiInputDevice* MidiInputDeviceFactory::Create(String DriverName, std::map<String,String> Parameters) throw (LinuxSamplerException) { |
MidiInputDevice* MidiInputDeviceFactory::Create(String DriverName, std::map<String,String> Parameters, Sampler* pSampler) throw (LinuxSamplerException) { |
65 |
if (!InnerFactories.count(DriverName)) throw LinuxSamplerException("There is no midi input driver '" + DriverName + "'."); |
if (!InnerFactories.count(DriverName)) throw LinuxSamplerException("There is no midi input driver '" + DriverName + "'."); |
66 |
//Let's see if we need to create parameters |
//Let's see if we need to create parameters |
67 |
std::map<String,DeviceCreationParameter*> thisDeviceParams; |
std::map<String,DeviceCreationParameter*> thisDeviceParams; |
73 |
if (Parameters.size() != 0) throw LinuxSamplerException("Driver '" + DriverName + "' does not have any parameters."); |
if (Parameters.size() != 0) throw LinuxSamplerException("Driver '" + DriverName + "' does not have any parameters."); |
74 |
} |
} |
75 |
//Now create the device using those parameters |
//Now create the device using those parameters |
76 |
MidiInputDevice* pDevice = InnerFactories[DriverName]->Create(thisDeviceParams); |
MidiInputDevice* pDevice = InnerFactories[DriverName]->Create(thisDeviceParams, pSampler); |
77 |
//Now attach all parameters to the newely created device. |
//Now attach all parameters to the newely created device. |
78 |
for (std::map<String,DeviceCreationParameter*>::iterator iter = thisDeviceParams.begin(); iter != thisDeviceParams.end(); iter++) { |
for (std::map<String,DeviceCreationParameter*>::iterator iter = thisDeviceParams.begin(); iter != thisDeviceParams.end(); iter++) { |
79 |
iter->second->Attach(pDevice); |
iter->second->Attach(pDevice); |