/[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 2114 by persson, Tue Aug 10 12:05:19 2010 UTC revision 2611 by schoenebeck, Mon Jun 9 19:20:37 2014 UTC
# Line 24  Line 24 
24    
25  #include "Engine.h"  #include "Engine.h"
26  #include "EngineChannel.h"  #include "EngineChannel.h"
27    #include "InstrumentScriptVM.h"
28    
29  namespace LinuxSampler { namespace gig {  namespace LinuxSampler { namespace gig {
30      Engine::Format Engine::GetEngineFormat() { return GIG; }      Engine::Format Engine::GetEngineFormat() { return GIG; }
31    
32        void Engine::CreateInstrumentScriptVM() {
33            dmsg(2,("gig::Engine created Giga format scriptvm\n"));
34            if (pScriptVM) return;
35            pScriptVM = new InstrumentScriptVM; // gig format specific extended script runner
36        }
37    
38      /**      /**
39       *  Reacts on supported control change commands (e.g. pitch bend wheel,       *  Reacts on supported control change commands (e.g. pitch bend wheel,
40       *  modulation wheel, aftertouch).       *  modulation wheel, aftertouch).
# Line 109  namespace LinuxSampler { namespace gig { Line 116  namespace LinuxSampler { namespace gig {
116          ProcessFxSendControllers(pChannel, itControlChangeEvent);          ProcessFxSendControllers(pChannel, itControlChangeEvent);
117      }      }
118    
119        void Engine::ProcessChannelPressure(LinuxSampler::EngineChannel* pEngineChannel, Pool<Event>::Iterator& itChannelPressureEvent) {
120            // if required: engine global aftertouch handling (apart from the per voice handling)
121        }
122    
123        void Engine::ProcessPolyphonicKeyPressure(LinuxSampler::EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNotePressureEvent) {
124            // if required: engine global aftertouch handling (apart from the per voice handling)
125        }
126    
127      DiskThread* Engine::CreateDiskThread() {      DiskThread* Engine::CreateDiskThread() {
128          return new DiskThread (          return new DiskThread (
129              iMaxDiskStreams,              iMaxDiskStreams,
# Line 210  namespace LinuxSampler { namespace gig { Line 225  namespace LinuxSampler { namespace gig {
225                  case ::gig::dimension_random:                  case ::gig::dimension_random:
226                      DimValues[i] = uint(Random() * pRegion->pDimensionDefinitions[i].zones);                      DimValues[i] = uint(Random() * pRegion->pDimensionDefinitions[i].zones);
227                      break;                      break;
228                    case ::gig::dimension_smartmidi:
229                        DimValues[i] = 0;
230                        break;
231                  case ::gig::dimension_modwheel:                  case ::gig::dimension_modwheel:
232                      DimValues[i] = pChannel->ControllerTable[1];                      DimValues[i] = pChannel->ControllerTable[1];
233                      break;                      break;
# Line 290  namespace LinuxSampler { namespace gig { Line 308  namespace LinuxSampler { namespace gig {
308          // return if this is a release triggered voice and there is no          // return if this is a release triggered voice and there is no
309          // releasetrigger dimension (could happen if an instrument          // releasetrigger dimension (could happen if an instrument
310          // change has occured between note on and off)          // change has occured between note on and off)
311          if (ReleaseTriggerVoice && VoiceType != Voice::type_release_trigger) return Pool<Voice>::Iterator();          if (ReleaseTriggerVoice && !(VoiceType & Voice::type_release_trigger)) return Pool<Voice>::Iterator();
312    
313          ::gig::DimensionRegion* pDimRgn = pRegion->GetDimensionRegionByValue(DimValues);          
314            ::gig::DimensionRegion* pDimRgn;
315            if (!itNoteOnEvent->Format.Gig.DimMask) { // normal case ...
316                pDimRgn = pRegion->GetDimensionRegionByValue(DimValues);
317            } else { // some dimension zones were overridden (i.e. by instrument script) ...
318                dmsg(3,("trigger with dim mask=%d val=%d\n", itNoteOnEvent->Format.Gig.DimMask, itNoteOnEvent->Format.Gig.DimBits));
319                int index = pRegion->GetDimensionRegionIndexByValue(DimValues);
320                index &= ~itNoteOnEvent->Format.Gig.DimMask;
321                index |=  itNoteOnEvent->Format.Gig.DimBits & itNoteOnEvent->Format.Gig.DimMask;
322                pDimRgn = pRegion->pDimensionRegions[index & 255];
323            }
324            if (!pDimRgn) return Pool<Voice>::Iterator(); // error (could not resolve dimension region)
325    
326          // no need to continue if sample is silent          // no need to continue if sample is silent
327          if (!pDimRgn->pSample || !pDimRgn->pSample->SamplesTotal) return Pool<Voice>::Iterator();          if (!pDimRgn->pSample || !pDimRgn->pSample->SamplesTotal) return Pool<Voice>::Iterator();
# Line 318  namespace LinuxSampler { namespace gig { Line 347  namespace LinuxSampler { namespace gig {
347      }      }
348    
349      String Engine::Version() {      String Engine::Version() {
350          String s = "$Revision: 1.109 $";          String s = "$Revision$";
351          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
352      }      }
353    

Legend:
Removed from v.2114  
changed lines
  Added in v.2611

  ViewVC Help
Powered by ViewVC