2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2005-11-14 03:38:16 -05:00
|
|
|
Copyright (C) 2005 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
$Id$
|
|
|
|
*/
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
#include "i18n.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "new_session_dialog.h"
|
2005-11-14 03:38:16 -05:00
|
|
|
#include "glade_path.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
const char* NewSessionDialogFactory::s_m_top_level_widget_name = X_("new_session_dialog");
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
Glib::RefPtr<Gnome::Glade::Xml>
|
|
|
|
NewSessionDialogFactory::create()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
return GladeFactory::create(GladePath::path(X_("new_session_dialog.glade")));
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
NewSessionDialog::NewSessionDialog(BaseObjectType* cobject,
|
|
|
|
const Glib::RefPtr<Gnome::Glade::Xml>& xml)
|
|
|
|
: Gtk::Dialog(cobject)
|
|
|
|
{
|
|
|
|
// look up the widgets we care about.
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
xml->get_widget(X_("SessionName"), m_name);
|
|
|
|
xml->get_widget(X_("SessionFolder"), m_folder);
|
|
|
|
xml->get_widget(X_("SessionTemplate"), m_template);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
xml->get_widget(X_("CreateMasterTrack"), m_create_master_track);
|
|
|
|
xml->get_widget(X_("MasterChannelCount"), m_master_track_channel_count);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
xml->get_widget(X_("CreateControlTrack"), m_create_control_track);
|
|
|
|
xml->get_widget(X_("ControlChannelCount"), m_control_track_channel_count);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
xml->get_widget(X_("ConnectInputs"), m_connect_inputs);
|
|
|
|
xml->get_widget(X_("LimitInputPorts"), m_limit_input_ports);
|
|
|
|
xml->get_widget(X_("InputLimitCount"), m_input_limit_count);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
xml->get_widget(X_("ConnectOutputs"), m_connect_outputs);
|
|
|
|
xml->get_widget(X_("LimitOutputPorts"), m_limit_output_ports);
|
|
|
|
xml->get_widget(X_("OutputLimitCount"), m_output_limit_count);
|
|
|
|
xml->get_widget(X_("ConnectOutsToMaster"), m_connect_outputs_to_master);
|
|
|
|
xml->get_widget(X_("ConnectOutsToPhysical"), m_connect_outputs_to_physical);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
///@ todo connect some signals
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
void
|
|
|
|
NewSessionDialog::set_session_name(const Glib::ustring& name)
|
|
|
|
{
|
|
|
|
m_name->set_text(name);
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
std::string
|
|
|
|
NewSessionDialog::session_name() const
|
|
|
|
{
|
|
|
|
return Glib::filename_from_utf8(m_name->get_text());
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
std::string
|
|
|
|
NewSessionDialog::session_folder() const
|
|
|
|
{
|
|
|
|
return Glib::filename_from_utf8(m_folder->get_current_folder());
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::use_session_template() const
|
|
|
|
{
|
|
|
|
if(m_template->get_filename().empty()) return false;
|
|
|
|
return true;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
std::string
|
|
|
|
NewSessionDialog::session_template_name() const
|
|
|
|
{
|
|
|
|
return Glib::filename_from_utf8(m_template->get_filename());
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::create_master_track() const
|
|
|
|
{
|
|
|
|
return m_create_master_track->get_active();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
int
|
|
|
|
NewSessionDialog::master_channel_count() const
|
|
|
|
{
|
|
|
|
return m_master_track_channel_count->get_value_as_int();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::create_control_track() const
|
|
|
|
{
|
|
|
|
return m_create_control_track->get_active();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
int
|
|
|
|
NewSessionDialog::control_channel_count() const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
return m_control_track_channel_count->get_value_as_int();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::connect_inputs() const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
return m_connect_inputs->get_active();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::limit_inputs_used_for_connection() const
|
|
|
|
{
|
|
|
|
return m_limit_input_ports->get_active();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
int
|
|
|
|
NewSessionDialog::input_limit_count() const
|
|
|
|
{
|
|
|
|
return m_input_limit_count->get_value_as_int();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::connect_outputs() const
|
|
|
|
{
|
|
|
|
return m_connect_outputs->get_active();
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::limit_outputs_used_for_connection() const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
return m_limit_output_ports->get_active();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
int
|
|
|
|
NewSessionDialog::output_limit_count() const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
return m_output_limit_count->get_value_as_int();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::connect_outs_to_master() const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
return m_connect_outputs_to_master->get_active();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
|
|
|
NewSessionDialog::connect_outs_to_physical() const
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
return m_connect_outputs_to_physical->get_active();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2005-11-14 03:38:16 -05:00
|
|
|
NewSessionDialog::reset_name()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
m_name->set_text(Glib::ustring());
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
/// @todo
|
2005-09-25 14:42:24 -04:00
|
|
|
void
|
2005-11-14 03:38:16 -05:00
|
|
|
NewSessionDialog::reset_template()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
void
|
|
|
|
NewSessionDialog::reset()
|
2005-09-25 14:42:24 -04:00
|
|
|
{
|
2005-11-14 03:38:16 -05:00
|
|
|
reset_name();
|
|
|
|
reset_template();
|
2005-09-25 14:42:24 -04:00
|
|
|
}
|