2 Copyright (C) 2008 Paul Davis
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #ifndef __export_filename_selector_h__
22 #define __export_filename_selector_h__
24 #include <gtkmm/box.h>
25 #include <gtkmm/button.h>
26 #include <gtkmm/checkbutton.h>
27 #include <gtkmm/combobox.h>
28 #include <gtkmm/comboboxtext.h>
29 #include <gtkmm/entry.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/liststore.h>
32 #include <gtkmm/sizegroup.h>
33 #include <gtkmm/spinbutton.h>
34 #include <gtkmm/treemodel.h>
36 #include "ardour/export_profile_manager.h"
37 #include "ardour/export_filename.h"
38 #include "ardour/session_handle.h"
40 class ExportFilenameSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr
43 typedef boost::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
45 ExportFilenameSelector ();
46 ~ExportFilenameSelector ();
48 void set_state (ARDOUR::ExportProfileManager::FilenameStatePtr state_, ARDOUR::Session * session_);
49 void set_example_filename (std::string filename);
50 void require_timespan (bool);
52 /* Compatibility with other elements */
54 sigc::signal<void> CriticalSelectionChanged;
61 void update_folder ();
64 void change_date_format ();
65 void change_time_format ();
67 void change_session_selection ();
68 void change_timespan_selection ();
69 void change_revision_selection ();
70 void change_revision_value ();
72 void open_browse_dialog ();
75 boost::shared_ptr<ARDOUR::ExportFilename> filename;
77 Glib::RefPtr<Gtk::SizeGroup> label_sizegroup;
79 Gtk::Label include_label;
81 Gtk::HBox include_hbox;
83 Gtk::Label label_label;
84 Gtk::Entry label_entry;
86 Gtk::ComboBoxText session_snap_name;
87 Gtk::CheckButton timespan_checkbox;
89 Gtk::CheckButton revision_checkbox;
90 Gtk::SpinButton revision_spinbutton;
94 Gtk::Label path_label;
95 Gtk::Entry path_entry;
96 Gtk::Button browse_button;
97 Gtk::Button open_button;
98 Gtk::Label example_filename_label;
102 typedef ARDOUR::ExportFilename::DateFormat DateFormat;
104 struct DateFormatCols : public Gtk::TreeModelColumnRecord
107 Gtk::TreeModelColumn<DateFormat> format;
108 Gtk::TreeModelColumn<std::string> label;
110 DateFormatCols () { add(format); add(label); }
112 DateFormatCols date_format_cols;
113 Glib::RefPtr<Gtk::ListStore> date_format_list;
114 Gtk::ComboBox date_format_combo;
118 typedef ARDOUR::ExportFilename::TimeFormat TimeFormat;
120 struct TimeFormatCols : public Gtk::TreeModelColumnRecord
123 Gtk::TreeModelColumn<TimeFormat> format;
124 Gtk::TreeModelColumn<std::string> label;
126 TimeFormatCols () { add(format); add(label); }
128 TimeFormatCols time_format_cols;
129 Glib::RefPtr<Gtk::ListStore> time_format_list;
130 Gtk::ComboBox time_format_combo;
133 void update_timespan_sensitivity ();
134 bool _require_timespan;
137 #endif /* __export_filename_selector_h__ */