[SCM] calf/master: + jackhost: Refresh preset lists in all windows after preset add
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:36:50 UTC 2013
The following commit has been merged in the master branch:
commit 875a65ca1d8a7bea39a26117115b4f50f96b6242
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date: Thu Dec 27 18:54:28 2007 +0000
+ jackhost: Refresh preset lists in all windows after preset add
git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@49 78b06b96-2940-0410-b7fc-879d825d01d8
diff --git a/src/calf/gui.h b/src/calf/gui.h
index 968c710..4b3f815 100644
--- a/src/calf/gui.h
+++ b/src/calf/gui.h
@@ -24,6 +24,7 @@
#include <expat.h>
#include <map>
+#include <set>
#include <vector>
#include <gtk/gtk.h>
#if USE_PHAT
@@ -232,14 +233,17 @@ public:
GtkWindow *toplevel;
GtkUIManager *ui_mgr;
GtkActionGroup *std_actions, *preset_actions;
+ static std::set<plugin_gui_window *> all_windows;
plugin_gui_window();
std::string make_gui_preset_list(GtkActionGroup *grp);
void fill_gui_presets();
void create(plugin_ctl_iface *_plugin, const char *title, const char *effect);
+ static void refresh_all_presets();
~plugin_gui_window();
};
+
inline parameter_properties ¶m_control::get_props()
{
return *gui->plugin->get_param_props(param_no);
diff --git a/src/gui.cpp b/src/gui.cpp
index a41bb93..c4a10e8 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -767,10 +767,20 @@ void plugin_gui_window::create(plugin_ctl_iface *_jh, const char *title, const c
// printf("size request %dx%d\n", req.width, req.height);
gtk_window_resize(GTK_WINDOW(toplevel), max(req.width + 10, req2.width), req.height + req2.height + 10);
// gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW(sw), GTK_ADJUSTMENT(gtk_adjustment_new(0, 0, req.height, 20, 100, 100)));
-
+ all_windows.insert(this);
}
plugin_gui_window::~plugin_gui_window()
{
+ all_windows.erase(this);
delete gui;
}
+
+std::set<plugin_gui_window *> plugin_gui_window::all_windows;
+
+void plugin_gui_window::refresh_all_presets()
+{
+ for (std::set<plugin_gui_window *>::iterator i = all_windows.begin(); i != all_windows.end(); i++)
+ (*i)->fill_gui_presets();
+}
+
diff --git a/src/preset_gui.cpp b/src/preset_gui.cpp
index 22e15e9..ac9d447 100644
--- a/src/preset_gui.cpp
+++ b/src/preset_gui.cpp
@@ -61,7 +61,7 @@ void store_preset_ok(GtkAction *action, plugin_gui *gui)
global_presets = tmp;
global_presets.save(tmp.get_preset_filename().c_str());
gtk_widget_destroy(store_preset_dlg);
- gui->window->fill_gui_presets();
+ plugin_gui_window::refresh_all_presets();
}
void store_preset_cancel(GtkAction *action, plugin_gui *gui)
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list