9 |
|
|
10 |
#include "InstrumentScriptVM.h" |
#include "InstrumentScriptVM.h" |
11 |
#include "../AbstractEngineChannel.h" |
#include "../AbstractEngineChannel.h" |
12 |
|
#include "../../common/global_private.h" |
13 |
|
|
14 |
namespace LinuxSampler { |
namespace LinuxSampler { |
15 |
|
|
|
// circumvents a bug in GCC 4.x which causes a sizeof() expression applied |
|
|
// on a class member to throw a compiler error, i.e. with GCC 4.4: |
|
|
// "object missing in reference to 'LinuxSampler::AbstractEngineChannel::ControllerTable'") |
|
|
// or with GCC 4.0: |
|
|
// "invalid use of non-static data member 'LinuxSampler::AbstractEngineChannel::ControllerTable'" |
|
|
#define _MEMBER_SIZEOF(T_Class, Member) sizeof(((T_Class*)NULL)->Member) |
|
|
|
|
16 |
InstrumentScriptVM::InstrumentScriptVM() : |
InstrumentScriptVM::InstrumentScriptVM() : |
17 |
m_event(NULL), m_fnPlayNote(this), m_fnIgnoreEvent(this), |
m_event(NULL), m_fnPlayNote(this), m_fnSetController(this), |
18 |
m_fnIgnoreController(this) |
m_fnIgnoreEvent(this), m_fnIgnoreController(this) |
19 |
{ |
{ |
20 |
m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable); |
m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable); |
21 |
m_CC_NUM = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.CC.Controller); |
m_CC_NUM = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.CC.Controller); |
105 |
VMFunction* InstrumentScriptVM::functionByName(const String& name) { |
VMFunction* InstrumentScriptVM::functionByName(const String& name) { |
106 |
// built-in script functions of this class |
// built-in script functions of this class |
107 |
if (name == "play_note") return &m_fnPlayNote; |
if (name == "play_note") return &m_fnPlayNote; |
108 |
|
else if (name == "set_controller") return &m_fnSetController; |
109 |
else if (name == "ignore_event") return &m_fnIgnoreEvent; |
else if (name == "ignore_event") return &m_fnIgnoreEvent; |
110 |
else if (name == "ignore_controller") return &m_fnIgnoreController; |
else if (name == "ignore_controller") return &m_fnIgnoreController; |
111 |
|
|