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 const char* NewSessionDialogFactory::s_m_top_level_widget_name = X_("new_session_dialog");
28 Glib::RefPtr<Gnome::Glade::Xml>
29 NewSessionDialogFactory::create()
31 return GladeFactory::create(GladePath::path(X_("new_session_dialog.glade")));
35 NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
36 const Glib::RefPtr<Gnome::Glade::Xml>& xml)
37 : Gtk::Dialog(cobject)
39 // look up the widgets we care about.
41 xml->get_widget(X_("SessionName"), m_name);
42 xml->get_widget(X_("SessionFolder"), m_folder);
43 xml->get_widget(X_("SessionTemplate"), m_template);
45 xml->get_widget(X_("CreateMasterTrack"), m_create_master_track);
46 xml->get_widget(X_("MasterChannelCount"), m_master_track_channel_count);
48 xml->get_widget(X_("CreateControlTrack"), m_create_control_track);
49 xml->get_widget(X_("ControlChannelCount"), m_control_track_channel_count);
51 xml->get_widget(X_("ConnectInputs"), m_connect_inputs);
52 xml->get_widget(X_("LimitInputPorts"), m_limit_input_ports);
53 xml->get_widget(X_("InputLimitCount"), m_input_limit_count);
55 xml->get_widget(X_("ConnectOutputs"), m_connect_outputs);
56 xml->get_widget(X_("LimitOutputPorts"), m_limit_output_ports);
57 xml->get_widget(X_("OutputLimitCount"), m_output_limit_count);
58 xml->get_widget(X_("ConnectOutsToMaster"), m_connect_outputs_to_master);
59 xml->get_widget(X_("ConnectOutsToPhysical"), m_connect_outputs_to_physical);
61 ///@ todo connect some signals
66 NewSessionDialog::set_session_name(const Glib::ustring& name)
68 m_name->set_text(name);
72 NewSessionDialog::session_name() const
74 return Glib::filename_from_utf8(m_name->get_text());
78 NewSessionDialog::session_folder() const
80 return Glib::filename_from_utf8(m_folder->get_current_folder());
84 NewSessionDialog::use_session_template() const
86 if(m_template->get_filename().empty()) return false;
91 NewSessionDialog::session_template_name() const
93 return Glib::filename_from_utf8(m_template->get_filename());
97 NewSessionDialog::create_master_track() const
99 return m_create_master_track->get_active();
103 NewSessionDialog::master_channel_count() const
105 return m_master_track_channel_count->get_value_as_int();
109 NewSessionDialog::create_control_track() const
111 return m_create_control_track->get_active();
115 NewSessionDialog::control_channel_count() const
117 return m_control_track_channel_count->get_value_as_int();
121 NewSessionDialog::connect_inputs() const
123 return m_connect_inputs->get_active();
127 NewSessionDialog::limit_inputs_used_for_connection() const
129 return m_limit_input_ports->get_active();
133 NewSessionDialog::input_limit_count() const
135 return m_input_limit_count->get_value_as_int();
139 NewSessionDialog::connect_outputs() const
141 return m_connect_outputs->get_active();
145 NewSessionDialog::limit_outputs_used_for_connection() const
147 return m_limit_output_ports->get_active();
151 NewSessionDialog::output_limit_count() const
153 return m_output_limit_count->get_value_as_int();
157 NewSessionDialog::connect_outs_to_master() const
159 return m_connect_outputs_to_master->get_active();
163 NewSessionDialog::connect_outs_to_physical() const
165 return m_connect_outputs_to_physical->get_active();
170 NewSessionDialog::reset_name()
172 m_name->set_text(Glib::ustring());
178 NewSessionDialog::reset_template()
184 NewSessionDialog::reset()