[SCM] calf/master: + LASH: more work on correct state restoration (side effect: creation/removal/recreaton on LASH_Restore_Data_Set)

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:38:48 UTC 2013


The following commit has been merged in the master branch:
commit 5de5f16605a61d72ed4592595c450be8f209b9f4
Author: Krzysztof Foltman <wdev at foltman.com>
Date:   Mon Jan 5 22:01:47 2009 +0000

    + LASH: more work on correct state restoration (side effect: creation/removal/recreaton on LASH_Restore_Data_Set)

diff --git a/ChangeLog b/ChangeLog
index c2c8898..4a84125 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 Version 0.0.18 (ongoing)
 
++ JACK host: use sensible port names (possibly breaking new LASH sessions)
 + Organ: added polyphony limit
 + Small plugins: added support for polymorphic port extension to allow
   the same plugins to be used for control and audio signals
diff --git a/src/jackhost.cpp b/src/jackhost.cpp
index 72f02df..b8c1462 100644
--- a/src/jackhost.cpp
+++ b/src/jackhost.cpp
@@ -221,6 +221,7 @@ struct host_session: public main_window_owner_iface
 #endif
     virtual void new_plugin(const char *name);    
     virtual void remove_plugin(plugin_ctl_iface *plugin);
+    void remove_all_plugins();
     std::string get_next_instance_name(const std::string &effect_name);
 };
 
@@ -335,6 +336,18 @@ void host_session::remove_plugin(plugin_ctl_iface *plugin)
     }
 }
 
+void host_session::remove_all_plugins()
+{
+    while(!plugins.empty())
+    {
+        plugin_ctl_iface *plugin = plugins[0];
+        client.del(0);
+        plugins.erase(plugins.begin());
+        main_win->del_plugin(plugin);
+        delete plugin;
+    }
+}
+
 bool host_session::activate_preset(int plugin_no, const std::string &preset, bool builtin)
 {
     string cur_plugin = plugins[plugin_no]->get_id();
@@ -487,6 +500,7 @@ void host_session::update_lash()
             case LASH_Restore_Data_Set:
             {
                 // printf("!!!Restore data set!!!\n");
+                remove_all_plugins();
                 while(lash_config_t *cfg = lash_get_config(lash_client)) {
                     const char *key = lash_config_get_key(cfg);
                     // printf("key = %s\n", lash_config_get_key(cfg));

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list