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

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

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

revision 2353 by schoenebeck, Sun Jul 12 10:35:55 2009 UTC revision 2354 by persson, Sun Jul 8 10:29:07 2012 UTC
# Line 19  Line 19 
19   ***************************************************************************/   ***************************************************************************/
20    
21  #include "AudioOutputDevicePlugin.h"  #include "AudioOutputDevicePlugin.h"
22    #include "../../common/global_private.h"
23    #include <algorithm>
24    
25  namespace LinuxSampler {  namespace LinuxSampler {
26    
# Line 30  namespace LinuxSampler { Line 32  namespace LinuxSampler {
32      }      }
33    
34    
35    // *************** ParameterChannelsPlugin  ***************
36    // *
37    
38        void AudioOutputDevicePlugin::ParameterChannelsPlugin::ForceSetValue(int channels) {
39            OnSetValue(channels);
40            iVal = channels;
41        }
42    
43    
44  // *************** ParameterFragmentSize ***************  // *************** ParameterFragmentSize ***************
45  // *  // *
46    
# Line 142  namespace LinuxSampler { Line 153  namespace LinuxSampler {
153      bool AudioOutputDevicePlugin::isAutonomousDriver() {      bool AudioOutputDevicePlugin::isAutonomousDriver() {
154          return false;          return false;
155      }      }
156    
157    
158        void AudioOutputDevicePlugin::AddChannels(int newChannels) {
159            static_cast<ParameterChannelsPlugin*>(
160                Parameters["CHANNELS"])->ForceSetValue(Channels.size() + newChannels);
161        }
162    
163        void AudioOutputDevicePlugin::RemoveChannel(AudioChannel* pChannel) {
164            std::vector<AudioChannel*>::iterator i = find(Channels.begin(), Channels.end(), pChannel);
165            int channelNumber = i - Channels.begin();
166            delete *i;
167            Channels.erase(i);
168    
169            for ( ; channelNumber < Channels.size() ; channelNumber++) {
170                static_cast<AudioChannelPlugin*>(Channels[channelNumber])->ChannelNr = channelNumber;
171                Channels[channelNumber]->ChannelParameters()["NAME"]->SetValue("Channel " + ToString(channelNumber));
172            }
173            static_cast<ParameterChannelsPlugin*>(
174                Parameters["CHANNELS"])->ForceSetValue(Channels.size());
175        }
176  }  }

Legend:
Removed from v.2353  
changed lines
  Added in v.2354

  ViewVC Help
Powered by ViewVC