From cbbe96a6988a3b6ac087394687db30e52ba0fa7b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 17 Nov 2025 16:24:30 +0100 Subject: [PATCH] Bootstrap Strip Export Dialog --- gtk2_ardour/ardour.menus.in | 1 + gtk2_ardour/ardour_ui.h | 1 + gtk2_ardour/ardour_ui_dialogs.cc | 9 +++++++ gtk2_ardour/ardour_ui_ed.cc | 3 +++ gtk2_ardour/strip_export_dialog.cc | 42 ++++++++++++++++++++++++++++++ gtk2_ardour/strip_export_dialog.h | 34 ++++++++++++++++++++++++ gtk2_ardour/wscript | 1 + 7 files changed, 91 insertions(+) create mode 100644 gtk2_ardour/strip_export_dialog.cc create mode 100644 gtk2_ardour/strip_export_dialog.h diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index edff1e4ced..2cac81a616 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -20,6 +20,7 @@ + #ifdef PTFORMAT #endif diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index bece9c6526..9441884ad6 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -671,6 +671,7 @@ private: void archive_session (); void rename_session (bool for_unnamed); void import_strips (); + void export_strips (); int create_mixer (); int create_editor (); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index 6bebcb3322..7f52e68bcb 100644 --- a/gtk2_ardour/ardour_ui_dialogs.cc +++ b/gtk2_ardour/ardour_ui_dialogs.cc @@ -61,6 +61,7 @@ #include "gui_object.h" #include "gui_thread.h" #include "keyeditor.h" +#include "strip_export_dialog.h" #include "strip_import_dialog.h" #include "library_download_dialog.h" #include "location_ui.h" @@ -999,6 +1000,14 @@ ARDOUR_UI::create_rtawindow () return rtawindow; } +void ARDOUR_UI::export_strips () +{ + if (_session) { + StripExportDialog esd (*editor, _session); + esd.run(); + } +} + void ARDOUR_UI::import_strips () { if (_session) { diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index 09d000f5bc..df6b6914ff 100644 --- a/gtk2_ardour/ardour_ui_ed.cc +++ b/gtk2_ardour/ardour_ui_ed.cc @@ -257,6 +257,9 @@ ARDOUR_UI::install_actions () act = ActionManager::register_action (main_actions, X_("ManageTemplates"), _("Templates"), sigc::mem_fun(*this, &ARDOUR_UI::manage_templates)); ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (main_actions, X_("ExportStrips"), _("Export Strips..."), sigc::mem_fun (*this, &ARDOUR_UI::export_strips)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (main_actions, X_("ImportStrips"), _("Import Strips..."), sigc::mem_fun (*this, &ARDOUR_UI::import_strips)); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/strip_export_dialog.cc b/gtk2_ardour/strip_export_dialog.cc new file mode 100644 index 0000000000..45a395e450 --- /dev/null +++ b/gtk2_ardour/strip_export_dialog.cc @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2025 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 + +#include "ardour/session.h" + +#include "strip_export_dialog.h" + +#include "pbd/i18n.h" + +using namespace Gtk; +using namespace std; +using namespace PBD; +using namespace ARDOUR; + +StripExportDialog::StripExportDialog (PublicEditor& editor, Session* s) + : ArdourDialog (_("Export Track/Bus State")) +{ + set_session (s); + + add_button (Stock::CANCEL, RESPONSE_CANCEL); +} + +StripExportDialog::~StripExportDialog () +{ +} diff --git a/gtk2_ardour/strip_export_dialog.h b/gtk2_ardour/strip_export_dialog.h new file mode 100644 index 0000000000..3be81f149c --- /dev/null +++ b/gtk2_ardour/strip_export_dialog.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 2025 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. + */ + +#pragma once + +#include "ardour_dialog.h" +#include "public_editor.h" + +namespace ARDOUR +{ + class Session; +} + +class StripExportDialog : public ArdourDialog +{ +public: + StripExportDialog (PublicEditor&, ARDOUR::Session*); + ~StripExportDialog (); +}; diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 1310588ffa..ff30c4becc 100644 --- a/gtk2_ardour/wscript +++ b/gtk2_ardour/wscript @@ -304,6 +304,7 @@ gtk2_ardour_sources = [ 'stereo_panner.cc', 'stereo_panner_editor.cc', 'streamview.cc', + 'strip_export_dialog.cc', 'strip_import_dialog.cc', 'strip_silence_dialog.cc', 'stripable_colorpicker.cc',