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> |
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 |
); |
); |
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) { |
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) { |