From d4b436b4c5983b68e170021dda94a7d2a072f03e Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 19 Jan 2022 02:42:09 +0100 Subject: [PATCH] Add SourceList to TriggerPage --- gtk2_ardour/trigger_page.cc | 2 ++ gtk2_ardour/trigger_page.h | 2 ++ gtk2_ardour/trigger_source_list.cc | 37 ++++++++++++++++++++++++++++++ gtk2_ardour/trigger_source_list.h | 29 +++++++++++++++++++++++ gtk2_ardour/wscript | 1 + 5 files changed, 71 insertions(+) create mode 100644 gtk2_ardour/trigger_source_list.cc create mode 100644 gtk2_ardour/trigger_source_list.h diff --git a/gtk2_ardour/trigger_page.cc b/gtk2_ardour/trigger_page.cc index 73ecbaed61..5d9fcb2a57 100644 --- a/gtk2_ardour/trigger_page.cc +++ b/gtk2_ardour/trigger_page.cc @@ -125,6 +125,7 @@ TriggerPage::TriggerPage () _sidebar_vbox.pack_start (_sidebar_notebook); add_sidebar_page (_("Clips"), _trigger_clip_picker); + add_sidebar_page (_("Sources"), _trigger_source_list.widget ()); add_sidebar_page (_("Regions"), _trigger_region_list.widget ()); /* Upper pane ([slot | strips] | file browser) */ @@ -265,6 +266,7 @@ TriggerPage::set_session (Session* s) _cue_box.set_session (s); _trigger_clip_picker.set_session (s); _master.set_session (s); + _trigger_source_list.set_session (s); _trigger_region_list.set_session (s); if (!_session) { diff --git a/gtk2_ardour/trigger_page.h b/gtk2_ardour/trigger_page.h index 2379be211c..468220d81d 100644 --- a/gtk2_ardour/trigger_page.h +++ b/gtk2_ardour/trigger_page.h @@ -41,6 +41,7 @@ #include "slot_properties_box.h" #include "trigger_clip_picker.h" #include "trigger_region_list.h" +#include "trigger_source_list.h" #include "trigger_master.h" class TriggerStrip; @@ -104,6 +105,7 @@ private: Gtk::VBox _sidebar_vbox; Gtk::Notebook _sidebar_notebook; TriggerClipPicker _trigger_clip_picker; + TriggerSourceList _trigger_source_list; TriggerRegionList _trigger_region_list; CueBoxWidget _cue_box; diff --git a/gtk2_ardour/trigger_source_list.cc b/gtk2_ardour/trigger_source_list.cc new file mode 100644 index 0000000000..38fb3004df --- /dev/null +++ b/gtk2_ardour/trigger_source_list.cc @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2021 Robin Gareus + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "ardour/region.h" +#include "ardour/session.h" + +#include "trigger_source_list.h" + +#include "pbd/i18n.h" + +using namespace Gtk; + +TriggerSourceList::TriggerSourceList () +{ + add_name_column (); + setup_col (append_col (_columns.channels, "Chans "), 1, ALIGN_LEFT, _("# Ch"), _("# Channels in the region")); + add_tag_column (); + + setup_col (append_col (_columns.captd_xruns, "1234567890"), 21, ALIGN_RIGHT, _("# Xruns"), _("Number of dropouts that occured during recording")); + setup_col (append_col (_columns.take_id, "2021-01-19 02:34:03"), 18, ALIGN_LEFT, _("Take ID"), _("Take ID")); + _display.get_column (0)->set_resizable (true); +} diff --git a/gtk2_ardour/trigger_source_list.h b/gtk2_ardour/trigger_source_list.h new file mode 100644 index 0000000000..f05385b26e --- /dev/null +++ b/gtk2_ardour/trigger_source_list.h @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2021 Robin Gareus + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +#ifndef _gtk_ardour_trigger_source_list_h_ +#define _gtk_ardour_trigger_source_list_h_ + +#include "source_list_base.h" + +class TriggerSourceList : public SourceListBase +{ +public: + TriggerSourceList (); +}; + +#endif /* _gtk_ardour_trigger_source_list_h_ */ diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index e0a9374dc8..2662d67a60 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -315,6 +315,7 @@ gtk2_ardour_sources = [ 'trigger_clip_picker.cc', 'trigger_page.cc', 'trigger_region_list.cc', + 'trigger_source_list.cc', 'trigger_strip.cc', 'trigger_master.cc', 'trigger_ui.cc',