X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fsession_archive_dialog.cc;h=5e921b7d1afdb45521e3be562e343f5d712c6680;hb=c833b560296084f5887e3c37607cd5a14580be05;hp=15bdbc8165c514180dac96bffb3f16f291b4567e;hpb=8e8a0a9ef44cf07548392b4a2e8617393fcd3b6c;p=ardour.git diff --git a/gtk2_ardour/session_archive_dialog.cc b/gtk2_ardour/session_archive_dialog.cc index 15bdbc8165..5e921b7d1a 100644 --- a/gtk2_ardour/session_archive_dialog.cc +++ b/gtk2_ardour/session_archive_dialog.cc @@ -19,8 +19,9 @@ */ #include +#include -#include "ardour/session.h" +#include "ardour/filename_extensions.h" #include "session_archive_dialog.h" @@ -31,7 +32,7 @@ using namespace Gtk; using namespace ARDOUR; SessionArchiveDialog::SessionArchiveDialog () - : ArdourDialog (_("Zip/Archive Session")) + : ArdourDialog (_("Zip/Archive Current Session")) , ProgressReporter () , only_used_checkbox (_("Exclude unused audio sources")) { @@ -39,41 +40,64 @@ SessionArchiveDialog::SessionArchiveDialog () vbox->set_spacing (6); - HBox* hbox; - Label* label; - - format_selector.append_text (".tar.xz"); - format_selector.set_active_text (".tar.xz"); + format_selector.append_text (ARDOUR::session_archive_suffix); + format_selector.set_active_text (ARDOUR::session_archive_suffix); encode_selector.append_text (_("None")); encode_selector.append_text (_("FLAC 16bit")); encode_selector.append_text (_("FLAC 24bit")); encode_selector.set_active_text ("FLAC 16bit"); // TODO remember - hbox = manage (new HBox); + compression_selector.append_text (_("None")); + compression_selector.append_text (_("Fast")); + compression_selector.append_text (_("Good")); + compression_selector.set_active_text ("Good"); // TODO remember + + Gtk::Table* table = manage (new Gtk::Table ()); + table->set_col_spacings (10); + table->set_row_spacings (8); + + Label* label; + int row = 0; + + label = manage (new Label (_("Archive Name:"), Gtk::ALIGN_END, Gtk::ALIGN_CENTER, false)); + table->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK); + + HBox* hbox = manage (new HBox); hbox->set_spacing (6); - label = manage (new Label (_("Archive Name"))); - hbox->pack_start (*label, false, false); hbox->pack_start (name_entry, true, true); hbox->pack_start (format_selector, false, false); - vbox->pack_start (*hbox, false, false); + table->attach (*hbox, 1, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK); - hbox = manage (new HBox); - hbox->set_spacing (6); - label = manage (new Label (_("Target directory/folder"))); - hbox->pack_start (*label, false, false); - hbox->pack_start (target_folder_selector, true, true); - vbox->pack_start (*hbox, false, false); + ++row; - hbox = manage (new HBox); - hbox->set_spacing (6); - label = manage (new Label (_("Audio Compression"))); - hbox->pack_start (*label, false, false); - hbox->pack_start (encode_selector, true, true); - vbox->pack_start (*hbox, false, false); + label = manage (new Label (_("Target directory/folder:"), Gtk::ALIGN_END, Gtk::ALIGN_CENTER, false)); + table->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK); + table->attach (target_folder_selector, 1, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK); + + ++row; + + label = manage (new Label (_("Audio Compression:"), Gtk::ALIGN_END, Gtk::ALIGN_CENTER, false)); + table->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK); + table->attach (encode_selector, 1, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK); + + ++row; + + label = manage (new Label (_("Archive Compression:"), Gtk::ALIGN_END, Gtk::ALIGN_CENTER, false)); + table->attach (*label, 0, 1, row, row + 1, Gtk::FILL, Gtk::SHRINK); + table->attach (compression_selector, 1, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK); + + ++row; + + table->attach (only_used_checkbox, 0, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK); - vbox->pack_start (only_used_checkbox, false, false); + ++row; + label = manage (new Label (_("Note: This archives only the current session state, snapshots are not included."), ALIGN_START)); + label->set_line_wrap (true); + table->attach (*label, 0, 2, row, row + 1, Gtk::FILL | Gtk::EXPAND, Gtk::SHRINK); + + vbox->pack_start (*table, false, false); vbox->pack_start (progress_bar, true, true, 12); vbox->show_all (); @@ -176,6 +200,34 @@ SessionArchiveDialog::set_encode_option (ARDOUR::Session::ArchiveEncode e) } } +PBD::FileArchive::CompressionLevel +SessionArchiveDialog::compression_level () const +{ + string codec = compression_selector.get_active_text (); + if (codec == _("Fast")) { + return PBD::FileArchive::CompressFast; + } else if (codec == _("None")) { + return PBD::FileArchive::CompressNone; + } + return PBD::FileArchive::CompressGood; +} + +void +SessionArchiveDialog::set_compression_level (PBD::FileArchive::CompressionLevel l) +{ + switch (l) { + case PBD::FileArchive::CompressFast: + encode_selector.set_active_text (_("Fast")); + break; + case PBD::FileArchive::CompressNone: + encode_selector.set_active_text (_("None")); + break; + case PBD::FileArchive::CompressGood: + encode_selector.set_active_text (_("Good")); + break; + } +} + void SessionArchiveDialog::update_progress_gui (float p) {