From 0e9dab6aabc2efddc957c7c71bc55354c16626ed Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 24 Aug 2017 23:41:21 +0200 Subject: Allow to send immediate PC messages without closing the dialog. Perhaps every change should trigger a PC (without "Apply") button?! --- gtk2_ardour/patch_change_dialog.cc | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'gtk2_ardour/patch_change_dialog.cc') 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 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 { -- cgit v1.2.3