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

Diff of /linuxsampler/trunk/src/engines/AbstractEngine.cpp

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

revision 2606 by persson, Sun Jun 8 05:42:56 2014 UTC revision 2611 by schoenebeck, Mon Jun 9 19:20:37 2014 UTC
# Line 35  namespace LinuxSampler { Line 35  namespace LinuxSampler {
35    
36      std::map<AbstractEngine::Format, std::map<AudioOutputDevice*,AbstractEngine*> > AbstractEngine::engines;      std::map<AbstractEngine::Format, std::map<AudioOutputDevice*,AbstractEngine*> > AbstractEngine::engines;
37    
     VMParserContext* AbstractEngine::ScriptResourceManager::Create(String Key, ScriptConsumer* pConsumer, void*& pArg) {  
         return parent->pScriptVM->loadScript(Key);  
     }  
   
     void AbstractEngine::ScriptResourceManager::Destroy(VMParserContext* pResource, void* pArg) {  
         delete pResource;  
     }  
   
38      /**      /**
39       * Get an AbstractEngine object for the given AbstractEngineChannel and the       * Get an AbstractEngine object for the given AbstractEngineChannel and the
40       * given AudioOutputDevice. All engine channels which are connected to       * given AudioOutputDevice. All engine channels which are connected to
# Line 69  namespace LinuxSampler { Line 61  namespace LinuxSampler {
61          } else { // create a new engine (and disk thread) instance for the given audio output device          } else { // create a new engine (and disk thread) instance for the given audio output device
62              dmsg(4,("Creating new Engine.\n"));              dmsg(4,("Creating new Engine.\n"));
63              pEngine = (AbstractEngine*) EngineFactory::Create(pChannel->EngineName());              pEngine = (AbstractEngine*) EngineFactory::Create(pChannel->EngineName());
64                pEngine->CreateInstrumentScriptVM();
65              pEngine->Connect(pDevice);              pEngine->Connect(pDevice);
66              engines[pChannel->GetEngineFormat()][pDevice] = pEngine;              engines[pChannel->GetEngineFormat()][pDevice] = pEngine;
67          }          }
# Line 80  namespace LinuxSampler { Line 73  namespace LinuxSampler {
73          return pEngine;          return pEngine;
74      }      }
75    
76      AbstractEngine::AbstractEngine() : scripts(this) {      AbstractEngine::AbstractEngine() {
77          pAudioOutputDevice = NULL;          pAudioOutputDevice = NULL;
78          pEventGenerator    = NULL;          pEventGenerator    = NULL;
79          pSysexBuffer       = new RingBuffer<uint8_t,false>(CONFIG_SYSEX_BUFFER_SIZE, 0);          pSysexBuffer       = new RingBuffer<uint8_t,false>(CONFIG_SYSEX_BUFFER_SIZE, 0);
# Line 90  namespace LinuxSampler { Line 83  namespace LinuxSampler {
83          FrameTime          = 0;          FrameTime          = 0;
84          RandomSeed         = 0;          RandomSeed         = 0;
85          pDedicatedVoiceChannelLeft = pDedicatedVoiceChannelRight = NULL;          pDedicatedVoiceChannelLeft = pDedicatedVoiceChannelRight = NULL;
86          pScriptVM          = CreateInstrumentScriptVM();          pScriptVM          = NULL;
87      }      }
88    
89      AbstractEngine::~AbstractEngine() {      AbstractEngine::~AbstractEngine() {
# Line 105  namespace LinuxSampler { Line 98  namespace LinuxSampler {
98          Unregister();          Unregister();
99      }      }
100    
101      /**      void AbstractEngine::CreateInstrumentScriptVM() {
102       * Allocates a sampler format independent real-time instrument script          dmsg(2,("Created sampler format independent instrument script VM.\n"));
103       * runner. This method is overriden by sampler engines in case they have          if (pScriptVM) return;
104       * their own implementation of the script VM, with script feature extensions          pScriptVM = new InstrumentScriptVM; // format independent script runner
      * required for their sampler format.  
      */  
     InstrumentScriptVM* AbstractEngine::CreateInstrumentScriptVM() {  
         return new InstrumentScriptVM; // format independent script runner  
105      }      }
106    
107      /**      /**

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

  ViewVC Help
Powered by ViewVC