proper plugin-UI interaction/semantics
authorRobin Gareus <robin@gareus.org>
Thu, 6 Jun 2013 21:55:08 +0000 (23:55 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 6 Jun 2013 21:55:08 +0000 (23:55 +0200)
Always show plugin's own UI (if available) on double-click
Alt+double-click -> show 'generic controls'.
Context-menu offers both choices.
Use Tooltip for to make it discoverable.

gtk2_ardour/processor_box.cc
gtk2_ardour/rc_option_editor.cc

index ded931aa504a1051be807683c8c739f591878aee..04c261e2e1895da90012117b41bcef1e5697e90d 100644 (file)
@@ -113,7 +113,7 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo
 
                _button.set_active (_processor->active());
                _button.show ();
-               
+
                _processor->ActiveChanged.connect (active_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_active_changed, this), gui_context());
                _processor->PropertyChanged.connect (name_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_property_changed, this, _1), gui_context());
 
@@ -247,7 +247,20 @@ ProcessorEntry::processor_property_changed (const PropertyChange& what_changed)
 void
 ProcessorEntry::setup_tooltip ()
 {
-       ARDOUR_UI::instance()->set_tip (_button, name (Wide));
+       if (_processor) {
+               boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_processor);
+               if (pi) {
+                       if (pi->plugin()->has_editor()) {
+                               ARDOUR_UI::instance()->set_tip (_button,
+                                               string_compose (_("<b>%1</b>\nDouble-click to show GUI.\nAlt+double-click to show generic GUI."), name (Wide)));
+                       } else {
+                               ARDOUR_UI::instance()->set_tip (_button,
+                                               string_compose (_("<b>%1</b>\nDouble-click to show generic GUI."), name (Wide)));
+                       }
+                       return;
+               }
+       }
+       ARDOUR_UI::instance()->set_tip (_button, string_compose ("<b>%1</b>", name (Wide)));
 }
 
 string
@@ -918,6 +931,7 @@ ProcessorBox::show_processor_menu (int arg)
        const bool sensitive = !processor_display.selection().empty();
        ActionManager::set_sensitive (ActionManager::plugin_selection_sensitive_actions, sensitive);
        edit_action->set_sensitive (one_processor_can_be_edited ());
+       edit_generic_action->set_sensitive (one_processor_can_be_edited ());
 
        boost::shared_ptr<PluginInsert> pi;
        if (single_selection) {
@@ -1050,13 +1064,12 @@ ProcessorBox::processor_button_press_event (GdkEventButton *ev, ProcessorEntry*
        if (processor && (Keyboard::is_edit_event (ev) || (ev->button == 1 && ev->type == GDK_2BUTTON_PRESS))) {
 
                if (_session->engine().connected()) {
-
                        /* XXX giving an error message here is hard, because we may be in the midst of a button press */
 
-                       if (Config->get_use_plugin_own_gui ()) {
-                               edit_processor (processor);
-                       } else {
+                       if (Keyboard::modifier_state_equals (ev->state, Keyboard::SecondaryModifier)) {
                                generic_edit_processor (processor);
+                       } else {
+                               edit_processor (processor);
                        }
                }
 
@@ -2235,7 +2248,7 @@ ProcessorBox::register_actions ()
                sigc::ptr_fun (ProcessorBox::rb_edit));
 
        edit_generic_action = ActionManager::register_action (
-               popup_act_grp, X_("edit-generic"), _("Edit with basic controls..."),
+               popup_act_grp, X_("edit-generic"), _("Edit with generic controls..."),
                sigc::ptr_fun (ProcessorBox::rb_edit_generic));
 
        ActionManager::add_action_group (popup_act_grp);
@@ -2437,7 +2450,7 @@ ProcessorBox::edit_processor (boost::shared_ptr<Processor> processor)
        ProcessorWindowProxy* proxy = find_window_proxy (processor);
 
        if (proxy) {
-               proxy->set_custom_ui_mode (Config->get_use_plugin_own_gui ());
+               proxy->set_custom_ui_mode (true);
                proxy->toggle ();
        }
 }
index 216a122e91766b4c3fd5676253fbd1bb0b7063a6..da0e55c7a2e8f849bb6f8ad54b653375c74ce266 100644 (file)
@@ -1855,13 +1855,6 @@ RCOptionEditor::RCOptionEditor ()
        /* font scaling does nothing with GDK/Quartz */
        add_option (S_("Preferences|GUI"), new FontScalingOptions (_rc_config));
 #endif
-       add_option (S_("Preferences|GUI"),
-                   new BoolOption (
-                           "use-own-plugin-gui",
-                           string_compose (_("Use plugins' own interfaces instead of %1's"), PROGRAM_NAME),
-                           sigc::mem_fun (*_rc_config, &RCConfiguration::get_use_plugin_own_gui),
-                           sigc::mem_fun (*_rc_config, &RCConfiguration::set_use_plugin_own_gui)
-                           ));
 
        add_option (S_("GUI"),
                    new BoolOption (