#include "ardour/plugin_insert.h"
#include "gtkmm2ext/menu_elems.h"
+#include "gtkmm2ext/utils.h"
#include "widgets/tooltips.h"
#include "gui_thread.h"
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;
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);
}
}
piano_keyboard_set_note_off (_piano, _audition_note_num);
return ++_audition_note_num <= _audition_end_spin.get_value_as_int() && _audition_enable.get_active ();
} else {
- note_on_event_handler (_audition_note_num);
+ note_on_event_handler (_audition_note_num, true);
piano_keyboard_set_note_on (_piano, _audition_note_num);
return true;
}
void
PatchChangeWidget::_note_on_event_handler(GtkWidget*, int note, gpointer arg)
{
- ((PatchChangeWidget*)arg)->note_on_event_handler(note);
+ ((PatchChangeWidget*)arg)->note_on_event_handler(note, false);
}
void
}
void
-PatchChangeWidget::note_on_event_handler (int note)
+PatchChangeWidget::note_on_event_handler (int note, bool for_audition)
{
- cancel_audition ();
- _pianomm->grab_focus ();
+ if (!for_audition) {
+ cancel_audition ();
+ _pianomm->grab_focus ();
+ }
uint8_t event[3];
event[0] = (MIDI_CMD_NOTE_ON | _channel);
event[1] = note;
/* ***************************************************************************/
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());
{
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()));
}
}