From 8e8a0a9ef44cf07548392b4a2e8617393fcd3b6c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 23 Sep 2016 20:43:26 +0200 Subject: [PATCH] GUI option to Exclude unused sources --- gtk2_ardour/ardour_ui.cc | 2 +- gtk2_ardour/session_archive_dialog.cc | 15 +++++++++++++++ gtk2_ardour/session_archive_dialog.h | 9 ++++++--- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 88f2a29a9d..fcbb5b4502 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2719,7 +2719,7 @@ ARDOUR_UI::archive_session () return; } - if (_session->archive_session (sad.target_folder(), sad.name(), sad.encode_option (), &sad)) { + if (_session->archive_session (sad.target_folder(), sad.name(), sad.encode_option (), sad.only_used_sources (), &sad)) { MessageDialog msg (_("Session Archiving failed.")); msg.run (); } diff --git a/gtk2_ardour/session_archive_dialog.cc b/gtk2_ardour/session_archive_dialog.cc index 24ecba6b71..15bdbc8165 100644 --- a/gtk2_ardour/session_archive_dialog.cc +++ b/gtk2_ardour/session_archive_dialog.cc @@ -33,6 +33,7 @@ using namespace ARDOUR; SessionArchiveDialog::SessionArchiveDialog () : ArdourDialog (_("Zip/Archive Session")) , ProgressReporter () + , only_used_checkbox (_("Exclude unused audio sources")) { VBox* vbox = get_vbox(); @@ -71,6 +72,8 @@ SessionArchiveDialog::SessionArchiveDialog () hbox->pack_start (encode_selector, true, true); vbox->pack_start (*hbox, false, false); + vbox->pack_start (only_used_checkbox, false, false); + vbox->pack_start (progress_bar, true, true, 12); vbox->show_all (); @@ -132,6 +135,18 @@ SessionArchiveDialog::set_name (const std::string& name) name_entry_changed (); } +bool +SessionArchiveDialog::only_used_sources () const +{ + return only_used_checkbox.get_active (); +} + +void +SessionArchiveDialog::set_only_used_sources (bool en) +{ + only_used_checkbox.set_active (en); +} + ARDOUR::Session::ArchiveEncode SessionArchiveDialog::encode_option () const { diff --git a/gtk2_ardour/session_archive_dialog.h b/gtk2_ardour/session_archive_dialog.h index c82cbf5152..a0c139b63f 100644 --- a/gtk2_ardour/session_archive_dialog.h +++ b/gtk2_ardour/session_archive_dialog.h @@ -38,16 +38,19 @@ public: std::string target_folder () const; std::string name () const; ARDOUR::Session::ArchiveEncode encode_option () const; + bool only_used_sources () const; - void set_name (const std::string&); - void set_target_folder (const std::string&); - void set_encode_option (ARDOUR::Session::ArchiveEncode); + void set_name (const std::string&); + void set_target_folder (const std::string&); + void set_encode_option (ARDOUR::Session::ArchiveEncode); + void set_only_used_sources (bool); private: Gtk::FileChooserButton target_folder_selector; Gtk::Entry name_entry; Gtk::ComboBoxText format_selector; Gtk::ComboBoxText encode_selector; + Gtk::CheckButton only_used_checkbox; Gtk::ProgressBar progress_bar;