--- gigedit/trunk/src/plugin/linuxsamplerplugin.cpp 2008/02/02 08:18:19 1656 +++ gigedit/trunk/src/plugin/linuxsamplerplugin.cpp 2008/02/03 00:19:55 1660 @@ -100,6 +100,13 @@ sigc::mem_fun(*this, &LinuxSamplerPlugin::NotifySampleReferenceChanged) ); + app->signal_keyboard_key_hit().connect( + sigc::mem_fun(*this, &LinuxSamplerPlugin::__onVirtualKeyboardKeyHit) + ); + app->signal_keyboard_key_released().connect( + sigc::mem_fun(*this, &LinuxSamplerPlugin::__onVirtualKeyboardKeyReleased) + ); + // register a timeout job to gigedit's main loop, so we can poll the // the sampler periodically for MIDI events (I HOPE it works on all // archs, because gigedit is actually running in another thread than @@ -137,6 +144,14 @@ NotifySamplesToBeRemoved(samples); } +void LinuxSamplerPlugin::__onVirtualKeyboardKeyHit(int Key, int Velocity) { + SendNoteOnToSampler(Key, Velocity); +} + +void LinuxSamplerPlugin::__onVirtualKeyboardKeyReleased(int Key, int Velocity) { + SendNoteOffToSampler(Key, Velocity); +} + bool LinuxSamplerPlugin::IsTypeSupported(String sTypeName, String sTypeVersion) { return sTypeName == gig::libraryName() && sTypeVersion == gig::libraryVersion();