21 #include <gtkmm/stock.h>
22 #include <gtkmm/table.h>
24 #include <boost/algorithm/string.hpp>
28 #include "midi++/midnam_patch.h"
48 const Gtk::BuiltinStockID& ok,
51 , _time_converter (tc)
53 , _time (
X_(
"patchchangetime"), true,
"", true, false)
54 , _channel (*manage (new Adjustment (1, 1, 16, 1, 4)))
55 , _program (*manage (new Adjustment (1, 1, 128, 1, 16)))
56 , _bank (*manage (new Adjustment (1, 1, 16384, 1, 64)))
57 , _ignore_signals (false)
59 Table* t = manage (
new Table (4, 2));
67 t->attach (*l, 0, 1, r, r + 1);
68 t->attach (
_time, 1, 2, r, r + 1);
77 t->attach (*l, 0, 1, r, r + 1);
84 t->attach (*l, 0, 1, r, r + 1);
91 t->attach (*l, 0, 1, r, r + 1);
92 t->attach (
_channel, 1, 2, r, r + 1);
99 t->attach (*l, 0, 1, r, r + 1);
100 t->attach (
_program, 1, 2, r, r + 1);
107 t->attach (*l, 0, 1, r, r + 1);
108 t->attach (
_bank, 1, 2, r, r + 1);
114 get_vbox()->add (*t);
116 add_button (Stock::CANCEL, RESPONSE_CANCEL);
117 add_button (ok, RESPONSE_ACCEPT);
119 add_button (Gtk::StockID(GTK_STOCK_DELETE), RESPONSE_REJECT);
121 set_default_response (RESPONSE_ACCEPT);
155 _bank.get_value_as_int() - 1
171 for (MIDI::Name::ChannelNameSet::PatchBanks::const_iterator i = cns->patch_banks().begin(); i != cns->patch_banks().end(); ++i) {
172 string n = (*i)->name ();
190 for (MIDI::Name::ChannelNameSet::PatchBanks::const_iterator i = cns->patch_banks().begin(); i != cns->patch_banks().end(); ++i) {
192 string n = (*i)->name ();
195 if ((*i)->number() ==
_bank.get_value () - 1) {
227 for (MIDI::Name::ChannelNameSet::PatchBanks::const_iterator i = cns->patch_banks().begin(); i != cns->patch_banks().end(); ++i) {
228 string n = (*i)->name ();
260 for (MIDI::Name::PatchNameList::const_iterator j = patches.begin(); j != patches.end(); ++j) {
261 string n = (*j)->name ();
283 for (MIDI::Name::PatchNameList::const_iterator j = patches.begin(); j != patches.end(); ++j) {
284 string n = (*j)->name ();
287 MIDI::Name::PatchPrimaryKey
const & key = (*j)->patch_primary_key ();
288 if (key.program() ==
_program.get_value() - 1) {
311 for (MIDI::Name::PatchNameList::const_iterator j = patches.begin(); j != patches.end(); ++j) {
312 string n = (*j)->name ();
317 _program.set_value ((*j)->program_number() + 1);
void instrument_info_changed()
framepos_t current_time(framepos_t position=0) const
void set(framepos_t, bool force=false, ARDOUR::framecnt_t offset=0)
void bank_combo_changed()
void set_session(ARDOUR::Session *s)
const ARDOUR::BeatsFramesConverter * _time_converter
boost::shared_ptr< MIDI::Name::ChannelNameSet > get_patches(uint8_t channel)
PBD::Signal0< void > Changed
LIBPBD_API int replace_all(std::string &str, const std::string &target, const std::string &replacement)
boost::shared_ptr< MIDI::Name::PatchBank > _current_patch_bank
Evoral::PatchChange< Evoral::Beats > patch() const
Gtk::ComboBoxText _bank_combo
LIBGTKMM2EXT_API Gtk::Label * left_aligned_label(std::string const &)
Evoral::Beats from(framepos_t frames) const
LIBPBD_API Transmitter info
ARDOUR::InstrumentInfo & _info
Gtk::ComboBoxText _patch_combo
std::list< boost::shared_ptr< Patch > > PatchNameList
LIBEVORAL_API uint64_t Beats
PBD::ScopedConnection _info_changed_connection
framepos_t to(Evoral::Beats beats) const
void patch_combo_changed()
void set_active_bank_combo()
PatchChangeDialog(const ARDOUR::BeatsFramesConverter *, ARDOUR::Session *, Evoral::PatchChange< Evoral::Beats > const &, ARDOUR::InstrumentInfo &, const Gtk::BuiltinStockID &, bool allow_delete=false)
void set_active_patch_combo()