/[svn]/linuxsampler/trunk/src/scriptvm/ScriptVM.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/ScriptVM.cpp

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

revision 2611 by schoenebeck, Mon Jun 9 19:20:37 2014 UTC revision 2837 by persson, Sun Aug 23 06:14:00 2015 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 Christian Schoenebeck   * Copyright (c) 2014 - 2015 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 10  Line 10 
10  #include "ScriptVM.h"  #include "ScriptVM.h"
11    
12  #include <string.h>  #include <string.h>
13    #include <assert.h>
14  #include "../common/global_private.h"  #include "../common/global_private.h"
15  #include "tree.h"  #include "tree.h"
16    
# Line 110  namespace LinuxSampler { Line 111  namespace LinuxSampler {
111          context->createScanner(is);          context->createScanner(is);
112    
113          InstrScript_parse(context);          InstrScript_parse(context);
114          dmsg(2,("Allocating %d bytes of global int VM memory.\n", context->globalIntVarCount * sizeof(int)));          dmsg(2,("Allocating %ld bytes of global int VM memory.\n", long(context->globalIntVarCount * sizeof(int))));
115          dmsg(2,("Allocating %d of global VM string variables.\n", context->globalStrVarCount));          dmsg(2,("Allocating %d of global VM string variables.\n", context->globalStrVarCount));
116          if (!context->globalIntMemory)          if (!context->globalIntMemory)
117              context->globalIntMemory = new ArrayList<int>();              context->globalIntMemory = new ArrayList<int>();
# Line 152  namespace LinuxSampler { Line 153  namespace LinuxSampler {
153                  _requiredMaxStackSizeFor(&*parserCtx->handlers);                  _requiredMaxStackSizeFor(&*parserCtx->handlers);
154          }          }
155          execCtx->stack.resize(parserCtx->requiredMaxStackSize);          execCtx->stack.resize(parserCtx->requiredMaxStackSize);
156          dmsg(2,("Created VM exec context with %d bytes VM stack size.\n",          dmsg(2,("Created VM exec context with %ld bytes VM stack size.\n",
157                  parserCtx->requiredMaxStackSize * sizeof(ExecContext::StackFrame)));                  long(parserCtx->requiredMaxStackSize * sizeof(ExecContext::StackFrame))));
158          //printf("execCtx=0x%lx\n", (uint64_t)execCtx);          //printf("execCtx=0x%lx\n", (uint64_t)execCtx);
159          const int polySize = parserCtx->polyphonicIntVarCount;          const int polySize = parserCtx->polyphonicIntVarCount;
160          execCtx->polyphonicIntMemory.resize(polySize);          execCtx->polyphonicIntMemory.resize(polySize);
161          memset(&execCtx->polyphonicIntMemory[0], 0, polySize * sizeof(int));          memset(&execCtx->polyphonicIntMemory[0], 0, polySize * sizeof(int));
162    
163          dmsg(2,("Allocated %d bytes polyphonic memory.\n", polySize * sizeof(int)));          dmsg(2,("Allocated %ld bytes polyphonic memory.\n", long(polySize * sizeof(int))));
164          return execCtx;          return execCtx;
165      }      }
166    
# Line 167  namespace LinuxSampler { Line 168  namespace LinuxSampler {
168          if (name == "message") return &fnMessage;          if (name == "message") return &fnMessage;
169          else if (name == "exit") return &fnExit;          else if (name == "exit") return &fnExit;
170          else if (name == "wait") return &fnWait;          else if (name == "wait") return &fnWait;
171            else if (name == "abs") return &fnAbs;
172            else if (name == "random") return &fnRandom;
173            else if (name == "num_elements") return &fnNumElements;
174          return NULL;          return NULL;
175      }      }
176    

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

  ViewVC Help
Powered by ViewVC