/[svn]/gigedit/trunk/src/plugin/linuxsamplerplugin.cpp
ViewVC logotype

Diff of /gigedit/trunk/src/plugin/linuxsamplerplugin.cpp

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

revision 1660 by schoenebeck, Sun Feb 3 00:19:55 2008 UTC revision 1853 by schoenebeck, Sun Mar 1 22:26:36 2009 UTC
# Line 21  Line 21 
21    
22  #include <linuxsampler/plugins/InstrumentEditorFactory.h>  #include <linuxsampler/plugins/InstrumentEditorFactory.h>
23  #include "../gigedit/gigedit.h"  #include "../gigedit/gigedit.h"
24    #include "../gigedit/global.h"
25    
26  #include <iostream>  #include <iostream>
27  #include <sigc++/bind.h>  #include <sigc++/bind.h>
# Line 96  int LinuxSamplerPlugin::Main(void* pInst Line 97  int LinuxSamplerPlugin::Main(void* pInst
97              "gig::DimensionRegion"              "gig::DimensionRegion"
98          )          )
99      );      );
100        app->signal_sample_changed().connect(
101            sigc::bind(
102                sigc::mem_fun(
103                    *this, &LinuxSamplerPlugin::NotifyDataStructureChanged
104                ),
105                "gig::Sample"
106            )
107        );
108      app->signal_sample_ref_changed().connect(      app->signal_sample_ref_changed().connect(
109          sigc::mem_fun(*this, &LinuxSamplerPlugin::NotifySampleReferenceChanged)          sigc::mem_fun(*this, &LinuxSamplerPlugin::NotifySampleReferenceChanged)
110      );      );
# Line 123  int LinuxSamplerPlugin::Main(void* pInst Line 132  int LinuxSamplerPlugin::Main(void* pInst
132  }  }
133    
134  bool LinuxSamplerPlugin::__onPollPeriod() {  bool LinuxSamplerPlugin::__onPollPeriod() {
135        #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE
136      GigEdit* app = (GigEdit*) pApp;      GigEdit* app = (GigEdit*) pApp;
137      if (!NotesChanged()) return true;      if (!NotesChanged()) return true;
138      for (int iKey = 0; iKey < 128; iKey++)      for (int iKey = 0; iKey < 128; iKey++)
139          if (NoteChanged(iKey))          if (NoteChanged(iKey))
140              NoteIsActive(iKey) ? // we don't care about velocity yet              NoteIsActive(iKey) ?
141                  app->on_note_on_event(iKey, 127) :                  app->on_note_on_event(iKey, NoteOnVelocity(iKey)) :
142                  app->on_note_off_event(iKey, 127);                  app->on_note_off_event(iKey, NoteOffVelocity(iKey));
143      return true;      return true;
144        #else
145        return false;
146        #endif
147  }  }
148    
149  void LinuxSamplerPlugin::__onSamplesToBeRemoved(std::list<gig::Sample*> lSamples) {  void LinuxSamplerPlugin::__onSamplesToBeRemoved(std::list<gig::Sample*> lSamples) {
# Line 145  void LinuxSamplerPlugin::__onSamplesToBe Line 158  void LinuxSamplerPlugin::__onSamplesToBe
158  }  }
159    
160  void LinuxSamplerPlugin::__onVirtualKeyboardKeyHit(int Key, int Velocity) {  void LinuxSamplerPlugin::__onVirtualKeyboardKeyHit(int Key, int Velocity) {
161        #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE
162      SendNoteOnToSampler(Key, Velocity);      SendNoteOnToSampler(Key, Velocity);
163        #endif
164  }  }
165    
166  void LinuxSamplerPlugin::__onVirtualKeyboardKeyReleased(int Key, int Velocity) {  void LinuxSamplerPlugin::__onVirtualKeyboardKeyReleased(int Key, int Velocity) {
167        #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE
168      SendNoteOffToSampler(Key, Velocity);      SendNoteOffToSampler(Key, Velocity);
169        #endif
170  }  }
171    
172  bool LinuxSamplerPlugin::IsTypeSupported(String sTypeName, String sTypeVersion) {  bool LinuxSamplerPlugin::IsTypeSupported(String sTypeName, String sTypeVersion) {

Legend:
Removed from v.1660  
changed lines
  Added in v.1853

  ViewVC Help
Powered by ViewVC