From f00e5f3c16e07a207d408cd9c0d1b2160bb72665 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 22 Jul 2021 10:33:47 -0600 Subject: [PATCH] extend Triggerbox GUI with a window (for now) --- gtk2_ardour/triggerbox_ui.cc | 16 ++++++++++++++-- gtk2_ardour/triggerbox_ui.h | 10 ++++++++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/triggerbox_ui.cc b/gtk2_ardour/triggerbox_ui.cc index 50cb5cff0b..ce91f7e831 100644 --- a/gtk2_ardour/triggerbox_ui.cc +++ b/gtk2_ardour/triggerbox_ui.cc @@ -16,6 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include "pbd/i18n.h" #include "ardour/triggerbox.h" #include "gtkmm2ext/utils.h" @@ -74,14 +75,14 @@ TriggerBoxUI::build () Trigger* t; size_t n = 0; - clear_items (true); + // clear_items (true); while (true) { t = _triggerbox.trigger (n); if (!t) { break; } - + std::cerr << "NEW TE for trigger " << n << std::endl; (void) new TriggerEntry (this, *t); } } @@ -92,3 +93,14 @@ TriggerBoxWidget::TriggerBoxWidget (TriggerBox& tb) { ui = new TriggerBoxUI (root(), tb); } + +/* ------------ */ + +TriggerBoxWindow::TriggerBoxWindow (TriggerBox& tb) +{ + TriggerBoxWidget* tbw = manage (new TriggerBoxWidget (tb)); + set_title (_("TriggerBox for XXXX")); + set_default_size (100, 100); + add (*tbw); + tbw->show (); +} diff --git a/gtk2_ardour/triggerbox_ui.h b/gtk2_ardour/triggerbox_ui.h index 66ab9a0da2..ace3367c00 100644 --- a/gtk2_ardour/triggerbox_ui.h +++ b/gtk2_ardour/triggerbox_ui.h @@ -21,6 +21,8 @@ #include +#include + #include "canvas/box.h" #include "canvas/canvas.h" #include "canvas/rectangle.h" @@ -65,4 +67,12 @@ class TriggerBoxWidget : public ArdourCanvas::GtkCanvas TriggerBoxUI* ui; }; +/* XXX probably for testing only */ + +class TriggerBoxWindow : public Gtk::Window +{ + public: + TriggerBoxWindow (ARDOUR::TriggerBox&); +}; + #endif /* __ardour_gtk_triggerbox_ui_h__ */