/[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 288 by schoenebeck, Tue Oct 19 00:36:34 2004 UTC revision 289 by schoenebeck, Tue Oct 19 14:41:38 2004 UTC
# Line 22  Line 22 
22    
23  #include "AudioOutputDeviceFactory.h"  #include "AudioOutputDeviceFactory.h"
24    
25  // just to avoid linker problems  #if HAVE_ALSA
26  #include "AudioOutputDeviceAlsa.h"  # include "AudioOutputDeviceAlsa.h"
27  #include "AudioOutputDeviceJack.h"  #endif // HAVE_ALSA
28    
29    #if HAVE_JACK
30    # include "AudioOutputDeviceJack.h"
31    #endif // HAVE_JACK
32    
33  namespace LinuxSampler {  namespace LinuxSampler {
34    
35      std::map<String, AudioOutputDeviceFactory::InnerFactory*> AudioOutputDeviceFactory::InnerFactories;      std::map<String, AudioOutputDeviceFactory::InnerFactory*> AudioOutputDeviceFactory::InnerFactories;
36      std::map<String, DeviceParameterFactory*> AudioOutputDeviceFactory::ParameterFactories;      std::map<String, DeviceParameterFactory*> AudioOutputDeviceFactory::ParameterFactories;
37    
38      // just a little hack to avoid linker problems  #if HAVE_ALSA
39      static int ___init___foo___() {      REGISTER_AUDIO_OUTPUT_DRIVER(AudioOutputDeviceAlsa);
40          #if HAVE_ALSA      /* Common parameters for now they'll have to be registered here. */
41          AudioOutputDeviceAlsa::Name().c_str();      REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceAlsa, ParameterActive);
42          #endif // HAVE_ALSA      REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceAlsa, ParameterSampleRate);
43          #if HAVE_JACK      REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceAlsa, ParameterChannels);
44          AudioOutputDeviceJack::Name().c_str();      /* Driver specific parameters */
45          #endif // HAVE_JACK      REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceAlsa, ParameterCard);
46          return 0;      REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceAlsa, ParameterFragments);
47      }      REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceAlsa, ParameterFragmentSize);
48      static int ___foo___ = ___init___foo___();  #endif // HAVE_ALSA
49    
50    #if HAVE_JACK
51        REGISTER_AUDIO_OUTPUT_DRIVER(AudioOutputDeviceJack);
52        /* Common parameters for now they'll have to be registered here. */
53        REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceJack, ParameterActive);
54        REGISTER_AUDIO_OUTPUT_DRIVER_PARAMETER(AudioOutputDeviceJack, ParameterChannels);
55    #endif // HAVE_JACK
56    
57      AudioOutputDevice* AudioOutputDeviceFactory::Create(String DriverName, std::map<String,String> Parameters) throw (LinuxSamplerException) {      AudioOutputDevice* AudioOutputDeviceFactory::Create(String DriverName, std::map<String,String> Parameters) throw (LinuxSamplerException) {
58          if (!InnerFactories.count(DriverName)) throw LinuxSamplerException("There is no audio output driver '" + DriverName + "'.");          if (!InnerFactories.count(DriverName)) throw LinuxSamplerException("There is no audio output driver '" + DriverName + "'.");

Legend:
Removed from v.288  
changed lines
  Added in v.289

  ViewVC Help
Powered by ViewVC