diff --git a/gtk2_ardour/icons/spin_down_12x11.png b/gtk2_ardour/icons/spin_down_12x11.png
new file mode 100644
index 0000000000..5d5294263c
Binary files /dev/null and b/gtk2_ardour/icons/spin_down_12x11.png differ
diff --git a/gtk2_ardour/icons/spin_down_12x11_inactive.png b/gtk2_ardour/icons/spin_down_12x11_inactive.png
new file mode 100644
index 0000000000..0776a33d2e
Binary files /dev/null and b/gtk2_ardour/icons/spin_down_12x11_inactive.png differ
diff --git a/gtk2_ardour/icons/spin_up_12x11.png b/gtk2_ardour/icons/spin_up_12x11.png
new file mode 100644
index 0000000000..25d92c790b
Binary files /dev/null and b/gtk2_ardour/icons/spin_up_12x11.png differ
diff --git a/gtk2_ardour/icons/spin_up_12x11_inactive.png b/gtk2_ardour/icons/spin_up_12x11_inactive.png
new file mode 100644
index 0000000000..9d21fc34df
Binary files /dev/null and b/gtk2_ardour/icons/spin_up_12x11_inactive.png differ
diff --git a/gtk2_ardour/ui/waves_export_filename_selector.xml b/gtk2_ardour/ui/waves_export_filename_selector.xml
new file mode 100644
index 0000000000..094676a861
--- /dev/null
+++ b/gtk2_ardour/ui/waves_export_filename_selector.xml
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gtk2_ardour/waves_export_dialog.cc b/gtk2_ardour/waves_export_dialog.cc
index 90e5aa2d6f..519d824d98 100644
--- a/gtk2_ardour/waves_export_dialog.cc
+++ b/gtk2_ardour/waves_export_dialog.cc
@@ -1,6 +1,6 @@
/*
Copyright (C) 2008 Paul Davis
- Copyright (C) 2014 Waves Audio Ltd.
+ Copyright (C) 2015 Waves Audio Ltd.
Author: Sakari Bergen
This program is free software; you can redistribute it and/or modify
diff --git a/gtk2_ardour/waves_export_file_notebook.cc b/gtk2_ardour/waves_export_file_notebook.cc
index ac72895c4e..05928c9ce8 100644
--- a/gtk2_ardour/waves_export_file_notebook.cc
+++ b/gtk2_ardour/waves_export_file_notebook.cc
@@ -1,6 +1,6 @@
/*
Copyright (C) 2008 Paul Davis
- Copyright (C) 2014 Waves Audio Ltd.
+ Copyright (C) 2015 Waves Audio Ltd.
Author: Sakari Bergen
This program is free software; you can redistribute it and/or modify
diff --git a/gtk2_ardour/waves_export_file_notebook.h b/gtk2_ardour/waves_export_file_notebook.h
index 3ae1258a99..b4cec37e2f 100644
--- a/gtk2_ardour/waves_export_file_notebook.h
+++ b/gtk2_ardour/waves_export_file_notebook.h
@@ -1,6 +1,6 @@
/*
Copyright (C) 2008 Paul Davis
- Copyright (C) 2014 Waves Audio Ltd.
+ Copyright (C) 2015 Waves Audio Ltd.
Author: Sakari Bergen
This program is free software; you can redistribute it and/or modify
@@ -29,7 +29,7 @@
#include "ardour/session_handle.h"
#include "export_format_selector.h"
-#include "export_filename_selector.h"
+#include "waves_export_filename_selector.h"
#include "soundcloud_export_selector.h"
class WavesExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
@@ -109,7 +109,7 @@ class WavesExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHand
Gtk::Label filename_label;
Gtk::Alignment filename_align;
- ExportFilenameSelector filename_selector;
+ WavesExportFilenameSelector filename_selector;
Gtk::CheckButton soundcloud_upload_button;
Gtk::HBox tab_widget;
diff --git a/gtk2_ardour/waves_export_filename_selector.cc b/gtk2_ardour/waves_export_filename_selector.cc
new file mode 100644
index 0000000000..970ae943bc
--- /dev/null
+++ b/gtk2_ardour/waves_export_filename_selector.cc
@@ -0,0 +1,273 @@
+/*
+ Copyright (C) 2008 Paul Davis
+ Copyright (C) 2015 Waves Audio Ltd.
+ Author: Sakari Bergen
+
+ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include
+#include "open_file_dialog_proxy.h"
+
+#include "waves_export_filename_selector.h"
+#include "waves_message_dialog.h"
+
+#include "i18n.h"
+
+using namespace ARDOUR;
+
+WavesExportFilenameSelector::WavesExportFilenameSelector ()
+ : Gtk::VBox ()
+ , WavesUI ("waves_export_filename_selector.xml", *this)
+ , _date_format_dropdown (get_waves_dropdown ("date_format_dropdown"))
+ , _time_format_dropdown (get_waves_dropdown ("time_format_dropdown"))
+ , _session_button (get_waves_button ("session_button"))
+ , _revision_button (get_waves_button ("revision_button"))
+ , _label_entry (get_entry ("label_entry"))
+ , _path_entry (get_entry ("path_entry"))
+ , _revision_entry (get_entry ("revision_entry"))
+ , _revision_inc_button (get_waves_button ("revision_inc_button"))
+ , _revision_dec_button (get_waves_button ("revision_dec_button"))
+ , _browse_button (get_waves_button ("browse_button"))
+ , _example_filename_label (get_label("example_filename_label"))
+{
+ /* Date */
+ _date_format_dropdown.selected_item_changed.connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::change_date_format));
+
+ /* Time */
+ _time_format_dropdown.selected_item_changed.connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::change_time_format));
+
+ /* Signals */
+ _label_entry.signal_changed().connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::update_label));
+ _path_entry.signal_changed().connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::update_folder));
+ _revision_entry.signal_changed().connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::update_revision));
+ _path_entry.signal_activate().connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::check_folder), false);
+
+ _session_button.signal_clicked.connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::change_session_selection));
+ _revision_inc_button.signal_clicked.connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::on_revision_inc_button));
+ _revision_dec_button.signal_clicked.connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::on_revision_dec_button));
+ _revision_button.signal_clicked.connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::change_revision_selection));
+ _browse_button.signal_clicked.connect (sigc::mem_fun (*this, &WavesExportFilenameSelector::open_browse_dialog));
+}
+
+WavesExportFilenameSelector::~WavesExportFilenameSelector ()
+{
+
+}
+
+void
+WavesExportFilenameSelector::load_state ()
+{
+ if (!filename) {
+ return;
+ }
+
+ _label_entry.set_text (filename->include_label ? filename->get_label() : "");
+ _session_button.set_active (filename->include_session ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);;
+ _revision_button.set_active_state (filename->include_revision ? Gtkmm2ext::ExplicitActive : Gtkmm2ext::Off);
+ _revision_entry.set_text (string_compose ("%1", filename->get_revision()));
+ _revision_entry.set_sensitive (filename->include_revision);
+ _revision_inc_button.set_sensitive (filename->include_revision);
+ _revision_dec_button.set_sensitive (filename->include_revision);
+ _path_entry.set_text (filename->get_folder());
+
+ int size = _date_format_dropdown.get_menu ().items ().size ();
+ for (int i = 0; i < size; i++) {
+ if (_date_format_dropdown.get_item_associated_data (i) == (void*)filename->get_date_format()) {
+ _date_format_dropdown.set_current_item (i);
+ }
+ }
+
+ size = _time_format_dropdown.get_menu ().items ().size ();
+ for (int i = 0; i < size; i++) {
+ if (_time_format_dropdown.get_item_associated_data (i) == (void*)filename->get_time_format()) {
+ _time_format_dropdown.set_current_item (i);
+ }
+ }
+}
+
+void
+WavesExportFilenameSelector::set_state (ARDOUR::ExportProfileManager::FilenameStatePtr state_, ARDOUR::Session * session_)
+{
+ SessionHandlePtr::set_session (session_);
+
+ filename = state_->filename;
+
+ /* Fill dropdowns */
+
+ /* Dates */
+ _date_format_dropdown.clear_items ();
+ _date_format_dropdown.add_menu_item (filename->get_date_format_str (ExportFilename::D_None), (void*)ExportFilename::D_None);
+ _date_format_dropdown.add_menu_item (filename->get_date_format_str (ExportFilename::D_ISO), (void*)ExportFilename::D_ISO);
+ _date_format_dropdown.add_menu_item (filename->get_date_format_str (ExportFilename::D_ISOShortY), (void*)ExportFilename::D_ISOShortY);
+ _date_format_dropdown.add_menu_item (filename->get_date_format_str (ExportFilename::D_BE), (void*)ExportFilename::D_BE);
+ _date_format_dropdown.add_menu_item (filename->get_date_format_str (ExportFilename::D_BEShortY), (void*)ExportFilename::D_BEShortY);
+
+ /* Times */
+
+ _time_format_dropdown.clear_items ();
+ _time_format_dropdown.add_menu_item (filename->get_time_format_str (ExportFilename::T_None), (void*)ExportFilename::T_None);
+ _time_format_dropdown.add_menu_item (filename->get_time_format_str (ExportFilename::T_NoDelim), (void*)ExportFilename::T_NoDelim);
+ _time_format_dropdown.add_menu_item (filename->get_time_format_str (ExportFilename::T_Delim), (void*)ExportFilename::T_Delim);
+
+ /* Load state */
+
+ load_state();
+}
+
+void
+WavesExportFilenameSelector::set_example_filename (std::string filename)
+{
+ if (filename == "") {
+ _example_filename_label.set_markup (_("Sorry, no example filename can be shown at the moment"));
+ } else {
+ _example_filename_label.set_markup (string_compose(_("Current (approximate) filename: \"%1\""), filename));
+ }
+}
+
+void
+WavesExportFilenameSelector::update_label ()
+{
+ if (!filename) {
+ return;
+ }
+
+ filename->set_label (_label_entry.get_text());
+
+ filename->include_label = !_label_entry.get_text().empty();
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::on_revision_inc_button (WavesButton*)
+{
+ change_revision_value (1);
+}
+
+void
+WavesExportFilenameSelector::on_revision_dec_button (WavesButton*)
+{
+ change_revision_value (-1);
+}
+
+void
+WavesExportFilenameSelector::change_revision_value (int change)
+{
+ int revision = (int)filename->get_revision() + change;
+ filename->set_revision (revision < 1 ? 1 : revision);
+ _revision_entry.set_text (string_compose ("%1", filename->get_revision()));
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::update_folder ()
+{
+ if (!filename) {
+ return;
+ }
+
+ filename->set_folder (_path_entry.get_text());
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::check_folder ()
+{
+ if (!filename) {
+ return;
+ }
+
+ if (!Glib::file_test (_path_entry.get_text(), Glib::FILE_TEST_IS_DIR|Glib::FILE_TEST_EXISTS)) {
+ WavesMessageDialog msg ("", string_compose (_("%1: this is only the directory/folder name, not the filename.\n\
+The filename will be chosen from the information just above the folder selector."), _path_entry.get_text()));
+ msg.run ();
+ _path_entry.set_text (Glib::path_get_dirname (_path_entry.get_text()));
+ filename->set_folder (_path_entry.get_text());
+ CriticalSelectionChanged();
+ }
+}
+
+void
+WavesExportFilenameSelector::change_date_format (WavesDropdown*, int item)
+{
+ if (!filename) {
+ return;
+ }
+
+ filename->set_date_format ((DateFormat)((char*)_date_format_dropdown.get_item_associated_data(item) - (char*)0));
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::change_time_format (WavesDropdown*, int item)
+{
+ if (!filename) {
+ return;
+ }
+
+ filename->set_time_format ((TimeFormat)((char*)_time_format_dropdown.get_item_associated_data(item) - (char*)0));
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::change_session_selection (WavesButton*)
+{
+ if (!filename) {
+ return;
+ }
+
+ filename->include_session = (_session_button.active_state () == Gtkmm2ext::ExplicitActive);
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::change_revision_selection (WavesButton*)
+{
+ if (!filename) {
+ return;
+ }
+
+ bool selected = (_revision_button.active_state () == Gtkmm2ext::ExplicitActive);
+ filename->include_revision = selected;
+
+ _revision_entry.set_sensitive (selected);
+ _revision_inc_button.set_sensitive (selected);
+ _revision_dec_button.set_sensitive (selected);
+
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::update_revision ()
+{
+ if (!filename) {
+ return;
+ }
+ int revision = (uint32_t)PBD::atoi(_revision_entry.get_text());
+ filename->set_revision (revision < 1 ? 1 : revision);
+ CriticalSelectionChanged();
+}
+
+void
+WavesExportFilenameSelector::open_browse_dialog (WavesButton*)
+{
+ std::string filename = ARDOUR::choose_folder_dialog(_path_entry.get_text(), _("Choose export folder"));
+ if (!filename.empty ()) {
+ _path_entry.set_text (filename);
+ }
+ CriticalSelectionChanged();
+ return;
+}
diff --git a/gtk2_ardour/waves_export_filename_selector.h b/gtk2_ardour/waves_export_filename_selector.h
new file mode 100644
index 0000000000..9d7e2ba4cf
--- /dev/null
+++ b/gtk2_ardour/waves_export_filename_selector.h
@@ -0,0 +1,87 @@
+/*
+ Copyright (C) 2008 Paul Davis
+ Copyright (C) 2015 Waves Audio Ltd.
+ Author: Sakari Bergen
+
+ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef __waves_export_filename_selector_h__
+#define __waves_export_filename_selector_h__
+
+#include
+
+#include "ardour/export_profile_manager.h"
+#include "ardour/export_filename.h"
+#include "ardour/session_handle.h"
+#include "waves_ui.h"
+
+///
+class WavesExportFilenameSelector : public Gtk::VBox, public WavesUI, public ARDOUR::SessionHandlePtr
+{
+ public:
+ typedef boost::shared_ptr FilenamePtr;
+
+ WavesExportFilenameSelector ();
+ ~WavesExportFilenameSelector ();
+
+ void set_state (ARDOUR::ExportProfileManager::FilenameStatePtr state_, ARDOUR::Session * session_);
+ void set_example_filename (std::string filename);
+
+ /* Compatibility with other elements */
+
+ sigc::signal CriticalSelectionChanged;
+
+ private:
+
+ void load_state ();
+
+ void update_label ();
+ void update_folder ();
+ void update_revision ();
+ void check_folder ();
+
+ void change_date_format (WavesDropdown*, int);
+ void change_time_format (WavesDropdown*, int);
+
+ void change_session_selection (WavesButton*);
+ void change_revision_selection (WavesButton*);
+ void on_revision_inc_button (WavesButton*);
+ void on_revision_dec_button (WavesButton*);
+ void change_revision_value (int);
+
+ void open_browse_dialog (WavesButton*);
+
+ boost::shared_ptr filename;
+
+ WavesDropdown& _date_format_dropdown;
+ WavesDropdown& _time_format_dropdown;
+ WavesButton& _session_button;
+ WavesButton& _revision_button;
+ Gtk::Entry& _label_entry;
+ Gtk::Entry& _path_entry;
+ Gtk::Entry& _revision_entry;
+ WavesButton& _revision_inc_button;
+ WavesButton& _revision_dec_button;
+ WavesButton& _browse_button;
+ Gtk::Label& _example_filename_label;
+
+ /* Date combo */
+ typedef ARDOUR::ExportFilename::DateFormat DateFormat;
+ typedef ARDOUR::ExportFilename::TimeFormat TimeFormat;
+};
+
+#endif // __waves_export_filename_selector_h__
diff --git a/gtk2_ardour/wscript b/gtk2_ardour/wscript
index 18494e602c..84bbd3ff0b 100644
--- a/gtk2_ardour/wscript
+++ b/gtk2_ardour/wscript
@@ -34,6 +34,7 @@ gtk2_ardour_sources = [
'waves_export_file_notebook.cc',
'waves_export_preset_selector.cc',
'waves_export_timespan_selector.cc',
+ 'waves_export_filename_selector.cc',
'marker_inspector_dialog.cc',
'marker_inspector_dialog.logic.cc',
'route_inspector.cc',