switch to using boost::signals2 instead of sigc++, at least for libardour. not finish...
[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
41         /* Compatibility with other elements */
42
43         sigc::signal<void> CriticalSelectionChanged;
44
45   private:
46
47         void load_state ();
48
49         void update_label ();
50         void update_folder ();
51
52         void change_date_format ();
53         void change_time_format ();
54
55         void change_session_selection ();
56         void change_revision_selection ();
57         void change_revision_value ();
58
59         void open_browse_dialog ();
60
61         boost::shared_ptr<ARDOUR::ExportFilename> filename;
62
63         Glib::RefPtr<Gtk::SizeGroup> label_sizegroup;
64
65         Gtk::Label        include_label;
66
67         Gtk::HBox         include_hbox;
68
69         Gtk::Label        label_label;
70         Gtk::Entry        label_entry;
71
72         Gtk::CheckButton  session_checkbox;
73
74         Gtk::CheckButton  revision_checkbox;
75         Gtk::SpinButton   revision_spinbutton;
76
77         Gtk::HBox         path_hbox;
78
79         Gtk::Label        path_label;
80         Gtk::Entry        path_entry;
81         Gtk::Button       browse_button;
82
83         /* Date combo */
84
85         typedef ARDOUR::ExportFilename::DateFormat DateFormat;
86
87         struct DateFormatCols : public Gtk::TreeModelColumnRecord
88         {
89           public:
90                 Gtk::TreeModelColumn<DateFormat>     format;
91                 Gtk::TreeModelColumn<Glib::ustring>  label;
92
93                 DateFormatCols () { add(format); add(label); }
94         };
95         DateFormatCols               date_format_cols;
96         Glib::RefPtr<Gtk::ListStore> date_format_list;
97         Gtk::ComboBox                date_format_combo;
98
99         /* Time combo */
100
101         typedef ARDOUR::ExportFilename::TimeFormat TimeFormat;
102
103         struct TimeFormatCols : public Gtk::TreeModelColumnRecord
104         {
105           public:
106                 Gtk::TreeModelColumn<TimeFormat>     format;
107                 Gtk::TreeModelColumn<Glib::ustring>  label;
108
109                 TimeFormatCols () { add(format); add(label); }
110         };
111         TimeFormatCols               time_format_cols;
112         Glib::RefPtr<Gtk::ListStore> time_format_list;
113         Gtk::ComboBox                time_format_combo;
114
115 };
116
117 #endif /* __export_filename_selector_h__ */