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 #include "new_session_dialog.h"
23 #include "glade_path.h"
25 #include <gtkmm/entry.h>
26 #include <gtkmm/filechooserbutton.h>
27 #include <gtkmm/spinbutton.h>
28 #include <gtkmm/checkbutton.h>
29 #include <gtkmm/radiobutton.h>
31 const char* NewSessionDialogFactory::s_m_top_level_widget_name = X_("NewSessionDialog");
32 const char* NewSessionDialogFactory::top_level_widget_name() { return s_m_top_level_widget_name; }
34 Glib::RefPtr<Gnome::Glade::Xml>
35 NewSessionDialogFactory::create()
37 return GladeFactory::create(GladePath::path(X_("new_session_dialog.glade")));
41 NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
42 const Glib::RefPtr<Gnome::Glade::Xml>& xml)
43 : Gtk::Dialog(cobject)
45 // look up the widgets we care about.
47 xml->get_widget(X_("SessionNameEntry"), m_name);
48 xml->get_widget(X_("SessionFolderChooser"), m_folder);
49 xml->get_widget(X_("SessionTemplateChooser"), m_template);
51 xml->get_widget(X_("CreateMasterBus"), m_create_master_bus);
52 xml->get_widget(X_("MasterChannelCount"), m_master_bus_channel_count);
54 xml->get_widget(X_("CreateControlBus"), m_create_control_bus);
55 xml->get_widget(X_("ControlChannelCount"), m_control_bus_channel_count);
57 xml->get_widget(X_("ConnectInputs"), m_connect_inputs);
58 xml->get_widget(X_("LimitInputPorts"), m_limit_input_ports);
59 xml->get_widget(X_("InputLimitCount"), m_input_limit_count);
61 xml->get_widget(X_("ConnectOutputs"), m_connect_outputs);
62 xml->get_widget(X_("LimitOutputPorts"), m_limit_output_ports);
63 xml->get_widget(X_("OutputLimitCount"), m_output_limit_count);
64 xml->get_widget(X_("ConnectOutsToMaster"), m_connect_outputs_to_master);
65 xml->get_widget(X_("ConnectOutsToPhysical"), m_connect_outputs_to_physical);
67 ///@ todo connect some signals
72 NewSessionDialog::set_session_name(const Glib::ustring& name)
74 m_name->set_text(name);
78 NewSessionDialog::session_name() const
80 return Glib::filename_from_utf8(m_name->get_text());
84 NewSessionDialog::session_folder() const
86 return Glib::filename_from_utf8(m_folder->get_current_folder());
90 NewSessionDialog::use_session_template() const
92 if(m_template->get_filename().empty()) return false;
97 NewSessionDialog::session_template_name() const
99 return Glib::filename_from_utf8(m_template->get_filename());
103 NewSessionDialog::create_master_bus() const
105 return m_create_master_bus->get_active();
109 NewSessionDialog::master_channel_count() const
111 return m_master_bus_channel_count->get_value_as_int();
115 NewSessionDialog::create_control_bus() const
117 return m_create_control_bus->get_active();
121 NewSessionDialog::control_channel_count() const
123 return m_control_bus_channel_count->get_value_as_int();
127 NewSessionDialog::connect_inputs() const
129 return m_connect_inputs->get_active();
133 NewSessionDialog::limit_inputs_used_for_connection() const
135 return m_limit_input_ports->get_active();
139 NewSessionDialog::input_limit_count() const
141 return m_input_limit_count->get_value_as_int();
145 NewSessionDialog::connect_outputs() const
147 return m_connect_outputs->get_active();
151 NewSessionDialog::limit_outputs_used_for_connection() const
153 return m_limit_output_ports->get_active();
157 NewSessionDialog::output_limit_count() const
159 return m_output_limit_count->get_value_as_int();
163 NewSessionDialog::connect_outs_to_master() const
165 return m_connect_outputs_to_master->get_active();
169 NewSessionDialog::connect_outs_to_physical() const
171 return m_connect_outputs_to_physical->get_active();
176 NewSessionDialog::reset_name()
178 m_name->set_text(Glib::ustring());
184 NewSessionDialog::reset_template()
190 NewSessionDialog::reset()