summaryrefslogtreecommitdiff
path: root/libs/surfaces/push2/gui.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-07-07 00:10:27 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-09-27 14:59:30 -0500
commit66453868cd18704babd08b52d4fd4ee5fcb67322 (patch)
tree893d372a92e84c7e128a6be5ddfec37fd3e49525 /libs/surfaces/push2/gui.cc
parenteff67c8a8fcb69d082fd7b68627cf32250ced156 (diff)
push2: update GUI pad display when octave shift is used, or pad map is changed
Diffstat (limited to 'libs/surfaces/push2/gui.cc')
-rw-r--r--libs/surfaces/push2/gui.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/libs/surfaces/push2/gui.cc b/libs/surfaces/push2/gui.cc
index e061bfc2c9..2606418eab 100644
--- a/libs/surfaces/push2/gui.cc
+++ b/libs/surfaces/push2/gui.cc
@@ -64,14 +64,14 @@ Push2::tear_down_gui ()
delete w;
}
}
- delete static_cast<P2GUI*> (gui);
+ delete gui;
gui = 0;
}
void
Push2::build_gui ()
{
- gui = (void*) new P2GUI (*this);
+ gui = new P2GUI (*this);
}
/*--------------------*/
@@ -139,6 +139,7 @@ P2GUI::P2GUI (Push2& p)
/* catch future changes to connection state */
// p2.ConnectionChange.connect (connection_change_connection, invalidator (*this), boost::bind (&P2GUI::connection_handler, this), gui_context());
+ p2.PadChange.connect (p2_connections, invalidator (*this), boost::bind (&P2GUI::build_pad_table, this), gui_context());
}
P2GUI::~P2GUI ()
@@ -407,14 +408,15 @@ P2GUI::active_port_changed (Gtk::ComboBox* combo, bool for_input)
void
P2GUI::build_pad_table ()
{
- Gtk::Label* l;
+ container_clear (pad_table);
for (int row = 0; row < 8; ++row) {
for (int col = 0; col < 8; ++col) {
- l = manage (new Label);
- l->set_text (string_compose ("%1", (int) p2.pad_note (row, col)));
- l->show ();
- pad_table.attach (*l, col, col+1, row, row + 1);
+
+ Gtk::Button* b = manage (new Button (string_compose ("%1", (int) p2.pad_note (row, col))));
+ b->show ();
+
+ pad_table.attach (*b, col, col+1, row, row + 1);
}
}
}