mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-30 17:03:06 +01:00
Display profile-data in generic plugin-UI.
This commit is contained in:
parent
cb51c4c5aa
commit
7e78d1c786
3 changed files with 62 additions and 0 deletions
|
|
@ -156,6 +156,9 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
|
|||
} else {
|
||||
pack_end (plugin_analysis_expander, false, false);
|
||||
}
|
||||
|
||||
pack_end (cpuload_expander, false, false);
|
||||
|
||||
if (!plugin->get_docs().empty()) {
|
||||
pack_end (description_expander, false, false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@
|
|||
#include "keyboard.h"
|
||||
#include "latency_gui.h"
|
||||
#include "plugin_eq_gui.h"
|
||||
#include "timers.h"
|
||||
#include "new_plugin_preset_dialog.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
|
@ -460,6 +461,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
|
|||
, pin_management_button (_("Pinout"))
|
||||
, description_expander (_("Description"))
|
||||
, plugin_analysis_expander (_("Plugin analysis"))
|
||||
, cpuload_expander (_("CPU Profile"))
|
||||
, latency_gui (0)
|
||||
, latency_dialog (0)
|
||||
, eqgui (0)
|
||||
|
|
@ -520,6 +522,9 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi)
|
|||
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 ());
|
||||
|
|
@ -813,6 +818,53 @@ PlugUIBase::toggle_plugin_analysis()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
PlugUIBase::update_cpu_label()
|
||||
{
|
||||
uint64_t min, max;
|
||||
double avg, dev;
|
||||
string t;
|
||||
if (insert->get_stats (min, max, avg, dev)) {
|
||||
t = string_compose (_("Timing min: %1 [ms] max: %2 [ms]\navg: %3 [ms] std.dev: %4"),
|
||||
rint (min / 100.) / 10.,
|
||||
rint (max / 100.) / 10.,
|
||||
rint (avg) / 1000.,
|
||||
rint (dev) / 1000.);
|
||||
} else {
|
||||
t = _("No data available");
|
||||
}
|
||||
cpuload_label.set_text (t);
|
||||
}
|
||||
|
||||
void
|
||||
PlugUIBase::toggle_cpuload_display()
|
||||
{
|
||||
if (cpuload_expander.get_expanded() && !cpuload_expander.get_child()) {
|
||||
update_cpu_label ();
|
||||
cpuload_label.set_line_wrap(true);
|
||||
cpuload_label.set_line_wrap_mode(Pango::WRAP_WORD);
|
||||
update_cpu_label_connection = Timers::second_connect (sigc::mem_fun(*this, &PlugUIBase::update_cpu_label));
|
||||
|
||||
cpuload_expander.add(cpuload_label);
|
||||
cpuload_expander.show_all();
|
||||
}
|
||||
|
||||
if (!cpuload_expander.get_expanded()) {
|
||||
update_cpu_label_connection.disconnect ();
|
||||
const int child_height = cpuload_expander.get_child ()->get_height ();
|
||||
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 ()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -137,6 +137,8 @@ protected:
|
|||
Gtk::Expander description_expander;
|
||||
/** an expander containing the plugin analysis graph */
|
||||
Gtk::Expander plugin_analysis_expander;
|
||||
/** an expander containing the plugin cpu profile */
|
||||
Gtk::Expander cpuload_expander;
|
||||
/** a button which, when clicked, opens the latency GUI */
|
||||
ArdourWidgets::ArdourButton latency_button;
|
||||
/** a button which sets all controls' automation setting to Manual */
|
||||
|
|
@ -149,8 +151,12 @@ protected:
|
|||
ArdourWidgets::ArdourButton automation_touch_all_button;
|
||||
/** a button which sets all controls' automation setting to Latch */
|
||||
ArdourWidgets::ArdourButton automation_latch_all_button;
|
||||
/** */
|
||||
Gtk::Label cpuload_label;
|
||||
|
||||
void set_latency_label ();
|
||||
void update_cpu_label ();
|
||||
sigc::connection update_cpu_label_connection;
|
||||
|
||||
LatencyGUI* latency_gui;
|
||||
ArdourWindow* latency_dialog;
|
||||
|
|
@ -171,6 +177,7 @@ protected:
|
|||
bool bypass_button_release(GdkEventButton*);
|
||||
void toggle_description ();
|
||||
void toggle_plugin_analysis ();
|
||||
void toggle_cpuload_display ();
|
||||
void processor_active_changed (boost::weak_ptr<ARDOUR::Processor> p);
|
||||
void plugin_going_away ();
|
||||
void automation_state_changed ();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue