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/dialog.h>
28 #include <gtkmm/treeview.h>
29 #include <gtkmm/treestore.h>
30 #include <gtkmm/treepath.h>
31 #include <gtkmm/scrolledwindow.h>
32 #include <gtkmm/notebook.h>
34 #include <ardour/utils.h>
36 #include <glibmm/refptr.h>
40 class FileChooserButton;
48 #include "glade_factory.h"
50 struct NewSessionDialogFactory : public GladeFactory
52 static GladeRef create();
54 static const char* top_level_widget_name();
58 static const char* s_m_top_level_widget_name;
62 class NewSessionDialog : public Gtk::Dialog
66 NewSessionDialog(BaseObjectType* cobject,
67 const Glib::RefPtr<Gnome::Glade::Xml>& xml);
69 void set_session_name(const Glib::ustring& name);
71 std::string session_name() const;
72 std::string session_folder() const;
74 bool use_session_template() const;
75 std::string session_template_name() const;
79 bool create_master_bus() const;
80 int master_channel_count() const;
82 bool create_control_bus() const;
83 int control_channel_count() const;
85 bool connect_inputs() const;
86 bool limit_inputs_used_for_connection() const;
87 int input_limit_count() const;
89 bool connect_outputs() const;
90 bool limit_outputs_used_for_connection() const;
91 int output_limit_count() const;
93 bool connect_outs_to_master() const;
94 bool connect_outs_to_physical() const ;
95 int get_current_page();
98 // reset everything to default values.
104 void reset_template();
106 // references to widgets we care about.
107 Gtk::Dialog* m_new_session_dialog;
109 Gtk::FileChooserButton* m_folder;
110 Gtk::FileChooserButton* m_template;
112 Gtk::CheckButton* m_create_master_bus;
113 Gtk::SpinButton* m_master_bus_channel_count;
115 Gtk::CheckButton* m_create_control_bus;
116 Gtk::SpinButton* m_control_bus_channel_count;
118 Gtk::CheckButton* m_connect_inputs;
119 Gtk::CheckButton* m_limit_input_ports;
120 Gtk::SpinButton* m_input_limit_count;
122 Gtk::CheckButton* m_connect_outputs;
123 Gtk::CheckButton* m_limit_output_ports;
124 Gtk::SpinButton* m_output_limit_count;
126 Gtk::RadioButton* m_connect_outputs_to_master;
127 Gtk::RadioButton* m_connect_outputs_to_physical;
128 Gtk::Button* m_okbutton;
130 Gtk::FileChooserButton* m_open_filechooser;
131 Gtk::TreeView* m_treeview;
132 Gtk::Notebook* m_notebook;
133 Gtk::ScrolledWindow* m_scrolledwindow;
135 struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
136 RecentSessionModelColumns() {
140 Gtk::TreeModelColumn<std::string> visible_name;
141 Gtk::TreeModelColumn<std::string> fullpath;
144 RecentSessionModelColumns recent_columns;
145 Glib::RefPtr<Gtk::TreeStore> recent_model;
147 void recent_session_selection_changed ();
148 void nsd_redisplay_recent_sessions();
149 void nsd_recent_session_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
150 struct RecentSessionsSorter {
151 bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
152 return cmp_nocase(a.first, b.first) == -1;
155 bool entry_key_release (GdkEventKey*);
156 void notebook_page_changed (GtkNotebookPage*, uint);
157 void treeview_selection_changed ();
159 void recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*);
164 #endif // NEW_SESSION_DIALOG_H