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

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

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

revision 3556 by schoenebeck, Sun May 28 14:46:14 2017 UTC revision 3557 by schoenebeck, Sun Aug 18 00:06:04 2019 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014-2017 Christian Schoenebeck   * Copyright (c) 2014-2019 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 22  namespace LinuxSampler { namespace gig { Line 22  namespace LinuxSampler { namespace gig {
22      {      {
23      }      }
24    
25      bool InstrumentScriptVMFunction_gig_set_dim_zone::acceptsArgType(int iArg, ExprType_t type) const {      bool InstrumentScriptVMFunction_gig_set_dim_zone::acceptsArgType(vmint iArg, ExprType_t type) const {
26          return type == INT_EXPR || type == INT_ARR_EXPR;          return type == INT_EXPR || type == INT_ARR_EXPR;
27      }      }
28    
# Line 30  namespace LinuxSampler { namespace gig { Line 30  namespace LinuxSampler { namespace gig {
30          EngineChannel* pEngineChannel =          EngineChannel* pEngineChannel =
31              static_cast<EngineChannel*>(m_vm->m_event->cause.pEngineChannel);              static_cast<EngineChannel*>(m_vm->m_event->cause.pEngineChannel);
32    
33          int dim  = args->arg(1)->asInt()->evalInt();          vmint dim  = args->arg(1)->asInt()->evalInt();
34          int zone = args->arg(2)->asInt()->evalInt();          vmint zone = args->arg(2)->asInt()->evalInt();
35    
36          if (args->arg(0)->exprType() == INT_EXPR) {          if (args->arg(0)->exprType() == INT_EXPR) {
37              const ScriptID id = args->arg(0)->asInt()->evalInt();              const ScriptID id = args->arg(0)->asInt()->evalInt();
# Line 67  namespace LinuxSampler { namespace gig { Line 67  namespace LinuxSampler { namespace gig {
67                  baseBits += pRegion->pDimensionDefinitions[i].bits;                  baseBits += pRegion->pDimensionDefinitions[i].bits;
68              }              }
69              if (idx < 0) {              if (idx < 0) {
70                  dmsg(2,("gig_set_dim_zone(): no such gig dimension %d\n", dim));                  dmsg(2,("gig_set_dim_zone(): no such gig dimension %lld\n", dim));
71                  return successResult(); // no such dimension found                  return successResult(); // no such dimension found
72              }              }
73    
# Line 81  namespace LinuxSampler { namespace gig { Line 81  namespace LinuxSampler { namespace gig {
81              dmsg(3,("gig_set_dim_zone(): success, mask=%d bits=%d\n", pNote->Format.Gig.DimMask, pNote->Format.Gig.DimBits));              dmsg(3,("gig_set_dim_zone(): success, mask=%d bits=%d\n", pNote->Format.Gig.DimMask, pNote->Format.Gig.DimBits));
82          } else if (args->arg(0)->exprType() == INT_ARR_EXPR) {          } else if (args->arg(0)->exprType() == INT_ARR_EXPR) {
83              VMIntArrayExpr* ids = args->arg(0)->asIntArray();              VMIntArrayExpr* ids = args->arg(0)->asIntArray();
84              for (int i = 0; i < ids->arraySize(); ++i) {              for (vmint i = 0; i < ids->arraySize(); ++i) {
85                  const ScriptID id = ids->evalIntElement(i);                  const ScriptID id = ids->evalIntElement(i);
86                  if (!id || !id.isNoteID()) continue;                  if (!id || !id.isNoteID()) continue;
87    
# Line 130  namespace LinuxSampler { namespace gig { Line 130  namespace LinuxSampler { namespace gig {
130          EngineChannel* pEngineChannel =          EngineChannel* pEngineChannel =
131              static_cast<EngineChannel*>(m_vm->m_event->cause.pEngineChannel);              static_cast<EngineChannel*>(m_vm->m_event->cause.pEngineChannel);
132    
133          int key1 = args->arg(0)->asInt()->evalInt();          vmint key1 = args->arg(0)->asInt()->evalInt();
134          int key2 = args->arg(1)->asInt()->evalInt();          vmint key2 = args->arg(1)->asInt()->evalInt();
135    
136          if (key1 < 0 || key1 > 127) {          if (key1 < 0 || key1 > 127) {
137              wrnMsg("same_region(): key number for argument 1 out of range");              wrnMsg("same_region(): key number for argument 1 out of range");
# Line 142  namespace LinuxSampler { namespace gig { Line 142  namespace LinuxSampler { namespace gig {
142              return successResult(-1);              return successResult(-1);
143          }          }
144    
145          ::gig::Region* pRgn1 = pEngineChannel->pInstrument->GetRegion(key1);          ::gig::Region* pRgn1 = pEngineChannel->pInstrument->GetRegion((int)key1);
146          ::gig::Region* pRgn2 = pEngineChannel->pInstrument->GetRegion(key2);          ::gig::Region* pRgn2 = pEngineChannel->pInstrument->GetRegion((int)key2);
147    
148          if (!pRgn1 && !pRgn2)          if (!pRgn1 && !pRgn2)
149              return successResult(5);              return successResult(5);

Legend:
Removed from v.3556  
changed lines
  Added in v.3557

  ViewVC Help
Powered by ViewVC