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

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

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

revision 840 by persson, Sun Feb 26 13:00:08 2006 UTC revision 1424 by schoenebeck, Sun Oct 14 22:00:17 2007 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                              *   *   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  *
# Line 23  Line 23 
23    
24  #include "AudioOutputDeviceFactory.h"  #include "AudioOutputDeviceFactory.h"
25  #include "AudioOutputDevice.h"  #include "AudioOutputDevice.h"
26    #include "../../common/global_private.h"
27    
28  namespace LinuxSampler {  namespace LinuxSampler {
29    
# Line 56  namespace LinuxSampler { Line 57  namespace LinuxSampler {
57          return true;          return true;
58      }      }
59    
60      void AudioOutputDevice::ParameterActive::OnSetValue(bool b) throw (LinuxSamplerException) {      void AudioOutputDevice::ParameterActive::OnSetValue(bool b) throw (Exception) {
61          if (b) ((AudioOutputDevice*)pDevice)->Play();          if (b) ((AudioOutputDevice*)pDevice)->Play();
62          else ((AudioOutputDevice*)pDevice)->Stop();          else ((AudioOutputDevice*)pDevice)->Stop();
63      }      }
# Line 109  namespace LinuxSampler { Line 110  namespace LinuxSampler {
110          return std::vector<int>();          return std::vector<int>();
111      }      }
112    
113      void AudioOutputDevice::ParameterSampleRate::OnSetValue(int i) throw (LinuxSamplerException) {      void AudioOutputDevice::ParameterSampleRate::OnSetValue(int i) throw (Exception) {
114          /* cannot happen, as parameter is fix */          /* cannot happen, as parameter is fix */
115      }      }
116    
# Line 150  namespace LinuxSampler { Line 151  namespace LinuxSampler {
151      }      }
152    
153      optional<int> AudioOutputDevice::ParameterChannels::RangeMinAsInt(std::map<String,String> Parameters) {      optional<int> AudioOutputDevice::ParameterChannels::RangeMinAsInt(std::map<String,String> Parameters) {
154          return optional<int>::nothing;          return 1;
155      }      }
156    
157      optional<int> AudioOutputDevice::ParameterChannels::RangeMaxAsInt(std::map<String,String> Parameters) {      optional<int> AudioOutputDevice::ParameterChannels::RangeMaxAsInt(std::map<String,String> Parameters) {
158          return optional<int>::nothing;          return 100;
159      }      }
160    
161      std::vector<int> AudioOutputDevice::ParameterChannels::PossibilitiesAsInt(std::map<String,String> Parameters) {      std::vector<int> AudioOutputDevice::ParameterChannels::PossibilitiesAsInt(std::map<String,String> Parameters) {
162          return std::vector<int>();          return std::vector<int>();
163      }      }
164    
165      void AudioOutputDevice::ParameterChannels::OnSetValue(int i) throw (LinuxSamplerException) {      void AudioOutputDevice::ParameterChannels::OnSetValue(int i) throw (Exception) {
166          ((AudioOutputDevice*)pDevice)->AcquireChannels(i);          ((AudioOutputDevice*)pDevice)->AcquireChannels(i);
167      }      }
168    
# Line 174  namespace LinuxSampler { Line 175  namespace LinuxSampler {
175  // *************** AudioOutputDevice ***************  // *************** AudioOutputDevice ***************
176  // *  // *
177    
178      AudioOutputDevice::AudioOutputDevice(std::map<String,DeviceCreationParameter*> DriverParameters) {      AudioOutputDevice::AudioOutputDevice(std::map<String,DeviceCreationParameter*> DriverParameters)
179            : EnginesReader(Engines) {
180          this->Parameters = DriverParameters;          this->Parameters = DriverParameters;
181      }      }
182    
# Line 232  namespace LinuxSampler { Line 234  namespace LinuxSampler {
234          }          }
235      }      }
236    
237        uint AudioOutputDevice::ChannelCount() {
238            return Channels.size();
239        }
240    
241      std::map<String,DeviceCreationParameter*> AudioOutputDevice::DeviceParameters() {      std::map<String,DeviceCreationParameter*> AudioOutputDevice::DeviceParameters() {
242          return Parameters;          return Parameters;
243      }      }
# Line 250  namespace LinuxSampler { Line 256  namespace LinuxSampler {
256          int result = 0;          int result = 0;
257    
258          // let all connected engines render audio for the current audio fragment cycle          // let all connected engines render audio for the current audio fragment cycle
259          const std::set<Engine*>& engines = Engines.Lock();          const std::set<Engine*>& engines = EnginesReader.Lock();
260          #if CONFIG_RT_EXCEPTIONS          #if CONFIG_RT_EXCEPTIONS
261          try          try
262          #endif // CONFIG_RT_EXCEPTIONS          #endif // CONFIG_RT_EXCEPTIONS
# Line 269  namespace LinuxSampler { Line 275  namespace LinuxSampler {
275          }          }
276          #endif // CONFIG_RT_EXCEPTIONS          #endif // CONFIG_RT_EXCEPTIONS
277    
278          Engines.Unlock();          EnginesReader.Unlock();
279          return result;          return result;
280      }      }
281    

Legend:
Removed from v.840  
changed lines
  Added in v.1424

  ViewVC Help
Powered by ViewVC