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

Diff of /linuxsampler/trunk/src/engines/common/InstrumentScriptVM.cpp

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

revision 2598 by schoenebeck, Fri Jun 6 12:38:54 2014 UTC revision 2600 by schoenebeck, Sat Jun 7 00:16:03 2014 UTC
# Line 9  Line 9 
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);
# Line 111  namespace LinuxSampler { Line 105  namespace LinuxSampler {
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    

Legend:
Removed from v.2598  
changed lines
  Added in v.2600

  ViewVC Help
Powered by ViewVC