Mixer pane can be collapsed again, some cleanup, give up and go back to 'Off' for...
[ardour.git] / gtk2_ardour / plugin_ui.cc
index 06d40881127cc17f6beef54752ad7c9742ccd617..66231adcc38db3ca7e814d8ed66da5de845711b3 100644 (file)
@@ -100,7 +100,7 @@ PluginUIWindow::PluginUIWindow (AudioEngine &engine, PluginInsert& insert, bool
 
        set_position (Gtk::WIN_POS_MOUSE);
        set_name ("PluginEditor");
-       add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
+       add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
 
        signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), reinterpret_cast<Window*> (this)));
        insert.GoingAway.connect (mem_fun(*this, &PluginUIWindow::plugin_going_away));
@@ -135,14 +135,14 @@ PluginUI::PluginUI (AudioEngine &engine, PluginInsert& pi, bool scrollable)
 
        HBox* constraint_hbox = manage (new HBox);
        HBox* smaller_hbox = manage (new HBox);
-       Label* combo_label = manage (new Label (_("<span size=\"large\" weight=\"bold\">Presets</span>")));
+       Label* combo_label = manage (new Label (_("<span size=\"large\">Presets</span>")));
        combo_label->set_use_markup (true);
 
        smaller_hbox->pack_start (*combo_label, false, false, 10);
        smaller_hbox->pack_start (combo, false, false);
        smaller_hbox->pack_start (save_button, false, false);
 
-       constraint_hbox->set_spacing (10);
+       constraint_hbox->set_spacing (5);
        constraint_hbox->pack_start (*smaller_hbox, true, false);
        constraint_hbox->pack_end (bypass_button, false, false);
 
@@ -186,7 +186,6 @@ PluginUI::build (AudioEngine &engine)
        Frame* frame;
        Frame* bt_frame;
        VBox* box;
-       char info[32];
        int output_row, output_col;
        int button_row, button_col;
        int output_rows, output_cols;
@@ -227,6 +226,7 @@ PluginUI::build (AudioEngine &engine)
 
        frame = manage (new Frame);
        frame->set_name ("BaseFrame");
+       frame->set_label (_("Controls"));
        frame->add (*box);
        hpacker.pack_start(*frame, true, true);
 
@@ -235,9 +235,15 @@ PluginUI::build (AudioEngine &engine)
        for (i = 0; i < plugin.parameter_count(); ++i) {
 
                if (plugin.parameter_is_control (i)) {
+                       
+                       /* Don't show latency control ports */
+
+                       if (plugin.describe_parameter (i) == X_("latency")) {
+                               continue;
+                       }
 
                        ControlUI* cui;
-                               
+       
                        /* if we are scrollable, just use one long column */
 
                        if (!is_scrollable) {
@@ -256,12 +262,6 @@ PluginUI::build (AudioEngine &engine)
                                }
                        }
 
-                       /* Don't show latency control ports */
-
-                       if (plugin.describe_parameter (i) == X_("latency")) {
-                               continue;
-                       }
-
                        if ((cui = build_control_ui (engine, i, plugin.get_nth_midi_control (i))) == 0) {
                                error << string_compose(_("Plugin Editor: could not build control element for port %1"), i) << endmsg;
                                continue;
@@ -354,11 +354,11 @@ PluginUI::ControlUI::ControlUI ()
 {
        automate_button.set_name ("PluginAutomateButton");
        ARDOUR_UI::instance()->tooltips().set_tip (automate_button,
-                                                  _("automation control"));
+                                                  _("Automation control"));
 
        /* don't fix the height, it messes up the bar controllers */
 
-       set_size_request_to_display_given_text (automate_button, X_("longenuff"), 2, 2);
+       set_size_request_to_display_given_text (automate_button, X_("lngnuf"), 2, 2);
 
        ignore_change = 0;
        display = 0;
@@ -388,19 +388,19 @@ PluginUI::automation_state_changed (ControlUI* cui)
 
        switch (insert.get_port_automation_state (cui->port_index) & (Off|Play|Touch|Write)) {
        case Off:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("off"));
+               cui->automate_button.set_label (_("Off"));
                break;
        case Play:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("play"));
+               cui->automate_button.set_label (_("Play"));
                break;
        case Write:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("write"));
+               cui->automate_button.set_label (_("Write"));
                break;
        case Touch:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("touch"));
+               cui->automate_button.set_label (_("Touch"));
                break;
        default:
-               static_cast<Gtk::Label*>(cui->automate_button.get_child())->set_text (_("???"));
+               cui->automate_button.set_label (_("???"));
                break;
        }
 }
@@ -631,13 +631,13 @@ PluginUI::astate_clicked (ControlUI* cui, uint32_t port)
        MenuList& items (automation_menu->items());
 
        items.clear ();
-       items.push_back (MenuElem (_("off"), 
+       items.push_back (MenuElem (_("Off"), 
                                   bind (mem_fun(*this, &PluginUI::set_automation_state), (AutoState) Off, cui)));
-       items.push_back (MenuElem (_("play"),
+       items.push_back (MenuElem (_("Play"),
                                   bind (mem_fun(*this, &PluginUI::set_automation_state), (AutoState) Play, cui)));
-       items.push_back (MenuElem (_("write"),
+       items.push_back (MenuElem (_("Write"),
                                   bind (mem_fun(*this, &PluginUI::set_automation_state), (AutoState) Write, cui)));
-       items.push_back (MenuElem (_("touch"),
+       items.push_back (MenuElem (_("Touch"),
                                   bind (mem_fun(*this, &PluginUI::set_automation_state), (AutoState) Touch, cui)));
 
        automation_menu->popup (1, 0);
@@ -829,11 +829,12 @@ PluginUI::setup_scale_values(guint32 port_index, ControlUI* cui)
 PlugUIBase::PlugUIBase (PluginInsert& pi)
        : insert (pi),
          plugin (insert.plugin()),
-         save_button(_("save")),
-         bypass_button (_("bypass"))
+         save_button(_("Add")),
+         bypass_button (_("Bypass"))
 {
         //combo.set_use_arrows_always(true);
        set_popdown_strings (combo, plugin.get_presets());
+       combo.set_size_request (100, -1);
        combo.set_active_text ("");
        combo.signal_changed().connect(mem_fun(*this, &PlugUIBase::setting_selected));
 
@@ -859,7 +860,9 @@ void
 PlugUIBase::save_plugin_setting ()
 {
        ArdourPrompter prompter (true);
-       prompter.set_prompt(_("Name for plugin settings:"));
+       prompter.set_prompt(_("Name of New Preset:"));
+       prompter.add_button (Gtk::Stock::ADD, Gtk::RESPONSE_ACCEPT);
+       prompter.set_response_sensitive (Gtk::RESPONSE_ACCEPT, false);
 
        prompter.show_all();