Move a few declarations to first use.
[ardour.git] / gtk2_ardour / generic_pluginui.cc
index 6bdd8314b965428c1913dd3322895054e95c778d..52e583a4f8b82af447e65fa4d3df1f298b2299ec 100644 (file)
@@ -88,7 +88,8 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
        set_latency_label ();
 
        smaller_hbox->pack_start (latency_button, false, false, 10);
-       smaller_hbox->pack_start (_preset_box, false, false);
+       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);
@@ -112,7 +113,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol
        main_contents.pack_start (*constraint_hbox, false, false);
 
        if (is_scrollable ) {
-               scroller.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
+               scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
                scroller.set_name ("PluginEditor");
                scroller_view.set_name("PluginEditor");
                scroller_view.add (hpacker);
@@ -438,10 +439,9 @@ GenericPluginUI::automation_state_changed (ControlUI* cui)
 
        // don't lock to avoid deadlock because we're triggered by
        // AutomationControl::Changed() while the automation lock is taken
-       switch (insert->get_parameter_automation_state (cui->parameter())
-                       & (Off|Play|Touch|Write)) {
-       case Off:
-               cui->automate_button.set_label (_("Manual"));
+       switch (insert->get_parameter_automation_state (cui->parameter()) & (ARDOUR::Off|Play|Touch|Write)) {
+       case ARDOUR::Off:
+               cui->automate_button.set_label (S_("Automation|Manual"));
                break;
        case Play:
                cui->automate_button.set_label (_("Play"));
@@ -565,8 +565,8 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
                Adjustment* adj = control_ui->controller->adjustment();
                boost::shared_ptr<PluginInsert::PluginControl> pc = boost::dynamic_pointer_cast<PluginInsert::PluginControl> (control_ui->control);
 
-               adj->set_lower (pc->user_to_ui (desc.lower));
-               adj->set_upper (pc->user_to_ui (desc.upper));
+               adj->set_lower (pc->internal_to_interface (desc.lower));
+               adj->set_upper (pc->internal_to_interface (desc.upper));
 
                adj->set_step_increment (desc.step);
                adj->set_page_increment (desc.largestep);
@@ -589,7 +589,7 @@ GenericPluginUI::build_control_ui (guint32 port_index, boost::shared_ptr<Automat
 
                }
 
-               adj->set_value (pc->plugin_to_ui (plugin->get_parameter (port_index)));
+               adj->set_value (pc->internal_to_interface (plugin->get_parameter (port_index)));
 
                /* XXX memory leak: SliderController not destroyed by ControlUI
                   destructor, and manage() reports object hierarchy
@@ -692,8 +692,8 @@ GenericPluginUI::astate_clicked (ControlUI* cui, uint32_t /*port*/)
        MenuList& items (automation_menu->items());
 
        items.clear ();
-       items.push_back (MenuElem (_("Manual"),
-                                  sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Off, cui)));
+       items.push_back (MenuElem (S_("Automation|Manual"),
+                                  sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) ARDOUR::Off, cui)));
        items.push_back (MenuElem (_("Play"),
                                   sigc::bind (sigc::mem_fun(*this, &GenericPluginUI::set_automation_state), (AutoState) Play, cui)));
        items.push_back (MenuElem (_("Write"),
@@ -793,16 +793,6 @@ GenericPluginUI::control_combo_changed (ControlUI* cui)
        }
 }
 
-void
-GenericPluginUI::processor_active_changed (boost::weak_ptr<Processor> weak_processor)
-{
-       ENSURE_GUI_THREAD (*this, &GenericPluginUI::processor_active_changed, weak_processor)
-
-       boost::shared_ptr<Processor> processor = weak_processor.lock();
-
-       bypass_button.set_active (!processor || !processor->active());
-}
-
 bool
 GenericPluginUI::start_updating (GdkEventAny*)
 {