OSC: Changed gainVCA to gainfader as VCA is already used.
[ardour.git] / gtk2_ardour / export_filename_selector.h
1 /*
2     Copyright (C) 2008 Paul Davis
3     Author: Sakari Bergen
4
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.
9
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.
14
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.
18
19 */
20
21 #ifndef __export_filename_selector_h__
22 #define __export_filename_selector_h__
23
24 #include <gtkmm.h>
25
26 #include "ardour/export_profile_manager.h"
27 #include "ardour/export_filename.h"
28 #include "ardour/session_handle.h"
29
30 ///
31 class ExportFilenameSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr
32 {
33   public:
34         typedef boost::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
35
36         ExportFilenameSelector ();
37         ~ExportFilenameSelector ();
38
39         void set_state (ARDOUR::ExportProfileManager::FilenameStatePtr state_, ARDOUR::Session * session_);
40         void set_example_filename (std::string filename);
41         void require_timespan (bool);
42
43         /* Compatibility with other elements */
44
45         sigc::signal<void> CriticalSelectionChanged;
46
47   private:
48
49         void load_state ();
50
51         void update_label ();
52         void update_folder ();
53         void check_folder ();
54
55         void change_date_format ();
56         void change_time_format ();
57
58         void change_session_selection ();
59         void change_timespan_selection ();
60         void change_revision_selection ();
61         void change_revision_value ();
62
63         void open_browse_dialog ();
64
65         boost::shared_ptr<ARDOUR::ExportFilename> filename;
66
67         Glib::RefPtr<Gtk::SizeGroup> label_sizegroup;
68
69         Gtk::Label        include_label;
70
71         Gtk::HBox         include_hbox;
72
73         Gtk::Label        label_label;
74         Gtk::Entry        label_entry;
75
76         Gtk::CheckButton  session_checkbox;
77         Gtk::CheckButton  timespan_checkbox;
78
79         Gtk::CheckButton  revision_checkbox;
80         Gtk::SpinButton   revision_spinbutton;
81
82         Gtk::HBox         path_hbox;
83
84         Gtk::Label        path_label;
85         Gtk::Entry        path_entry;
86         Gtk::Button       browse_button;
87         Gtk::Label        example_filename_label;
88
89         /* Date combo */
90
91         typedef ARDOUR::ExportFilename::DateFormat DateFormat;
92
93         struct DateFormatCols : public Gtk::TreeModelColumnRecord
94         {
95           public:
96                 Gtk::TreeModelColumn<DateFormat>     format;
97                 Gtk::TreeModelColumn<std::string>  label;
98
99                 DateFormatCols () { add(format); add(label); }
100         };
101         DateFormatCols               date_format_cols;
102         Glib::RefPtr<Gtk::ListStore> date_format_list;
103         Gtk::ComboBox                date_format_combo;
104
105         /* Time combo */
106
107         typedef ARDOUR::ExportFilename::TimeFormat TimeFormat;
108
109         struct TimeFormatCols : public Gtk::TreeModelColumnRecord
110         {
111           public:
112                 Gtk::TreeModelColumn<TimeFormat>     format;
113                 Gtk::TreeModelColumn<std::string>  label;
114
115                 TimeFormatCols () { add(format); add(label); }
116         };
117         TimeFormatCols               time_format_cols;
118         Glib::RefPtr<Gtk::ListStore> time_format_list;
119         Gtk::ComboBox                time_format_combo;
120
121         /* timespan logic */
122         void update_timespan_sensitivity ();
123         bool _require_timespan;
124 };
125
126 #endif /* __export_filename_selector_h__ */