diff --git a/gtk2_ardour/ardour.menus.in b/gtk2_ardour/ardour.menus.in index ae48033452..edff1e4ced 100644 --- a/gtk2_ardour/ardour.menus.in +++ b/gtk2_ardour/ardour.menus.in @@ -19,6 +19,7 @@ + #ifdef PTFORMAT #endif diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h index 5e74b8fdc0..bece9c6526 100644 --- a/gtk2_ardour/ardour_ui.h +++ b/gtk2_ardour/ardour_ui.h @@ -670,6 +670,7 @@ private: void save_session_as (); void archive_session (); void rename_session (bool for_unnamed); + void import_strips (); int create_mixer (); int create_editor (); diff --git a/gtk2_ardour/ardour_ui_dialogs.cc b/gtk2_ardour/ardour_ui_dialogs.cc index a619847dab..6bebcb3322 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_import_dialog.h" #include "library_download_dialog.h" #include "location_ui.h" #include "lua_script_manager.h" @@ -998,6 +999,14 @@ ARDOUR_UI::create_rtawindow () return rtawindow; } +void ARDOUR_UI::import_strips () +{ + if (_session) { + StripImportDialog isd (_session); + isd.run(); + } +} + void ARDOUR_UI::handle_locations_change (Location *) { diff --git a/gtk2_ardour/ardour_ui_ed.cc b/gtk2_ardour/ardour_ui_ed.cc index e82f0b6901..09d000f5bc 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_("ImportStrips"), _("Import Strips..."), sigc::mem_fun (*this, &ARDOUR_UI::import_strips)); + ActionManager::session_sensitive_actions.push_back (act); + act = ActionManager::register_action (main_actions, X_("Metadata"), _("Metadata")); ActionManager::session_sensitive_actions.push_back (act); diff --git a/gtk2_ardour/strip_import_dialog.cc b/gtk2_ardour/strip_import_dialog.cc new file mode 100644 index 0000000000..4748861823 --- /dev/null +++ b/gtk2_ardour/strip_import_dialog.cc @@ -0,0 +1,37 @@ +/* + * 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 "strip_import_dialog.h" + +#include "ardour/session.h" + +#include "pbd/i18n.h" + +using namespace Gtk; +using namespace std; +using namespace PBD; +using namespace ARDOUR; + +StripImportDialog::StripImportDialog (Session* s) + : ArdourDialog (_("Import Track/Bus State")) +{ +} + +StripImportDialog::~StripImportDialog () +{ +} diff --git a/gtk2_ardour/strip_import_dialog.h b/gtk2_ardour/strip_import_dialog.h new file mode 100644 index 0000000000..4fdd1ed0d3 --- /dev/null +++ b/gtk2_ardour/strip_import_dialog.h @@ -0,0 +1,38 @@ +/* + * 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 +#include +#include +#include + +#include "ardour_dialog.h" + +namespace ARDOUR +{ + class Session; +} + +class StripImportDialog : public ArdourDialog, public PBD::ScopedConnectionList +{ +public: + StripImportDialog (ARDOUR::Session*); + ~StripImportDialog (); +}; diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript index 6307cc3b18..1310588ffa 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_import_dialog.cc', 'strip_silence_dialog.cc', 'stripable_colorpicker.cc', 'stripable_time_axis.cc',