Prepare central engine check and user notification
[ardour.git] / gtk2_ardour / patch_change_widget.cc
index 75f42ea546a6a94f901b997f549f188d2da52713..f9c88d80688af5845799a1204200d4c105fab932 100644 (file)
@@ -32,6 +32,7 @@
 #include "ardour/plugin_insert.h"
 
 #include "gtkmm2ext/menu_elems.h"
+#include "gtkmm2ext/utils.h"
 #include "widgets/tooltips.h"
 
 #include "gui_thread.h"
@@ -237,6 +238,9 @@ PatchChangeWidget::refill_banks ()
        if (cns) {
                for (MIDI::Name::ChannelNameSet::PatchBanks::const_iterator i = cns->patch_banks().begin(); i != cns->patch_banks().end(); ++i) {
                        std::string n = (*i)->name ();
+                       if ((*i)->number () == UINT16_MAX) {
+                               continue;
+                       }
                        _bank_select.AddMenuElem (MenuElemNoMnemonic (n, sigc::bind (sigc::mem_fun (*this, &PatchChangeWidget::select_bank), (*i)->number ())));
                        if ((*i)->number () == b) {
                                _current_patch_bank = *i;
@@ -268,7 +272,8 @@ PatchChangeWidget::refill_program_list ()
 
                        const uint8_t pgm = key.program();
                        _program_btn[pgm].set_text (n);
-                       set_tooltip (_program_btn[pgm], string_compose (_("%1 (Pgm-%2)"), n, (int)(pgm +1)));
+                       set_tooltip (_program_btn[pgm], string_compose (_("%1 (Pgm-%2)"),
+                                               Gtkmm2ext::markup_escape_text (n), (int)(pgm +1)));
                        unset_notes.reset (pgm);
                }
        }
@@ -558,7 +563,7 @@ PatchChangeWidget::program (uint8_t chn) const
 /* ***************************************************************************/
 
 PatchChangeGridDialog::PatchChangeGridDialog (boost::shared_ptr<ARDOUR::Route> r)
-       : ArdourDialog (string_compose (_("Select Patch for '%1"), r->name()), false, false)
+       : ArdourDialog (string_compose (_("Select Patch for \"%1\""), r->name()), false, false)
        , w (r)
 {
        r->PropertyChanged.connect (_route_connection, invalidator (*this), boost::bind (&PatchChangeGridDialog::route_property_changed, this, _1, boost::weak_ptr<Route>(r)), gui_context());
@@ -571,6 +576,6 @@ PatchChangeGridDialog::route_property_changed (const PBD::PropertyChange& what_c
 {
        boost::shared_ptr<ARDOUR::Route> r = wr.lock ();
        if (r && what_changed.contains (ARDOUR::Properties::name)) {
-               set_title (string_compose (_("Select Patch for '%1"), r->name()));
+               set_title (string_compose (_("Select Patch for \"%1\"'"), r->name()));
        }
 }