diff options
author | Robin Gareus <robin@gareus.org> | 2018-07-24 21:35:14 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2018-07-24 23:22:21 +0200 |
commit | 203c6546c198053c3a5fc93a6c515424b22e465c (patch) | |
tree | ab74b85632ab031eec02327bf5dd3561dee41bb6 /gtk2_ardour/patch_change_dialog.cc | |
parent | 938b2422e3a27a94b0b084b40663255c5457eba1 (diff) |
GUI tweaks for unset midi banks.
Some MIDNAM files use Patch-Banks that do *not* have a common midi bank
(CC0, CC32) but the Patchbank is instead just a collection of patches.
There may be more than 127 patches in a patch-bank and each of those
may be in a different midi-bank (e.g. Roland SC-88 Pro).
Midnams like these are now properly supported via dropdowns (in the
patch add/modify dialog and timeline), but ignored by the grid
(patch-widget). More work is needed.
Diffstat (limited to 'gtk2_ardour/patch_change_dialog.cc')
-rw-r--r-- | gtk2_ardour/patch_change_dialog.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gtk2_ardour/patch_change_dialog.cc b/gtk2_ardour/patch_change_dialog.cc index 63aa9eac7b..961f91b512 100644 --- a/gtk2_ardour/patch_change_dialog.cc +++ b/gtk2_ardour/patch_change_dialog.cc @@ -116,9 +116,10 @@ PatchChangeDialog::PatchChangeDialog ( t->attach (_bank_lsb, 1, 2, r, r + 1); ++r; + assert (patch.bank() != UINT16_MAX); + _bank_msb.set_value ((patch.bank() >> 7)); _bank_msb.signal_changed().connect (sigc::mem_fun (*this, &PatchChangeDialog::bank_changed)); - _bank_lsb.set_value ((patch.bank() & 127)); _bank_lsb.signal_changed().connect (sigc::mem_fun (*this, &PatchChangeDialog::bank_changed)); @@ -270,10 +271,12 @@ PatchChangeDialog::bank_combo_changed () fill_patch_combo (); set_active_patch_combo (); - _ignore_signals = true; - _bank_msb.set_value (_current_patch_bank->number() >> 7); - _bank_lsb.set_value (_current_patch_bank->number() & 127); - _ignore_signals = false; + if (_current_patch_bank->number() != UINT16_MAX) { + _ignore_signals = true; + _bank_msb.set_value (_current_patch_bank->number() >> 7); + _bank_lsb.set_value (_current_patch_bank->number() & 127); + _ignore_signals = false; + } } /** Fill the contents of the patch combo */ @@ -345,6 +348,8 @@ PatchChangeDialog::patch_combo_changed () if (n == _patch_combo.get_active_text ()) { _ignore_signals = true; _program.set_value ((*j)->program_number() + 1); + _bank_msb.set_value ((*j)->bank_number() >> 7); + _bank_lsb.set_value ((*j)->bank_number() & 127); _ignore_signals = false; break; } |