/[svn]/linuxsampler/trunk/src/drivers/audio/AudioOutputDeviceFactory.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/audio/AudioOutputDeviceFactory.cpp

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

revision 1832 by iliev, Thu Feb 5 17:48:54 2009 UTC revision 1889 by persson, Sun Apr 26 12:19:00 2009 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 - 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  *
# Line 156  namespace LinuxSampler { Line 156  namespace LinuxSampler {
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) {
# Line 171  namespace LinuxSampler { Line 175  namespace LinuxSampler {
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

Legend:
Removed from v.1832  
changed lines
  Added in v.1889

  ViewVC Help
Powered by ViewVC