support the young serpents
[ardour.git] / gtk2_ardour / generic_pluginui.cc
index 4ef2e27347fac316730f8507e07f935a3f34ff5b..15cc5cc503eac6576d227a9623f7663353e3faa8 100644 (file)
@@ -48,6 +48,7 @@
 #include "plugin_ui.h"
 #include "gui_thread.h"
 #include "automation_controller.h"
+#include "timers.h"
 
 #include "i18n.h"
 
@@ -82,17 +83,17 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
        Label* combo_label = manage (new Label (_("<span size=\"large\">Presets</span>")));
        combo_label->set_use_markup (true);
 
-       latency_button.add (latency_label);
-       latency_button.signal_clicked().connect (sigc::mem_fun (*this, &PlugUIBase::latency_button_clicked));
+       latency_button.signal_clicked.connect (sigc::mem_fun (*this, &PlugUIBase::latency_button_clicked));
        set_latency_label ();
 
-       smaller_hbox->pack_start (latency_button, false, false, 10);
+       smaller_hbox->pack_start (latency_button, false, false, 4);
        smaller_hbox->pack_start (_preset_combo, false, false);
        smaller_hbox->pack_start (_preset_modified, false, false);
        smaller_hbox->pack_start (add_button, false, false);
        smaller_hbox->pack_start (save_button, false, false);
        smaller_hbox->pack_start (delete_button, false, false);
-       smaller_hbox->pack_start (bypass_button, false, true);
+       smaller_hbox->pack_start (reset_button, false, false, 4);
+       smaller_hbox->pack_start (bypass_button, false, true, 4);
        
        automation_manual_all_button.set_text(_("Manual"));
        automation_manual_all_button.set_name (X_("generic button"));
@@ -695,7 +696,7 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
                Adjustment* adj = control_ui->controller->adjustment();
 
                if (desc.integer_step) {
-                       control_ui->clickbox = new ClickBox (adj, "PluginUIClickBox", desc.enumeration);
+                       control_ui->clickbox = new ClickBox (adj, "PluginUIClickBox", true);
                        Gtkmm2ext::set_size_request_to_display_given_text (*control_ui->clickbox, "g9999999", 2, 2);
                        if (desc.unit == ParameterDescriptor::MIDI_NOTE) {
                                control_ui->clickbox->set_printer (sigc::bind (sigc::mem_fun (*this, &GenericPluginUI::midinote_printer), control_ui));
@@ -708,9 +709,6 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
                        control_ui->controller->set_size_request (200, req.height);
                        control_ui->controller->set_name (X_("ProcessorControlSlider"));
 
-                       control_ui->controller->StartGesture.connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::start_touch), control_ui));
-                       control_ui->controller->StopGesture.connect (sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::stop_touch), control_ui));
-
                }
 
                adj->set_value (mcontrol->internal_to_interface(value));
@@ -732,7 +730,6 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
 
                automation_state_changed (control_ui);
 
-               mcontrol->Changed.connect (control_connections, invalidator (*this), boost::bind (&GenericPluginUI::ui_parameter_changed, this, control_ui), gui_context());
                mcontrol->alist()->automation_state_changed.connect (control_connections, invalidator (*this), boost::bind (&GenericPluginUI::automation_state_changed, this, control_ui), gui_context());
 
                input_controls.push_back (control_ui);
@@ -766,8 +763,8 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
                                0xcccc00ff, 0xcccc00ff,
                                0xffaa00ff, 0xffaa00ff,
                                0xff0000ff,
-                               ARDOUR_UI::config()->get_MeterBackgroundBot(),
-                               ARDOUR_UI::config()->get_MeterBackgroundTop()
+                               ARDOUR_UI::config()->color ("meter background bottom"),
+                               ARDOUR_UI::config()->color ("meter background top")
                                );
 
                info->min_unbound = desc.min_unbound;
@@ -805,18 +802,6 @@ GenericPluginUI::build_control_ui (const Evoral::Parameter&             param,
        return control_ui;
 }
 
-void
-GenericPluginUI::start_touch (GenericPluginUI::ControlUI* cui)
-{
-       cui->control->start_touch (cui->control->session().transport_frame());
-}
-
-void
-GenericPluginUI::stop_touch (GenericPluginUI::ControlUI* cui)
-{
-       cui->control->stop_touch (false, cui->control->session().transport_frame());
-}
-
 void
 GenericPluginUI::astate_clicked (ControlUI* cui)
 {
@@ -954,8 +939,7 @@ GenericPluginUI::start_updating (GdkEventAny*)
 {
        if (output_controls.size() > 0 ) {
                screen_update_connection.disconnect();
-               screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect
-                       (sigc::mem_fun(*this, &GenericPluginUI::output_update));
+               screen_update_connection = Timers::super_rapid_connect (sigc::mem_fun(*this, &GenericPluginUI::output_update));
        }
        return false;
 }