diff --git a/gtk2_ardour/trigger_clip_picker.cc b/gtk2_ardour/trigger_clip_picker.cc new file mode 100644 index 0000000000..b08b624100 --- /dev/null +++ b/gtk2_ardour/trigger_clip_picker.cc @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2019-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 "gtkmm2ext/utils.h" + +#include "trigger_clip_picker.h" + +TriggerClipPicker::TriggerClipPicker () + : _fc (Gtk::FILE_CHOOSER_ACTION_OPEN) +{ + Gtkmm2ext::add_volume_shortcuts (_fc); + pack_start (_fc); + _fc.show (); +} + +TriggerClipPicker::~TriggerClipPicker () +{ +} diff --git a/gtk2_ardour/trigger_clip_picker.h b/gtk2_ardour/trigger_clip_picker.h new file mode 100644 index 0000000000..85c1eca9ad --- /dev/null +++ b/gtk2_ardour/trigger_clip_picker.h @@ -0,0 +1,35 @@ +/* + * 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_clip_picker_h__ +#define __gtk_ardour_trigger_clip_picker_h__ + +#include +#include + +class TriggerClipPicker : public Gtk::VBox +{ +public: + TriggerClipPicker (); + ~TriggerClipPicker (); + +private: + Gtk::FileChooserWidget _fc; +}; + +#endif diff --git a/gtk2_ardour/trigger_page.cc b/gtk2_ardour/trigger_page.cc index 51062ae940..1aa64545da 100644 --- a/gtk2_ardour/trigger_page.cc +++ b/gtk2_ardour/trigger_page.cc @@ -117,11 +117,6 @@ TriggerPage::TriggerPage () _parameter_box.pack_start (*table); -#if 1 /* Placeholders */ - _browser_box.pack_start (*Gtk::manage (new Gtk::Label ("File Browser"))); - _browser_box.show_all (); -#endif - /* Upper pane (slot | strips | file browser) */ _strip_scroller.add (_strip_packer); @@ -136,7 +131,7 @@ TriggerPage::TriggerPage () _strip_group_box.pack_start (_strip_scroller, true, true); _pane_upper.add (_strip_group_box); - _pane_upper.add (_browser_box); + _pane_upper.add (_trigger_clip_picker); /* Top-level Layout */ _pane.add (_pane_upper); @@ -152,7 +147,7 @@ TriggerPage::TriggerPage () _strip_scroller.show (); _strip_packer.show (); _slot_area_box.show_all (); - _browser_box.show (); + _trigger_clip_picker.show (); /* setup keybidings */ _content.set_data ("ardour-bindings", bindings); diff --git a/gtk2_ardour/trigger_page.h b/gtk2_ardour/trigger_page.h index 4b2074bec3..b5e23e4b4d 100644 --- a/gtk2_ardour/trigger_page.h +++ b/gtk2_ardour/trigger_page.h @@ -30,6 +30,7 @@ #include "widgets/tabbable.h" #include "fitted_canvas_widget.h" +#include "trigger_clip_picker.h" class TriggerStrip; class CueMaster; @@ -86,9 +87,10 @@ private: Gtk::HBox _strip_packer; Gtk::EventBox _no_strips; Gtk::VBox _slot_area_box; - Gtk::VBox _browser_box; Gtk::HBox _parameter_box; + TriggerClipPicker _trigger_clip_picker; + FittedCanvasWidget _master_widget; CueMaster* _master; diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 392d23c9ce..f848ad7db8 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -308,6 +308,7 @@ gtk2_ardour_sources = [ 'transport_control_ui.cc', 'transport_masters_dialog.cc', 'transpose_dialog.cc', + 'trigger_clip_picker.cc', 'trigger_page.cc', 'trigger_strip.cc', 'trigger_master.cc',