summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/EnablePatchEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-30 23:36:39 +0000
committerDavid Robillard <d@drobilla.net>2007-09-30 23:36:39 +0000
commit8450921d5309c5ba677997e7ca722a466c8dc222 (patch)
tree2c0fdf58f142be8f42222c3a580614cfbf0d7989 /src/libs/engine/events/EnablePatchEvent.cpp
parentffc6f457d61460ca73bb24a3d7e583f90d54ecd2 (diff)
downloadingen-8450921d5309c5ba677997e7ca722a466c8dc222.tar.gz
ingen-8450921d5309c5ba677997e7ca722a466c8dc222.tar.bz2
ingen-8450921d5309c5ba677997e7ca722a466c8dc222.zip
Working port notification for LV2 GUIs (ll-plugins VU meter works in Ingen now).
git-svn-id: http://svn.drobilla.net/lad/ingen@790 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/EnablePatchEvent.cpp')
-rw-r--r--src/libs/engine/events/EnablePatchEvent.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/libs/engine/events/EnablePatchEvent.cpp b/src/libs/engine/events/EnablePatchEvent.cpp
index d0d872bb..e380340f 100644
--- a/src/libs/engine/events/EnablePatchEvent.cpp
+++ b/src/libs/engine/events/EnablePatchEvent.cpp
@@ -26,11 +26,12 @@
namespace Ingen {
-EnablePatchEvent::EnablePatchEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& patch_path)
+EnablePatchEvent::EnablePatchEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& patch_path, bool enable)
: QueuedEvent(engine, responder, timestamp),
_patch_path(patch_path),
_patch(NULL),
- _compiled_patch(NULL)
+ _compiled_patch(NULL),
+ _enable(enable)
{
}
@@ -40,10 +41,10 @@ EnablePatchEvent::pre_process()
{
_patch = _engine.object_store()->find_patch(_patch_path);
- if (_patch != NULL) {
+ if (_enable && _patch) {
/* Any event that requires a new process order will set the patch's
- * process order to NULL if it is executed when the patch is not
- * active. So, if the PO is NULL, calculate it here */
+ * compiled_patch to NULL if it is executed when the patch is not
+ * active. So, if the CP is NULL, calculate it here */
if (_patch->compiled_patch() == NULL)
_compiled_patch = _patch->compile();
}
@@ -58,9 +59,12 @@ EnablePatchEvent::execute(ProcessContext& context)
QueuedEvent::execute(context);
if (_patch != NULL) {
- _patch->enable();
+ if (_enable)
+ _patch->enable();
+ else
+ _patch->disable();
- if (_patch->compiled_patch() == NULL)
+ if (_enable && _patch->compiled_patch() == NULL)
_patch->compiled_patch(_compiled_patch);
}
}
@@ -71,7 +75,10 @@ EnablePatchEvent::post_process()
{
if (_patch != NULL) {
_responder->respond_ok();
- _engine.broadcaster()->send_patch_enable(_patch_path);
+ if (_enable)
+ _engine.broadcaster()->send_patch_enable(_patch_path);
+ else
+ _engine.broadcaster()->send_patch_disable(_patch_path);
} else {
_responder->respond_error(string("Patch ") + _patch_path + " not found");
}