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.
23 #ifndef NEW_SESSION_DIALOG_H
24 #define NEW_SESSION_DIALOG_H
27 #include <gtkmm/treeview.h>
28 #include <gtkmm/treestore.h>
29 #include <gtkmm/treepath.h>
30 #include <gtkmm/scrolledwindow.h>
31 #include <gtkmm/notebook.h>
32 #include <gtkmm/table.h>
33 #include <gtkmm/alignment.h>
34 #include <gtkmm/frame.h>
35 #include <gtkmm/expander.h>
37 #include <ardour/utils.h>
39 #include <glibmm/refptr.h>
41 #include "ardour_dialog.h"
45 class FileChooserButton;
53 class NewSessionDialog : public ArdourDialog
59 void set_session_name(const Glib::ustring& name);
61 std::string session_name() const;
62 std::string session_folder() const;
64 bool use_session_template() const;
65 std::string session_template_name() const;
69 bool create_master_bus() const;
70 int master_channel_count() const;
72 bool create_control_bus() const;
73 int control_channel_count() const;
75 bool connect_inputs() const;
76 bool limit_inputs_used_for_connection() const;
77 int input_limit_count() const;
79 bool connect_outputs() const;
80 bool limit_outputs_used_for_connection() const;
81 int output_limit_count() const;
83 bool connect_outs_to_master() const;
84 bool connect_outs_to_physical() const ;
85 int get_current_page();
88 // reset everything to default values.
94 void reset_template();
96 Gtk::Label * session_name_label;
97 Gtk::Label * session_location_label;
98 Gtk::Label * session_template_label;
99 Gtk::Label * chan_count_label_1;
100 Gtk::Label * chan_count_label_2;
101 Gtk::Label * chan_count_label_3;
102 Gtk::Label * chan_count_label_4;
103 Gtk::Table * advanced_table;
104 Gtk::HBox * input_port_limit_hbox;
105 Gtk::VBox * input_port_vbox;
106 Gtk::Table * input_table;
107 Gtk::HBox * input_hbox;
109 Gtk::Label * bus_label;
110 Gtk::Frame * bus_frame;
111 Gtk::Table * bus_table;
112 Gtk::HBox * bus_hbox;
114 Gtk::Label * input_label;
115 Gtk::Frame * input_frame;
116 Gtk::HBox * output_port_limit_hbox;
117 Gtk::VBox * output_port_vbox;
118 Gtk::VBox * output_conn_vbox;
119 Gtk::VBox * output_vbox;
120 Gtk::HBox * output_hbox;
122 Gtk::Label * output_label;
123 Gtk::Frame * output_frame;
124 Gtk::VBox * advanced_vbox;
125 Gtk::Label * advanced_label;
126 Gtk::Expander * advanced_expander;
127 Gtk::Table * new_session_table;
128 Gtk::HBox * open_session_hbox;
129 Gtk::ScrolledWindow * recent_scrolledwindow;
131 Gtk::Label * recent_sesion_label;
132 Gtk::Frame * recent_frame;
133 Gtk::VBox * open_session_vbox;
135 Gtk::FileChooserButton* m_folder;
136 Gtk::FileChooserButton* m_template;
137 Gtk::Label * open_session_file_label;
139 Gtk::CheckButton* m_create_master_bus;
140 Gtk::SpinButton* m_master_bus_channel_count;
142 Gtk::CheckButton* m_create_control_bus;
143 Gtk::SpinButton* m_control_bus_channel_count;
145 Gtk::CheckButton* m_connect_inputs;
146 Gtk::CheckButton* m_limit_input_ports;
147 Gtk::SpinButton* m_input_limit_count;
149 Gtk::CheckButton* m_connect_outputs;
150 Gtk::CheckButton* m_limit_output_ports;
151 Gtk::SpinButton* m_output_limit_count;
153 Gtk::RadioButton* m_connect_outputs_to_master;
154 Gtk::RadioButton* m_connect_outputs_to_physical;
155 Gtk::Button* m_okbutton;
157 Gtk::FileChooserButton* m_open_filechooser;
158 Gtk::TreeView* m_treeview;
159 Gtk::Notebook* m_notebook;
162 struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
163 RecentSessionModelColumns() {
167 Gtk::TreeModelColumn<std::string> visible_name;
168 Gtk::TreeModelColumn<std::string> fullpath;
171 RecentSessionModelColumns recent_columns;
172 Glib::RefPtr<Gtk::TreeStore> recent_model;
174 void recent_session_selection_changed ();
175 void nsd_redisplay_recent_sessions();
176 void nsd_recent_session_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
177 struct RecentSessionsSorter {
178 bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
179 return cmp_nocase(a.first, b.first) == -1;
182 bool entry_key_release (GdkEventKey*);
183 void notebook_page_changed (GtkNotebookPage*, uint);
184 void treeview_selection_changed ();
186 void template_chosen ();
187 void recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*);
188 void connect_inputs_clicked ();
189 void connect_outputs_clicked ();
190 void limit_inputs_clicked ();
191 void limit_outputs_clicked ();
192 void master_bus_button_clicked ();
193 void monitor_bus_button_clicked ();
195 bool on_new_session_page;
200 #endif // NEW_SESSION_DIALOG_H