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();
100 void reset_template();
102 // reset everything to default values.
105 // references to widgets we care about.
106 Gtk::Dialog* m_new_session_dialog;
108 Gtk::FileChooserButton* m_folder;
109 Gtk::FileChooserButton* m_template;
111 Gtk::CheckButton* m_create_master_bus;
112 Gtk::SpinButton* m_master_bus_channel_count;
114 Gtk::CheckButton* m_create_control_bus;
115 Gtk::SpinButton* m_control_bus_channel_count;
117 Gtk::CheckButton* m_connect_inputs;
118 Gtk::CheckButton* m_limit_input_ports;
119 Gtk::SpinButton* m_input_limit_count;
121 Gtk::CheckButton* m_connect_outputs;
122 Gtk::CheckButton* m_limit_output_ports;
123 Gtk::SpinButton* m_output_limit_count;
125 Gtk::RadioButton* m_connect_outputs_to_master;
126 Gtk::RadioButton* m_connect_outputs_to_physical;
127 Gtk::Button* m_okbutton;
129 Gtk::FileChooserButton* m_open_filechooser;
130 Gtk::TreeView* m_treeview;
131 Gtk::Notebook* m_notebook;
132 Gtk::ScrolledWindow* m_scrolledwindow;
134 struct RecentSessionModelColumns : public Gtk::TreeModel::ColumnRecord {
135 RecentSessionModelColumns() {
139 Gtk::TreeModelColumn<std::string> visible_name;
140 Gtk::TreeModelColumn<std::string> fullpath;
143 RecentSessionModelColumns recent_columns;
144 Glib::RefPtr<Gtk::TreeStore> recent_model;
146 void recent_session_selection_changed ();
147 void nsd_redisplay_recent_sessions();
148 void nsd_recent_session_row_activated (const Gtk::TreePath& path, Gtk::TreeViewColumn* col);
149 struct RecentSessionsSorter {
150 bool operator() (std::pair<std::string,std::string> a, std::pair<std::string,std::string> b) const {
151 return cmp_nocase(a.first, b.first) == -1;
154 bool entry_key_release (GdkEventKey*);
155 void notebook_page_changed (GtkNotebookPage*, uint);
156 void treeview_selection_changed ();
158 void recent_row_activated (const Gtk::TreePath&, Gtk::TreeViewColumn*);
163 #endif // NEW_SESSION_DIALOG_H