1 |
/* |
/* |
2 |
* Copyright (c) 2014 - 2017 Christian Schoenebeck |
* Copyright (c) 2014 - 2019 Christian Schoenebeck |
3 |
* |
* |
4 |
* http://www.linuxsampler.org |
* http://www.linuxsampler.org |
5 |
* |
* |
20 |
/////////////////////////////////////////////////////////////////////// |
/////////////////////////////////////////////////////////////////////// |
21 |
// class 'EventGroup' |
// class 'EventGroup' |
22 |
|
|
23 |
void EventGroup::insert(int eventID) { |
void EventGroup::insert(vmint eventID) { |
24 |
if (contains(eventID)) return; |
if (contains(eventID)) return; |
25 |
|
|
26 |
AbstractEngine* pEngine = m_script->pEngineChannel->pEngine; |
AbstractEngine* pEngine = m_script->pEngineChannel->pEngine; |
31 |
// events die before being removed explicitly from the group by script |
// events die before being removed explicitly from the group by script |
32 |
// |
// |
33 |
// NOTE: or should we do this "dead ones" check only once in a while? |
// NOTE: or should we do this "dead ones" check only once in a while? |
34 |
int firstDead = -1; |
ssize_t firstDead = -1; |
35 |
for (int i = 0; i < size(); ++i) { |
for (size_t i = 0; i < size(); ++i) { |
36 |
if (firstDead >= 0) { |
if (firstDead >= 0) { |
37 |
if (pEngine->EventByID(eventID)) { |
if (pEngine->EventByID(eventID)) { |
38 |
remove(firstDead, i - firstDead); |
remove(firstDead, i - firstDead); |
46 |
append(eventID); |
append(eventID); |
47 |
} |
} |
48 |
|
|
49 |
void EventGroup::erase(int eventID) { |
void EventGroup::erase(vmint eventID) { |
50 |
int index = find(eventID); |
size_t index = find(eventID); |
51 |
remove(index); |
remove(index); |
52 |
} |
} |
53 |
|
|
319 |
return res; |
return res; |
320 |
} |
} |
321 |
|
|
322 |
std::map<String,VMIntRelPtr*> InstrumentScriptVM::builtInIntVariables() { |
std::map<String,VMIntPtr*> InstrumentScriptVM::builtInIntVariables() { |
323 |
// first get built-in integer variables of derived VM class |
// first get built-in integer variables of derived VM class |
324 |
std::map<String,VMIntRelPtr*> m = ScriptVM::builtInIntVariables(); |
std::map<String,VMIntPtr*> m = ScriptVM::builtInIntVariables(); |
325 |
|
|
326 |
// now add own built-in variables |
// now add own built-in variables |
327 |
m["$CC_NUM"] = &m_CC_NUM; |
m["$CC_NUM"] = &m_CC_NUM; |
348 |
return m; |
return m; |
349 |
} |
} |
350 |
|
|
351 |
std::map<String,int> InstrumentScriptVM::builtInConstIntVariables() { |
std::map<String,vmint> InstrumentScriptVM::builtInConstIntVariables() { |
352 |
// first get built-in integer variables of derived VM class |
// first get built-in integer variables of derived VM class |
353 |
std::map<String,int> m = ScriptVM::builtInConstIntVariables(); |
std::map<String,vmint> m = ScriptVM::builtInConstIntVariables(); |
354 |
|
|
355 |
m["$EVENT_STATUS_INACTIVE"] = EVENT_STATUS_INACTIVE; |
m["$EVENT_STATUS_INACTIVE"] = EVENT_STATUS_INACTIVE; |
356 |
m["$EVENT_STATUS_NOTE_QUEUE"] = EVENT_STATUS_NOTE_QUEUE; |
m["$EVENT_STATUS_NOTE_QUEUE"] = EVENT_STATUS_NOTE_QUEUE; |