/[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 1723 by schoenebeck, Sun Apr 20 08:53:39 2008 UTC revision 1835 by iliev, Mon Feb 16 17:56:50 2009 UTC
# Line 24  Line 24 
24  #include "EngineChannel.h"  #include "EngineChannel.h"
25    
26  #include "../../common/global_private.h"  #include "../../common/global_private.h"
27    #include "../../Sampler.h"
28    
29  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
30    
# Line 59  namespace LinuxSampler { namespace gig { Line 60  namespace LinuxSampler { namespace gig {
60          SoloMode       = false;          SoloMode       = false;
61          PortamentoMode = false;          PortamentoMode = false;
62          PortamentoTime = CONFIG_PORTAMENTO_TIME_DEFAULT;          PortamentoTime = CONFIG_PORTAMENTO_TIME_DEFAULT;
63    
64            // reset the instrument change command struct (need to be done
65            // twice, as it is double buffered)
66            {
67                instrument_change_command_t& cmd = InstrumentChangeCommand.GetConfigForUpdate();
68                cmd.pDimRegionsInUse = NULL;
69                cmd.pInstrument = NULL;
70                cmd.bChangeInstrument = false;
71            }
72            {
73                instrument_change_command_t& cmd = InstrumentChangeCommand.SwitchConfig();
74                cmd.pDimRegionsInUse = NULL;
75                cmd.pInstrument = NULL;
76                cmd.bChangeInstrument = false;
77            }
78      }      }
79    
80      EngineChannel::~EngineChannel() {      EngineChannel::~EngineChannel() {
81          DisconnectAudioOutputDevice();          DisconnectAudioOutputDevice();
82    
83            // In case the channel was removed before the instrument was
84            // fully loaded, try to give back instrument again (see bug #113)
85            instrument_change_command_t& cmd = ChangeInstrument(NULL);
86            if (cmd.pInstrument) {
87                    Engine::instruments.HandBack(cmd.pInstrument, this);
88            }
89            ///////
90    
91          if (pEventQueue) delete pEventQueue;          if (pEventQueue) delete pEventQueue;
92          if (pActiveKeys) delete pActiveKeys;          if (pActiveKeys) delete pActiveKeys;
93          if (pMIDIKeyInfo) delete[] pMIDIKeyInfo;          if (pMIDIKeyInfo) delete[] pMIDIKeyInfo;
# Line 329  namespace LinuxSampler { namespace gig { Line 354  namespace LinuxSampler { namespace gig {
354                  // release the currently loaded instrument                  // release the currently loaded instrument
355                  Engine::instruments.HandBackInstrument(cmd.pInstrument, this, d);                  Engine::instruments.HandBackInstrument(cmd.pInstrument, this, d);
356              }              }
357    
358              if (d) delete d;              if (d) delete d;
359    
360              // release all active dimension regions to resource              // release all active dimension regions to resource
# Line 451  namespace LinuxSampler { namespace gig { Line 477  namespace LinuxSampler { namespace gig {
477          }          }
478          fxSends.push_back(pFxSend);          fxSends.push_back(pFxSend);
479          if (pEngine) pEngine->Enable();          if (pEngine) pEngine->Enable();
480          fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount());          fireFxSendCountChanged(GetSamplerChannel()->Index(), GetFxSendCount());
481    
482          return pFxSend;          return pFxSend;
483      }      }
# Line 490  namespace LinuxSampler { namespace gig { Line 516  namespace LinuxSampler { namespace gig {
516              }              }
517          }          }
518          if (pEngine) pEngine->Enable();          if (pEngine) pEngine->Enable();
519          fireFxSendCountChanged(iSamplerChannelIndex, GetFxSendCount());          fireFxSendCountChanged(GetSamplerChannel()->Index(), GetFxSendCount());
520      }      }
521    
522      /**      /**

Legend:
Removed from v.1723  
changed lines
  Added in v.1835

  ViewVC Help
Powered by ViewVC