#include "processor_box.h"
#include "keyboard.h"
#include "latency_gui.h"
+#include "plugin_dspload_ui.h"
#include "plugin_eq_gui.h"
+#include "timers.h"
#include "new_plugin_preset_dialog.h"
#include "pbd/i18n.h"
using namespace Gtkmm2ext;
using namespace Gtk;
+
PluginUIWindow::PluginUIWindow (
boost::shared_ptr<PluginInsert> insert,
bool scrollable,
, pin_management_button (_("Pinout"))
, description_expander (_("Description"))
, plugin_analysis_expander (_("Plugin analysis"))
+ , cpuload_expander (_("CPU Profile"))
, latency_gui (0)
, latency_dialog (0)
, eqgui (0)
+ , stats_gui (0)
{
_preset_modified.set_size_request (16, -1);
_preset_combo.set_text("(default)");
plugin_analysis_expander.property_expanded().signal_changed().connect( sigc::mem_fun(*this, &PlugUIBase::toggle_plugin_analysis));
plugin_analysis_expander.set_expanded(false);
+ cpuload_expander.property_expanded().signal_changed().connect( sigc::mem_fun(*this, &PlugUIBase::toggle_cpuload_display));
+ cpuload_expander.set_expanded(false);
+
insert->DropReferences.connect (death_connection, invalidator (*this), boost::bind (&PlugUIBase::plugin_going_away, this), gui_context());
plugin->PresetAdded.connect (*this, invalidator (*this), boost::bind (&PlugUIBase::preset_added_or_removed, this), gui_context ());
PlugUIBase::~PlugUIBase()
{
delete eqgui;
+ delete stats_gui;
delete latency_gui;
}
wr.height -= child_height;
toplevel->resize (wr.width, wr.height);
}
-
}
}
-
void
PlugUIBase::toggle_plugin_analysis()
{
}
}
+void
+PlugUIBase::toggle_cpuload_display()
+{
+ if (cpuload_expander.get_expanded() && !cpuload_expander.get_child()) {
+ if (stats_gui == 0) {
+ stats_gui = new PluginLoadStatsGui (insert);
+ }
+ cpuload_expander.add (*stats_gui);
+ cpuload_expander.show_all();
+ stats_gui->start_updating ();
+ }
+
+ if (!cpuload_expander.get_expanded()) {
+ const int child_height = cpuload_expander.get_child ()->get_height ();
+
+ stats_gui->hide ();
+ stats_gui->stop_updating ();
+ cpuload_expander.remove();
+
+ Gtk::Window *toplevel = (Gtk::Window*) cpuload_expander.get_ancestor (GTK_TYPE_WINDOW);
+
+ if (toplevel) {
+ Gtk::Requisition wr;
+ toplevel->get_size (wr.width, wr.height);
+ wr.height -= child_height;
+ toplevel->resize (wr.width, wr.height);
+ }
+ }
+
+}
+
void
PlugUIBase::update_preset_list ()
{
}
--_no_load_preset;
- save_button.set_sensitive (!p.uri.empty() && p.user);
delete_button.set_sensitive (!p.uri.empty() && p.user);
-
update_preset_modified ();
}
void
PlugUIBase::update_preset_modified ()
{
+ Plugin::PresetRecord p = plugin->last_preset();
- if (plugin->last_preset().uri.empty()) {
+ if (p.uri.empty()) {
+ save_button.set_sensitive (false);
_preset_modified.set_text ("");
return;
}
if (_preset_modified.get_text().empty() == c) {
_preset_modified.set_text (c ? "*" : "");
}
+ save_button.set_sensitive (c && p.user);
}
void