/[svn]/linuxsampler/trunk/src/drivers/midi/MidiInputDeviceFactory.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/midi/MidiInputDeviceFactory.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 361 by schoenebeck, Wed Feb 9 01:22:18 2005 UTC revision 551 by schoenebeck, Tue May 17 18:16:54 2005 UTC
# Line 3  Line 3 
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  *
# Line 60  namespace LinuxSampler { Line 61  namespace LinuxSampler {
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;
# Line 72  namespace LinuxSampler { Line 73  namespace LinuxSampler {
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);

Legend:
Removed from v.361  
changed lines
  Added in v.551

  ViewVC Help
Powered by ViewVC