/[svn]/linuxsampler/trunk/src/engines/gig/Engine.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/Engine.cpp

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

revision 224 by capela, Fri Jun 18 14:29:02 2004 UTC revision 225 by schoenebeck, Sun Aug 22 14:46:47 2004 UTC
# Line 65  namespace LinuxSampler { namespace gig { Line 65  namespace LinuxSampler { namespace gig {
65          InstrumentIdx = -1;          InstrumentIdx = -1;
66          InstrumentStat = -1;          InstrumentStat = -1;
67    
68            AudioDeviceChannelLeft  = -1;
69            AudioDeviceChannelRight = -1;
70    
71          ResetInternal();          ResetInternal();
72      }      }
73    
# Line 149  namespace LinuxSampler { namespace gig { Line 152  namespace LinuxSampler { namespace gig {
152          SustainPedal        = false;          SustainPedal        = false;
153          ActiveVoiceCount    = 0;          ActiveVoiceCount    = 0;
154          ActiveVoiceCountMax = 0;          ActiveVoiceCountMax = 0;
155            GlobalVolume        = 1.0;
156    
157          // set all MIDI controller values to zero          // set all MIDI controller values to zero
158          memset(ControllerTable, 0x00, 128);          memset(ControllerTable, 0x00, 128);
# Line 278  namespace LinuxSampler { namespace gig { Line 282  namespace LinuxSampler { namespace gig {
282              throw LinuxSamplerException(msg);              throw LinuxSamplerException(msg);
283          }          }
284    
285            this->AudioDeviceChannelLeft  = 0;
286            this->AudioDeviceChannelRight = 1;
287            this->pOutputLeft             = pAudioOutputDevice->Channel(0)->Buffer();
288            this->pOutputRight            = pAudioOutputDevice->Channel(1)->Buffer();
289            this->MaxSamplesPerCycle      = pAudioOutputDevice->MaxSamplesPerCycle();
290            this->SampleRate              = pAudioOutputDevice->SampleRate();
291    
292          // (re)create disk thread          // (re)create disk thread
293          if (this->pDiskThread) {          if (this->pDiskThread) {
294              this->pDiskThread->StopThread();              this->pDiskThread->StopThread();
# Line 291  namespace LinuxSampler { namespace gig { Line 302  namespace LinuxSampler { namespace gig {
302    
303          for (Voice* pVoice = pVoicePool->alloc(); pVoice; pVoice = pVoicePool->alloc()) {          for (Voice* pVoice = pVoicePool->alloc(); pVoice; pVoice = pVoicePool->alloc()) {
304              pVoice->pDiskThread = this->pDiskThread;              pVoice->pDiskThread = this->pDiskThread;
             pVoice->SetOutput(pAudioOut);  
305              dmsg(3,("d"));              dmsg(3,("d"));
306          }          }
307          pVoicePool->clear();          pVoicePool->clear();
# Line 329  namespace LinuxSampler { namespace gig { Line 339  namespace LinuxSampler { namespace gig {
339              AudioOutputDevice* olddevice = pAudioOutputDevice;              AudioOutputDevice* olddevice = pAudioOutputDevice;
340              pAudioOutputDevice = NULL;              pAudioOutputDevice = NULL;
341              olddevice->Disconnect(this);              olddevice->Disconnect(this);
342                AudioDeviceChannelLeft  = -1;
343                AudioDeviceChannelRight = -1;
344          }          }
345      }      }
346    
# Line 675  namespace LinuxSampler { namespace gig { Line 687  namespace LinuxSampler { namespace gig {
687          GlobalVolume = f;          GlobalVolume = f;
688      }      }
689    
690        uint Engine::Channels() {
691            return 2;
692        }
693    
694        void Engine::SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) {
695            AudioChannel* pChannel = pAudioOutputDevice->Channel(AudioDeviceChannel);
696            if (!pChannel) throw AudioOutputException("Invalid audio output device channel " + ToString(AudioDeviceChannel));
697            switch (EngineAudioChannel) {
698                case 0: // left output channel
699                    pOutputLeft = pChannel->Buffer();
700                    AudioDeviceChannelLeft = AudioDeviceChannel;
701                    break;
702                case 1: // right output channel
703                    pOutputRight = pChannel->Buffer();
704                    AudioDeviceChannelRight = AudioDeviceChannel;
705                    break;
706                default:
707                    throw AudioOutputException("Invalid engine audio channel " + ToString(EngineAudioChannel));
708            }
709        }
710    
711        int Engine::OutputChannel(uint EngineAudioChannel) {
712            switch (EngineAudioChannel) {
713                case 0: // left channel
714                    return AudioDeviceChannelLeft;
715                case 1: // right channel
716                    return AudioDeviceChannelRight;
717                default:
718                    throw AudioOutputException("Invalid engine audio channel " + ToString(EngineAudioChannel));
719            }
720        }
721    
722      uint Engine::VoiceCount() {      uint Engine::VoiceCount() {
723          return ActiveVoiceCount;          return ActiveVoiceCount;
724      }      }
# Line 724  namespace LinuxSampler { namespace gig { Line 768  namespace LinuxSampler { namespace gig {
768      }      }
769    
770      String Engine::Version() {      String Engine::Version() {
771          String s = "$Revision: 1.7 $";          String s = "$Revision: 1.8 $";
772          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword          return s.substr(11, s.size() - 13); // cut dollar signs, spaces and CVS macro keyword
773      }      }
774    

Legend:
Removed from v.224  
changed lines
  Added in v.225

  ViewVC Help
Powered by ViewVC