diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-07-07 15:53:19 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-27 14:59:30 -0500 |
commit | 70477e6fedee80a4e785d4da65c873329d06f76a (patch) | |
tree | aa35d35bcf352a96b8b9c421f817c16d8483d8e0 /libs/surfaces/push2/gui.cc | |
parent | 2aec2161f9a0124fc5ad5a7843e03a1507a24627 (diff) |
push2: almost fully operational ableton style pad mapping, etc
Diffstat (limited to 'libs/surfaces/push2/gui.cc')
-rw-r--r-- | libs/surfaces/push2/gui.cc | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/libs/surfaces/push2/gui.cc b/libs/surfaces/push2/gui.cc index 8398132d3e..0c417276c4 100644 --- a/libs/surfaces/push2/gui.cc +++ b/libs/surfaces/push2/gui.cc @@ -86,10 +86,11 @@ P2GUI::P2GUI (Push2& p) , pad_table (8, 8) , root_note_octave_adjustment (3, 0, 10, 1, 1) , root_note_octave (root_note_octave_adjustment) - , root_note_octave_label (X_("Octave")) - , root_note_label (X_("Root")) - , mode_label (X_("Mode (Scale)")) - , mode_packer (3, 2) + , root_note_octave_label (_("Octave")) + , root_note_label (_("Root")) + , mode_label (_("Mode (Scale)")) + , inkey_button (_("In-Key Mode")) + , mode_packer (3, 3) { set_border_width (12); @@ -156,6 +157,8 @@ P2GUI::P2GUI (Push2& p) mode_packer.attach (mode_label, 0, 1, 2, 3, AttachOptions (FILL|EXPAND), SHRINK); mode_packer.attach (mode_selector, 1, 2, 2, 3, AttachOptions (FILL|EXPAND), SHRINK); + mode_packer.attach (inkey_button, 1, 2, 3, 4, AttachOptions (FILL|EXPAND), SHRINK); + pad_notebook.append_page (pad_table, _("Pad Layout")); pad_notebook.append_page (mode_packer, _("Modes/Scales")); pad_notebook.append_page (custom_packer, _("Custom")); @@ -163,6 +166,7 @@ P2GUI::P2GUI (Push2& p) root_note_octave_adjustment.signal_value_changed().connect (sigc::mem_fun (*this, &P2GUI::reprogram_pad_scale)); root_note_selector.signal_changed().connect (sigc::mem_fun (*this, &P2GUI::reprogram_pad_scale)); mode_selector.signal_changed().connect (sigc::mem_fun (*this, &P2GUI::reprogram_pad_scale)); + inkey_button.signal_clicked().connect (sigc::mem_fun (*this, &P2GUI::reprogram_pad_scale)); set_spacing (12); @@ -447,15 +451,15 @@ P2GUI::build_pad_table () { container_clear (pad_table); - for (int row = 0; row < 8; ++row) { + for (int row = 7; row >= 0; --row) { for (int col = 0; col < 8; ++col) { - int n = (int) p2.pad_note (row, col); + int n = p2.pad_note (row, col); Gtk::Button* b = manage (new Button (string_compose ("%1 (%2)", Evoral::midi_note_name (n), n))); b->show (); - pad_table.attach (*b, col, col+1, row, row + 1); + pad_table.attach (*b, col, col+1, (7-row), (8-row)); } } } @@ -684,6 +688,7 @@ P2GUI::reprogram_pad_scale () int root; int octave; MusicalMode::Type mode; + bool inkey; Gtk::TreeModel::iterator iter = root_note_selector.get_active(); if (iter) { @@ -711,5 +716,7 @@ P2GUI::reprogram_pad_scale () mode = MusicalMode::IonianMajor; } - p2.set_pad_scale (root, octave, mode); + inkey = inkey_button.get_active (); + + p2.set_pad_scale (root, octave, mode, inkey); } |