/[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 1664 by schoenebeck, Mon Feb 4 00:40:03 2008 UTC revision 1877 by schoenebeck, Fri Mar 27 12:18:12 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 36  LinuxSamplerPlugin::~LinuxSamplerPlugin( Line 37  LinuxSamplerPlugin::~LinuxSamplerPlugin(
37      if (pApp) delete (GigEdit*) pApp;      if (pApp) delete (GigEdit*) pApp;
38  }  }
39    
40    int LinuxSamplerPlugin::Main(void* pInstrument, String sTypeName, String sTypeVersion, void* /*pUserData*/) {
41        return Main(pInstrument, sTypeName, sTypeVersion);
42    }
43    
44  int LinuxSamplerPlugin::Main(void* pInstrument, String sTypeName, String sTypeVersion) {  int LinuxSamplerPlugin::Main(void* pInstrument, String sTypeName, String sTypeVersion) {
45      std::cout << "Entered Gigedit Main() loop :)\n" << std::flush;      std::cout << "Entered Gigedit Main() loop :)\n" << std::flush;
46      gig::Instrument* pGigInstr = static_cast<gig::Instrument*>(pInstrument);      gig::Instrument* pGigInstr = static_cast<gig::Instrument*>(pInstrument);
# Line 96  int LinuxSamplerPlugin::Main(void* pInst Line 101  int LinuxSamplerPlugin::Main(void* pInst
101              "gig::DimensionRegion"              "gig::DimensionRegion"
102          )          )
103      );      );
104        app->signal_sample_changed().connect(
105            sigc::bind(
106                sigc::mem_fun(
107                    *this, &LinuxSamplerPlugin::NotifyDataStructureChanged
108                ),
109                "gig::Sample"
110            )
111        );
112      app->signal_sample_ref_changed().connect(      app->signal_sample_ref_changed().connect(
113          sigc::mem_fun(*this, &LinuxSamplerPlugin::NotifySampleReferenceChanged)          sigc::mem_fun(*this, &LinuxSamplerPlugin::NotifySampleReferenceChanged)
114      );      );
# Line 123  int LinuxSamplerPlugin::Main(void* pInst Line 136  int LinuxSamplerPlugin::Main(void* pInst
136  }  }
137    
138  bool LinuxSamplerPlugin::__onPollPeriod() {  bool LinuxSamplerPlugin::__onPollPeriod() {
139        #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE
140      GigEdit* app = (GigEdit*) pApp;      GigEdit* app = (GigEdit*) pApp;
141      if (!NotesChanged()) return true;      if (!NotesChanged()) return true;
142      for (int iKey = 0; iKey < 128; iKey++)      for (int iKey = 0; iKey < 128; iKey++)
# Line 131  bool LinuxSamplerPlugin::__onPollPeriod( Line 145  bool LinuxSamplerPlugin::__onPollPeriod(
145                  app->on_note_on_event(iKey, NoteOnVelocity(iKey)) :                  app->on_note_on_event(iKey, NoteOnVelocity(iKey)) :
146                  app->on_note_off_event(iKey, NoteOffVelocity(iKey));                  app->on_note_off_event(iKey, NoteOffVelocity(iKey));
147      return true;      return true;
148        #else
149        return false;
150        #endif
151  }  }
152    
153  void LinuxSamplerPlugin::__onSamplesToBeRemoved(std::list<gig::Sample*> lSamples) {  void LinuxSamplerPlugin::__onSamplesToBeRemoved(std::list<gig::Sample*> lSamples) {
# Line 145  void LinuxSamplerPlugin::__onSamplesToBe Line 162  void LinuxSamplerPlugin::__onSamplesToBe
162  }  }
163    
164  void LinuxSamplerPlugin::__onVirtualKeyboardKeyHit(int Key, int Velocity) {  void LinuxSamplerPlugin::__onVirtualKeyboardKeyHit(int Key, int Velocity) {
165        #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE
166      SendNoteOnToSampler(Key, Velocity);      SendNoteOnToSampler(Key, Velocity);
167        #endif
168  }  }
169    
170  void LinuxSamplerPlugin::__onVirtualKeyboardKeyReleased(int Key, int Velocity) {  void LinuxSamplerPlugin::__onVirtualKeyboardKeyReleased(int Key, int Velocity) {
171        #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE
172      SendNoteOffToSampler(Key, Velocity);      SendNoteOffToSampler(Key, Velocity);
173        #endif
174  }  }
175    
176  bool LinuxSamplerPlugin::IsTypeSupported(String sTypeName, String sTypeVersion) {  bool LinuxSamplerPlugin::IsTypeSupported(String sTypeName, String sTypeVersion) {

Legend:
Removed from v.1664  
changed lines
  Added in v.1877

  ViewVC Help
Powered by ViewVC