diff options
author | Robin Gareus <robin@gareus.org> | 2017-08-24 23:41:21 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-24 23:41:21 +0200 |
commit | 0e9dab6aabc2efddc957c7c71bc55354c16626ed (patch) | |
tree | f85f642b628e277f47d62cee5bf4728a4e3766a1 /gtk2_ardour/patch_change_dialog.cc | |
parent | 18cf003aa9faf99cbc0cb1b2ec8596aef6cd68e0 (diff) |
Allow to send immediate PC messages without closing the dialog.
Perhaps every change should trigger a PC (without "Apply") button?!
Diffstat (limited to 'gtk2_ardour/patch_change_dialog.cc')
-rw-r--r-- | gtk2_ardour/patch_change_dialog.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gtk2_ardour/patch_change_dialog.cc b/gtk2_ardour/patch_change_dialog.cc index 780323b9bb..32a102af1f 100644 --- a/gtk2_ardour/patch_change_dialog.cc +++ b/gtk2_ardour/patch_change_dialog.cc @@ -46,8 +46,9 @@ PatchChangeDialog::PatchChangeDialog ( Evoral::PatchChange<Evoral::Beats> const & patch, ARDOUR::InstrumentInfo& info, const Gtk::BuiltinStockID& ok, - bool allow_delete) - : ArdourDialog (_("Patch Change"), true) + bool allow_delete, + bool modal) + : ArdourDialog (_("Patch Change"), modal) , _time_converter (tc) , _info (info) , _time (X_("patchchangetime"), true, "", true, false) @@ -56,6 +57,7 @@ PatchChangeDialog::PatchChangeDialog ( , _bank_msb (*manage (new Adjustment (0, 0, 127, 1, 16))) , _bank_lsb (*manage (new Adjustment (0, 0, 127, 1, 16))) , _ignore_signals (false) + , _keep_open (!modal) { Table* t = manage (new Table (4, 2)); Label* l; @@ -122,7 +124,9 @@ PatchChangeDialog::PatchChangeDialog ( get_vbox()->add (*t); - add_button (Stock::CANCEL, RESPONSE_CANCEL); + if (modal) { + add_button (Stock::CANCEL, RESPONSE_CANCEL); + } add_button (ok, RESPONSE_ACCEPT); if (allow_delete) { add_button (Gtk::StockID(GTK_STOCK_DELETE), RESPONSE_REJECT); @@ -139,6 +143,16 @@ PatchChangeDialog::PatchChangeDialog ( show_all (); } +void +PatchChangeDialog::on_response (int response_id) +{ + if (_keep_open) { + Gtk::Dialog::on_response (response_id); + } else { + ArdourDialog::on_response (response_id); + } +} + int PatchChangeDialog::get_14bit_bank () const { |