Remove <gtkmm.h> include from header files.
[ardour.git] / gtk2_ardour / export_file_notebook.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_file_notebook_h__
22 #define __export_file_notebook_h__
23
24 #include <sigc++/signal.h>
25
26 #include <gtkmm/alignment.h>
27 #include <gtkmm/box.h>
28 #include <gtkmm/button.h>
29 #include <gtkmm/checkbutton.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/notebook.h>
32
33 #include "ardour/export_profile_manager.h"
34 #include "ardour/session_handle.h"
35
36 #include "export_format_selector.h"
37 #include "export_filename_selector.h"
38 #include "soundcloud_export_selector.h"
39
40 class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
41 {
42 public:
43
44         ExportFileNotebook ();
45
46         void set_session_and_manager (ARDOUR::Session * s, boost::shared_ptr<ARDOUR::ExportProfileManager> manager);
47         void sync_with_manager ();
48         void update_example_filenames();
49
50         boost::shared_ptr<SoundcloudExportSelector> soundcloud_export_selector;
51
52         sigc::signal<void> CriticalSelectionChanged;
53
54 private:
55
56         typedef boost::shared_ptr<ARDOUR::ExportProfileManager> ManagerPtr;
57         typedef boost::shared_ptr<ARDOUR::ExportFormatSpecification> FormatPtr;
58         typedef boost::shared_ptr<ARDOUR::ExportFilename> FilenamePtr;
59         class FilePage;
60
61         ManagerPtr        profile_manager;
62
63         void add_new_file_page ();
64         void add_file_page (ARDOUR::ExportProfileManager::FormatStatePtr format_state, ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
65         void remove_file_page (FilePage * page);
66         void update_remove_file_page_sensitivity ();
67         void update_soundcloud_upload ();
68
69         sigc::connection page_change_connection;
70         void handle_page_change (GtkNotebookPage*, uint32_t page);
71
72         Gtk::HBox    new_file_hbox;
73         Gtk::Button  new_file_button;
74         Gtk::VBox    new_file_dummy;
75
76         uint32_t     last_visible_page;
77         uint32_t     page_counter;
78
79         class FilePage : public Gtk::VBox
80         {
81         public:
82                 FilePage (ARDOUR::Session * s, ManagerPtr profile_manager, ExportFileNotebook * parent, uint32_t number,
83                           ARDOUR::ExportProfileManager::FormatStatePtr format_state,
84                           ARDOUR::ExportProfileManager::FilenameStatePtr filename_state);
85
86                 virtual ~FilePage ();
87
88                 Gtk::Widget & get_tab_widget () { return tab_widget; }
89                 void set_remove_sensitive (bool value);
90                 std::string get_format_name () const;
91                 bool get_soundcloud_upload () const;
92
93                 void update_example_filename();
94
95                 void update_analysis_button ();
96                 void update_soundcloud_upload_button ();
97
98                 ARDOUR::ExportProfileManager::FormatStatePtr   get_format_state () const { return format_state; }
99                 ARDOUR::ExportProfileManager::FilenameStatePtr get_filename_state () const { return filename_state; }
100
101                 sigc::signal<void> CriticalSelectionChanged;
102
103         private:
104                 void save_format_to_manager (FormatPtr format);
105                 void update_tab_label ();
106                 void critical_selection_changed ();
107                 void analysis_changed ();
108                 void soundcloud_upload_changed ();
109
110                 ARDOUR::ExportProfileManager::FormatStatePtr   format_state;
111                 ARDOUR::ExportProfileManager::FilenameStatePtr filename_state;
112                 ManagerPtr                                     profile_manager;
113
114                 /* GUI components */
115
116                 Gtk::Label              format_label;
117                 Gtk::Alignment          format_align;
118                 ExportFormatSelector    format_selector;
119                 PBD::ScopedConnection   format_connection;
120
121                 Gtk::Label              filename_label;
122                 Gtk::Alignment          filename_align;
123                 ExportFilenameSelector  filename_selector;
124
125                 Gtk::CheckButton        soundcloud_upload_button;
126                 Gtk::CheckButton        analysis_button;
127                 Gtk::HBox               tab_widget;
128                 Gtk::Label              tab_label;
129                 Gtk::Alignment          tab_close_alignment;
130                 Gtk::Button             tab_close_button;
131                 uint32_t                tab_number;
132         };
133 };
134
135 #endif