/[svn]/linuxsampler/trunk/src/engines/common/InstrumentScriptVM.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/InstrumentScriptVM.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 2612 by schoenebeck, Tue Jun 10 13:32:16 2014 UTC
# Line 32  namespace LinuxSampler { Line 32  namespace LinuxSampler {
32    
33          // hand back old script reference and VM execution contexts          // hand back old script reference and VM execution contexts
34          // (if not done already)          // (if not done already)
35          reset();          unload();
36    
37            code = text;
38    
39          AbstractInstrumentManager* pManager =          AbstractInstrumentManager* pManager =
40              dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager());              dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager());
# Line 84  namespace LinuxSampler { Line 86  namespace LinuxSampler {
86       * is used to share equivalent scripts among multiple sampler channels, and       * is used to share equivalent scripts among multiple sampler channels, and
87       * to deallocate the parsed script once not used on any engine channel       * to deallocate the parsed script once not used on any engine channel
88       * anymore.       * anymore.
89         *
90         * Calling thid method will however not clear the @c code member variable.
91         * Thus, the script can be parsed again afterwards.
92       */       */
93      void InstrumentScript::reset() {      void InstrumentScript::unload() {
94          if (parserContext)          if (parserContext)
95              dmsg(1,("Unloading current instrument script."));              dmsg(1,("Unloading current instrument script.\n"));
96    
97          // free allocated VM execution contexts          // free allocated VM execution contexts
98          if (pEvents) {          if (pEvents) {
# Line 119  namespace LinuxSampler { Line 124  namespace LinuxSampler {
124          bHasValidScript = false;          bHasValidScript = false;
125      }      }
126    
127        /**
128         * Same as unload(), but this one also empties the @c code member variable
129         * to an empty string.
130         */
131        void InstrumentScript::resetAll() {
132            unload();
133            code.clear();
134        }
135    
136      ///////////////////////////////////////////////////////////////////////      ///////////////////////////////////////////////////////////////////////
137      // class 'InstrumentScriptVM'      // class 'InstrumentScriptVM'
138    

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

  ViewVC Help
Powered by ViewVC