/[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 2689 by schoenebeck, Sun Jan 4 17:19:19 2015 UTC revision 2903 by schoenebeck, Tue May 3 14:08:34 2016 UTC
# Line 36  LinuxSamplerPlugin::LinuxSamplerPlugin() Line 36  LinuxSamplerPlugin::LinuxSamplerPlugin()
36  }  }
37    
38  LinuxSamplerPlugin::~LinuxSamplerPlugin() {  LinuxSamplerPlugin::~LinuxSamplerPlugin() {
39      if (pApp) delete (GigEdit*) pApp;      if (pApp) delete static_cast<GigEdit*>(pApp);
40  }  }
41    
42  int LinuxSamplerPlugin::Main(void* pInstrument, String sTypeName, String sTypeVersion, void* /*pUserData*/) {  int LinuxSamplerPlugin::Main(void* pInstrument, String sTypeName, String sTypeVersion, void* /*pUserData*/) {
# Line 46  int LinuxSamplerPlugin::Main(void* pInst Line 46  int LinuxSamplerPlugin::Main(void* pInst
46  int LinuxSamplerPlugin::Main(void* pInstrument, String sTypeName, String sTypeVersion) {  int LinuxSamplerPlugin::Main(void* pInstrument, String sTypeName, String sTypeVersion) {
47      std::cout << "Entered Gigedit Main() loop :)\n" << std::flush;      std::cout << "Entered Gigedit Main() loop :)\n" << std::flush;
48      gig::Instrument* pGigInstr = static_cast<gig::Instrument*>(pInstrument);      gig::Instrument* pGigInstr = static_cast<gig::Instrument*>(pInstrument);
49      GigEdit* app = (GigEdit*) pApp;      GigEdit* app = static_cast<GigEdit*>(pApp);
50    
51      // connect notification signals      // connect notification signals
52      app->signal_file_structure_to_be_changed().connect(      app->signal_file_structure_to_be_changed().connect(
# Line 124  int LinuxSamplerPlugin::Main(void* pInst Line 124  int LinuxSamplerPlugin::Main(void* pInst
124      app->signal_switch_sampler_instrument().connect(      app->signal_switch_sampler_instrument().connect(
125          sigc::mem_fun(*this, &LinuxSamplerPlugin::__requestSamplerToSwitchInstrument)          sigc::mem_fun(*this, &LinuxSamplerPlugin::__requestSamplerToSwitchInstrument)
126      );      );
127        app->signal_script_to_be_changed.connect(
128            sigc::bind(
129                sigc::mem_fun(
130                    *this, &LinuxSamplerPlugin::NotifyDataStructureToBeChanged
131                ),
132                "gig::Script"
133            )
134        );
135        app->signal_script_changed.connect(
136            sigc::bind(
137                sigc::mem_fun(
138                    *this, &LinuxSamplerPlugin::NotifyDataStructureChanged
139                ),
140                "gig::Script"
141            )
142        );
143    
144      // register a timeout job to gigedit's main loop, so we can poll the      // register a timeout job to gigedit's main loop, so we can poll the
145      // the sampler periodically for MIDI events (I HOPE it works on all      // the sampler periodically for MIDI events (I HOPE it works on all
# Line 142  int LinuxSamplerPlugin::Main(void* pInst Line 158  int LinuxSamplerPlugin::Main(void* pInst
158    
159  bool LinuxSamplerPlugin::__onPollPeriod() {  bool LinuxSamplerPlugin::__onPollPeriod() {
160      #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE      #if HAVE_LINUXSAMPLER_VIRTUAL_MIDI_DEVICE
161      GigEdit* app = (GigEdit*) pApp;      GigEdit* app = static_cast<GigEdit*>(pApp);
162      if (!NotesChanged()) return true;      if (!NotesChanged()) return true;
163      for (int iKey = 0; iKey < 128; iKey++)      for (int iKey = 0; iKey < 128; iKey++)
164          if (NoteChanged(iKey))          if (NoteChanged(iKey))
# Line 160  void LinuxSamplerPlugin::__onSamplesToBe Line 176  void LinuxSamplerPlugin::__onSamplesToBe
176      std::set<void*> samples;      std::set<void*> samples;
177      for (      for (
178          std::list<gig::Sample*>::iterator iter = lSamples.begin();          std::list<gig::Sample*>::iterator iter = lSamples.begin();
179          iter != lSamples.end(); iter++          iter != lSamples.end(); ++iter
180      ) samples.insert((void*)*iter);      ) samples.insert((void*)*iter);
181      // finally send notification to sampler      // finally send notification to sampler
182      NotifySamplesToBeRemoved(samples);      NotifySamplesToBeRemoved(samples);

Legend:
Removed from v.2689  
changed lines
  Added in v.2903

  ViewVC Help
Powered by ViewVC