2 Copyright (C) 2005 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 #ifndef NEW_SESSION_DIALOG_H
23 #define NEW_SESSION_DIALOG_H
26 #include <gtkmm/treeview.h>
27 #include <gtkmm/treestore.h>
28 #include <gtkmm/treepath.h>
29 #include <gtkmm/scrolledwindow.h>
30 #include <gtkmm/notebook.h>
31 #include <gtkmm/table.h>
32 #include <gtkmm/alignment.h>
33 #include <gtkmm/frame.h>
34 #include <gtkmm/expander.h>
36 #include <ardour/utils.h>
38 #include <glibmm/refptr.h>
40 #include "ardour_dialog.h"
44 class FileChooserButton;
52 class NewSessionDialog : public ArdourDialog
58 void set_session_name(const Glib::ustring& name);
60 std::string session_name() const;
61 std::string session_folder() const;
63 bool use_session_template() const;
64 std::string session_template_name() const;
68 bool create_master_bus() const;
69 int master_channel_count() const;
71 bool create_control_bus() const;
72 int control_channel_count() const;
74 bool connect_inputs() const;
75 bool limit_inputs_used_for_connection() const;
76 int input_limit_count() const;
78 bool connect_outputs() const;
79 bool limit_outputs_used_for_connection() const;
80 int output_limit_count() const;
82 bool connect_outs_to_master() const;
83 bool connect_outs_to_physical() const ;
85 bool on_new_session_page () const;
87 void set_current_page (int);
90 // reset everything to default values.
96 void reset_template();
98 Gtk::Label * session_name_label;
99 Gtk::Label * session_location_label;
100 Gtk::Label * session_template_label;
101 Gtk::Label * chan_count_label_1;
102 Gtk::Label * chan_count_label_2;
103 Gtk::Label * chan_count_label_3;
104 Gtk::Label * chan_count_label_4;
105 Gtk::Table * advanced_table;
106 Gtk::HBox * input_port_limit_hbox;
107 Gtk::VBox * input_port_vbox;
108 Gtk::Table * input_table;
109 Gtk::HBox * input_hbox;
111 Gtk::Label * bus_label;
112 Gtk::Frame * bus_frame;
113 Gtk::Table * bus_table;
114 Gtk::HBox * bus_hbox;
116 Gtk::Label * input_label;
117 Gtk::Frame * input_frame;
118 Gtk::HBox * output_port_limit_hbox;
119 Gtk::VBox * output_port_vbox;
120 Gtk::VBox * output_conn_vbox;
121 Gtk::VBox * output_vbox;
122 Gtk::HBox * output_hbox;
124 Gtk::Label * output_label;
125 Gtk::Frame * output_frame;
126 Gtk::VBox * advanced_vbox;
127 Gtk::Label * advanced_label;
128 Gtk::Expander * advanced_expander;
129 Gtk::Table * new_session_table;
130 Gtk::HBox * open_session_hbox;
131 Gtk::ScrolledWindow * recent_scrolledwindow;
133 Gtk::Label * recent_sesion_label;
134 Gtk::Frame * recent_frame;
135 Gtk::VBox * open_session_vbox;
137 Gtk::FileChooserButton* m_folder;
138 Gtk::FileChooserButton* m_template;
139 Gtk::Label * open_session_file_label;
141 Gtk::CheckButton* m_create_master_bus;
142 Gtk::SpinButton* m_master_bus_channel_count;
144 Gtk::CheckButton* m_create_control_bus;
145 Gtk::SpinButton* m_control_bus_channel_count;
147 Gtk::CheckButton* m_connect_inputs;
148 Gtk::CheckButton* m_limit_input_ports;
149 Gtk::SpinButton* m_input_limit_count;
151 Gtk::CheckButton* m_connect_outputs;
152 Gtk::CheckButton* m_limit_output_ports;
153 Gtk::SpinButton* m_output_limit_count;
155 Gtk::RadioButton* m_connect_outputs_to_master;
156 Gtk::RadioButton* m_connect_outputs_to_physical;
157 Gtk::Button* m_okbutton;
159 Gtk::FileChooserButton* m_open_filechooser;
160 Gtk::TreeView* m_treeview;
161 Gtk::Notebook* m_notebook;
164 struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
165 RecentSessionModelColumns() {
169 Gtk::TreeModelColumn<std::string> visible_name;
170 Gtk::TreeModelColumn<std::string> fullpath;
173 RecentSessionModelColumns recent_columns;
174 Glib::RefPtr<Gtk::TreeStore> recent_model;
176 void recent_session_selection_changed ();
177 void nsd_redisplay_recent_sessions();
178 void nsd_recent_session_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
179 struct RecentSessionsSorter {
180 bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
181 return cmp_nocase(a.first, b.first) == -1;
184 void on_new_session_name_entry_changed();
185 void notebook_page_changed (GtkNotebookPage*, uint);
186 void treeview_selection_changed ();
188 void template_chosen ();
189 void recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*);
190 void connect_inputs_clicked ();
191 void connect_outputs_clicked ();
192 void limit_inputs_clicked ();
193 void limit_outputs_clicked ();
194 void master_bus_button_clicked ();
195 void monitor_bus_button_clicked ();
199 #endif // NEW_SESSION_DIALOG_H