mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
* fixed bug: replaced underscores in patch/bank names with spaces to avoid becoming menu shortcuts
git-svn-id: svn://localhost/ardour2/branches/3.0@4413 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
b3c6c4a6d5
commit
c174fa6174
1 changed files with 12 additions and 2 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <glibmm/regex.h>
|
||||||
|
|
||||||
#include "ardour/midi_patch_manager.h"
|
#include "ardour/midi_patch_manager.h"
|
||||||
#include "ardour_ui.h"
|
#include "ardour_ui.h"
|
||||||
#include "midi_region_view.h"
|
#include "midi_region_view.h"
|
||||||
|
|
@ -64,6 +66,9 @@ CanvasProgramChange::initialize_popup_menus()
|
||||||
for (ChannelNameSet::PatchBanks::const_iterator bank = patch_banks.begin();
|
for (ChannelNameSet::PatchBanks::const_iterator bank = patch_banks.begin();
|
||||||
bank != patch_banks.end();
|
bank != patch_banks.end();
|
||||||
++bank) {
|
++bank) {
|
||||||
|
Glib::RefPtr<Glib::Regex> underscores = Glib::Regex::create("_");
|
||||||
|
Glib::ustring replacement(" ");
|
||||||
|
|
||||||
Gtk::Menu& patch_bank_menu = *manage(new Gtk::Menu());
|
Gtk::Menu& patch_bank_menu = *manage(new Gtk::Menu());
|
||||||
|
|
||||||
const PatchBank::PatchNameList& patches = (*bank)->patch_name_list();
|
const PatchBank::PatchNameList& patches = (*bank)->patch_name_list();
|
||||||
|
|
@ -72,17 +77,22 @@ CanvasProgramChange::initialize_popup_menus()
|
||||||
for (PatchBank::PatchNameList::const_iterator patch = patches.begin();
|
for (PatchBank::PatchNameList::const_iterator patch = patches.begin();
|
||||||
patch != patches.end();
|
patch != patches.end();
|
||||||
++patch) {
|
++patch) {
|
||||||
|
Glib::ustring name = underscores->replace((*patch)->name().c_str(), -1, 0, replacement);
|
||||||
|
|
||||||
patch_menus.push_back(
|
patch_menus.push_back(
|
||||||
Gtk::Menu_Helpers::MenuElem(
|
Gtk::Menu_Helpers::MenuElem(
|
||||||
(*patch)->name(),
|
name,
|
||||||
sigc::bind(
|
sigc::bind(
|
||||||
sigc::mem_fun(*this, &CanvasProgramChange::on_patch_menu_selected),
|
sigc::mem_fun(*this, &CanvasProgramChange::on_patch_menu_selected),
|
||||||
(*patch)->patch_primary_key())) );
|
(*patch)->patch_primary_key())) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Glib::ustring name = underscores->replace((*bank)->name().c_str(), -1, 0, replacement);
|
||||||
|
|
||||||
patch_bank_menus.push_back(
|
patch_bank_menus.push_back(
|
||||||
Gtk::Menu_Helpers::MenuElem(
|
Gtk::Menu_Helpers::MenuElem(
|
||||||
(*bank)->name(),
|
name,
|
||||||
patch_bank_menu) );
|
patch_bank_menu) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue