/[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 1655 by schoenebeck, Wed Jan 30 02:20:48 2008 UTC revision 1656 by schoenebeck, Sat Feb 2 08:18:19 2008 UTC
# Line 20  Line 20 
20  #include "linuxsamplerplugin.h"  #include "linuxsamplerplugin.h"
21    
22  #include <linuxsampler/plugins/InstrumentEditorFactory.h>  #include <linuxsampler/plugins/InstrumentEditorFactory.h>
23    #include "../gigedit/gigedit.h"
24    
25  #include <iostream>  #include <iostream>
26  #include <sigc++/bind.h>  #include <sigc++/bind.h>
27    #include <glibmm/main.h>
28    
29  REGISTER_INSTRUMENT_EDITOR(LinuxSamplerPlugin)  REGISTER_INSTRUMENT_EDITOR(LinuxSamplerPlugin)
30    
# Line 98  int LinuxSamplerPlugin::Main(void* pInst Line 100  int LinuxSamplerPlugin::Main(void* pInst
100          sigc::mem_fun(*this, &LinuxSamplerPlugin::NotifySampleReferenceChanged)          sigc::mem_fun(*this, &LinuxSamplerPlugin::NotifySampleReferenceChanged)
101      );      );
102    
103      app->add_timeout_job(this);      // register a timeout job to gigedit's main loop, so we can poll the
104        // the sampler periodically for MIDI events (I HOPE it works on all
105        // archs, because gigedit is actually running in another thread than
106        // the one that is calling this timeout handler register code)
107        const Glib::RefPtr<Glib::TimeoutSource> timeout_source =
108            Glib::TimeoutSource::create(100); // poll every 100ms
109        timeout_source->connect(
110            sigc::mem_fun(this, &LinuxSamplerPlugin::__onPollPeriod)
111        );
112        timeout_source->attach(Glib::MainContext::get_default());
113    
114      // run gigedit application      // run gigedit application
115      return app->run(pGigInstr);      return app->run(pGigInstr);
116  }  }
117    
118  bool LinuxSamplerPlugin::runGigEditJob() {  bool LinuxSamplerPlugin::__onPollPeriod() {
119      GigEdit* app = (GigEdit*) pApp;      GigEdit* app = (GigEdit*) pApp;
120      if (!NotesChanged()) return true;      if (!NotesChanged()) return true;
121      for (int iKey = 0; iKey < 128; iKey++)      for (int iKey = 0; iKey < 128; iKey++)

Legend:
Removed from v.1655  
changed lines
  Added in v.1656

  ViewVC Help
Powered by ViewVC