1 |
/* |
/* |
2 |
* Copyright (c) 2014 - 2019 Christian Schoenebeck |
* Copyright (c) 2014 - 2020 Christian Schoenebeck |
3 |
* |
* |
4 |
* http://www.linuxsampler.org |
* http://www.linuxsampler.org |
5 |
* |
* |
61 |
handlerNote = NULL; |
handlerNote = NULL; |
62 |
handlerRelease = NULL; |
handlerRelease = NULL; |
63 |
handlerController = NULL; |
handlerController = NULL; |
64 |
|
handlerRpn = NULL; |
65 |
|
handlerNrpn = NULL; |
66 |
pEvents = NULL; |
pEvents = NULL; |
67 |
for (int i = 0; i < 128; ++i) |
for (int i = 0; i < 128; ++i) |
68 |
pKeyEvents[i] = NULL; |
pKeyEvents[i] = NULL; |
116 |
handlerNote = parserContext->eventHandlerByName("note"); |
handlerNote = parserContext->eventHandlerByName("note"); |
117 |
handlerRelease = parserContext->eventHandlerByName("release"); |
handlerRelease = parserContext->eventHandlerByName("release"); |
118 |
handlerController = parserContext->eventHandlerByName("controller"); |
handlerController = parserContext->eventHandlerByName("controller"); |
119 |
|
handlerRpn = parserContext->eventHandlerByName("rpn"); |
120 |
|
handlerNrpn = parserContext->eventHandlerByName("nrpn"); |
121 |
bHasValidScript = |
bHasValidScript = |
122 |
handlerInit || handlerNote || handlerRelease || handlerController; |
handlerInit || handlerNote || handlerRelease || handlerController || |
123 |
|
handlerRpn || handlerNrpn; |
124 |
|
|
125 |
// amount of script handlers each script event has to execute |
// amount of script handlers each script event has to execute |
126 |
int handlerExecCount = 0; |
int handlerExecCount = 0; |
127 |
if (handlerNote || handlerRelease || handlerController) // only one of these are executed after "init" handler |
if (handlerNote || handlerRelease || handlerController || handlerRpn || |
128 |
|
handlerNrpn) // only one of these are executed after "init" handler |
129 |
handlerExecCount++; |
handlerExecCount++; |
130 |
|
|
131 |
// create script event pool (if it doesn't exist already) |
// create script event pool (if it doesn't exist already) |
200 |
handlerNote = NULL; |
handlerNote = NULL; |
201 |
handlerRelease = NULL; |
handlerRelease = NULL; |
202 |
handlerController = NULL; |
handlerController = NULL; |
203 |
|
handlerRpn = NULL; |
204 |
|
handlerNrpn = NULL; |
205 |
} |
} |
206 |
bHasValidScript = false; |
bHasValidScript = false; |
207 |
} |
} |
263 |
m_EVENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, id); |
m_EVENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, id); |
264 |
m_EVENT_NOTE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Key); |
m_EVENT_NOTE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Key); |
265 |
m_EVENT_VELOCITY = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Velocity); |
m_EVENT_VELOCITY = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Velocity); |
266 |
|
m_RPN_ADDRESS = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.RPN.Parameter); |
267 |
|
m_RPN_VALUE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.RPN.Value); |
268 |
m_KEY_DOWN.size = 128; |
m_KEY_DOWN.size = 128; |
269 |
m_KEY_DOWN.readonly = true; |
m_KEY_DOWN.readonly = true; |
270 |
m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType); |
m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType); |
339 |
m["$EVENT_NOTE"] = &m_EVENT_NOTE; |
m["$EVENT_NOTE"] = &m_EVENT_NOTE; |
340 |
m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY; |
m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY; |
341 |
// m["$POLY_AT_NUM"] = &m_POLY_AT_NUM; |
// m["$POLY_AT_NUM"] = &m_POLY_AT_NUM; |
342 |
|
m["$RPN_ADDRESS"] = &m_RPN_ADDRESS; // used for both RPN and NRPN events |
343 |
|
m["$RPN_VALUE"] = &m_RPN_VALUE; // used for both RPN and NRPN events |
344 |
m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE; |
m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE; |
345 |
m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT; |
m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT; |
346 |
m["$NKSP_CALLBACK_PARENT_ID"] = &m_NKSP_CALLBACK_PARENT_ID; |
m["$NKSP_CALLBACK_PARENT_ID"] = &m_NKSP_CALLBACK_PARENT_ID; |