35 |
|
|
36 |
std::map<AbstractEngine::Format, std::map<AudioOutputDevice*,AbstractEngine*> > AbstractEngine::engines; |
std::map<AbstractEngine::Format, std::map<AudioOutputDevice*,AbstractEngine*> > AbstractEngine::engines; |
37 |
|
|
38 |
|
VMParserContext* AbstractEngine::ScriptResourceManager::Create(String Key, ScriptConsumer* pConsumer, void*& pArg) { |
39 |
|
return parent->pScriptVM->loadScript(Key); |
40 |
|
} |
41 |
|
|
42 |
|
void AbstractEngine::ScriptResourceManager::Destroy(VMParserContext* pResource, void* pArg) { |
43 |
|
delete pResource; |
44 |
|
} |
45 |
|
|
46 |
/** |
/** |
47 |
* Get an AbstractEngine object for the given AbstractEngineChannel and the |
* Get an AbstractEngine object for the given AbstractEngineChannel and the |
48 |
* given AudioOutputDevice. All engine channels which are connected to |
* given AudioOutputDevice. All engine channels which are connected to |
80 |
return pEngine; |
return pEngine; |
81 |
} |
} |
82 |
|
|
83 |
AbstractEngine::AbstractEngine() { |
AbstractEngine::AbstractEngine() : scripts(this) { |
84 |
pAudioOutputDevice = NULL; |
pAudioOutputDevice = NULL; |
85 |
pEventGenerator = NULL; |
pEventGenerator = NULL; |
86 |
pSysexBuffer = new RingBuffer<uint8_t,false>(CONFIG_SYSEX_BUFFER_SIZE, 0); |
pSysexBuffer = new RingBuffer<uint8_t,false>(CONFIG_SYSEX_BUFFER_SIZE, 0); |
90 |
FrameTime = 0; |
FrameTime = 0; |
91 |
RandomSeed = 0; |
RandomSeed = 0; |
92 |
pDedicatedVoiceChannelLeft = pDedicatedVoiceChannelRight = NULL; |
pDedicatedVoiceChannelLeft = pDedicatedVoiceChannelRight = NULL; |
93 |
|
pScriptVM = new InstrumentScriptVM; |
94 |
} |
} |
95 |
|
|
96 |
AbstractEngine::~AbstractEngine() { |
AbstractEngine::~AbstractEngine() { |
101 |
if (pSysexBuffer) delete pSysexBuffer; |
if (pSysexBuffer) delete pSysexBuffer; |
102 |
if (pDedicatedVoiceChannelLeft) delete pDedicatedVoiceChannelLeft; |
if (pDedicatedVoiceChannelLeft) delete pDedicatedVoiceChannelLeft; |
103 |
if (pDedicatedVoiceChannelRight) delete pDedicatedVoiceChannelRight; |
if (pDedicatedVoiceChannelRight) delete pDedicatedVoiceChannelRight; |
104 |
|
if (pScriptVM) delete pScriptVM; |
105 |
Unregister(); |
Unregister(); |
106 |
} |
} |
107 |
|
|