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

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

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

revision 1039 by persson, Sat Feb 3 20:46:44 2007 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, 2006 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 "EngineChannel.h"  #include "EngineChannel.h"
25    
26    #include "../../common/global_private.h"
27    
28  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
29    
30      EngineChannel::EngineChannel() {      EngineChannel::EngineChannel() {
# Line 159  namespace LinuxSampler { namespace gig { Line 161  namespace LinuxSampler { namespace gig {
161       * This method will then actually start to load the instrument and block       * This method will then actually start to load the instrument and block
162       * the calling thread until loading was completed.       * the calling thread until loading was completed.
163       *       *
      * @returns detailed description of the method call result  
164       * @see PrepareLoadInstrument()       * @see PrepareLoadInstrument()
165       */       */
166      void EngineChannel::LoadInstrument() {      void EngineChannel::LoadInstrument() {
# Line 192  namespace LinuxSampler { namespace gig { Line 193  namespace LinuxSampler { namespace gig {
193              instrid.Index     = InstrumentIdx;              instrid.Index     = InstrumentIdx;
194              newInstrument = Engine::instruments.Borrow(instrid, this);              newInstrument = Engine::instruments.Borrow(instrid, this);
195              if (!newInstrument) {              if (!newInstrument) {
196                  InstrumentStat = -1;                  throw InstrumentManagerException("resource was not created");
                 dmsg(1,("no instrument loaded!!!\n"));  
                 exit(EXIT_FAILURE);  
197              }              }
198          }          }
199          catch (RIFF::Exception e) {          catch (RIFF::Exception e) {
200              InstrumentStat = -2;              InstrumentStat = -2;
201                StatusChanged(true);
202              String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message;              String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message;
203              throw Exception(msg);              throw Exception(msg);
204          }          }
205          catch (InstrumentResourceManagerException e) {          catch (InstrumentManagerException e) {
206              InstrumentStat = -3;              InstrumentStat = -3;
207                StatusChanged(true);
208              String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message();              String msg = "gig::Engine error: Failed to load instrument, cause: " + e.Message();
209              throw Exception(msg);              throw Exception(msg);
210          }          }
211          catch (...) {          catch (...) {
212              InstrumentStat = -4;              InstrumentStat = -4;
213                StatusChanged(true);
214              throw Exception("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file.");              throw Exception("gig::Engine error: Failed to load instrument, cause: Unknown exception while trying to parse gig file.");
215          }          }
216    
# Line 221  namespace LinuxSampler { namespace gig { Line 223  namespace LinuxSampler { namespace gig {
223    
224          if (pEngine) pEngine->ChangeInstrument(this, newInstrument);          if (pEngine) pEngine->ChangeInstrument(this, newInstrument);
225          else pInstrument = newInstrument;          else pInstrument = newInstrument;
226            
227            StatusChanged(true);
228      }      }
229    
230      /**      /**
# Line 338  namespace LinuxSampler { namespace gig { Line 342  namespace LinuxSampler { namespace gig {
342              default:              default:
343                  throw AudioOutputException("Invalid engine audio channel " + ToString(EngineAudioChannel));                  throw AudioOutputException("Invalid engine audio channel " + ToString(EngineAudioChannel));
344          }          }
345    
346            bStatusChanged = true;
347      }      }
348    
349      int EngineChannel::OutputChannel(uint EngineAudioChannel) {      int EngineChannel::OutputChannel(uint EngineAudioChannel) {
# Line 390  namespace LinuxSampler { namespace gig { Line 396  namespace LinuxSampler { namespace gig {
396          }          }
397          fxSends.push_back(pFxSend);          fxSends.push_back(pFxSend);
398          if (pEngine) pEngine->Enable();          if (pEngine) pEngine->Enable();
399            fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount());
400            
401          return pFxSend;          return pFxSend;
402      }      }
403    
# Line 427  namespace LinuxSampler { namespace gig { Line 435  namespace LinuxSampler { namespace gig {
435              }              }
436          }          }
437          if (pEngine) pEngine->Enable();          if (pEngine) pEngine->Enable();
438            fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount());
439      }      }
440    
441      /**      /**
# Line 633  namespace LinuxSampler { namespace gig { Line 642  namespace LinuxSampler { namespace gig {
642          MidiVolume     = 1.0;          MidiVolume     = 1.0;
643          GlobalPanLeft  = 1.0f;          GlobalPanLeft  = 1.0f;
644          GlobalPanRight = 1.0f;          GlobalPanRight = 1.0f;
645            GlobalTranspose = 0;
646          // set all MIDI controller values to zero          // set all MIDI controller values to zero
647          memset(ControllerTable, 0x00, 129);          memset(ControllerTable, 0x00, 129);
648            // reset all FX Send levels
649            for (
650                std::vector<FxSend*>::iterator iter = fxSends.begin();
651                iter != fxSends.end(); iter++
652            ) {
653                (*iter)->Reset();
654            }
655      }      }
656    
657      /**      /**

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

  ViewVC Help
Powered by ViewVC