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-28 23:41:15 -05:00
|
|
|
#include <gtkmm/entry.h>
|
|
|
|
#include <gtkmm/filechooserbutton.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
#include <gtkmm/checkbutton.h>
|
|
|
|
#include <gtkmm/radiobutton.h>
|
|
|
|
|
2005-11-28 00:04:14 -05:00
|
|
|
const char* NewSessionDialogFactory::s_m_top_level_widget_name = X_("NewSessionDialog");
|
2005-11-25 19:06:46 -05:00
|
|
|
const char* NewSessionDialogFactory::top_level_widget_name() { return s_m_top_level_widget_name; }
|
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-26 20:11:48 -05:00
|
|
|
xml->get_widget(X_("SessionNameEntry"), m_name);
|
|
|
|
xml->get_widget(X_("SessionFolderChooser"), m_folder);
|
|
|
|
xml->get_widget(X_("SessionTemplateChooser"), m_template);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-28 00:04:14 -05:00
|
|
|
xml->get_widget(X_("CreateMasterBus"), m_create_master_bus);
|
|
|
|
xml->get_widget(X_("MasterChannelCount"), m_master_bus_channel_count);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-28 00:04:14 -05:00
|
|
|
xml->get_widget(X_("CreateControlBus"), m_create_control_bus);
|
|
|
|
xml->get_widget(X_("ControlChannelCount"), m_control_bus_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
|
2005-11-28 00:04:14 -05:00
|
|
|
NewSessionDialog::create_master_bus() const
|
2005-11-14 03:38:16 -05:00
|
|
|
{
|
2005-11-28 00:04:14 -05:00
|
|
|
return m_create_master_bus->get_active();
|
2005-11-14 03:38:16 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
int
|
|
|
|
NewSessionDialog::master_channel_count() const
|
|
|
|
{
|
2005-11-28 00:04:14 -05:00
|
|
|
return m_master_bus_channel_count->get_value_as_int();
|
2005-11-14 03:38:16 -05:00
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2005-11-14 03:38:16 -05:00
|
|
|
bool
|
2005-11-28 00:04:14 -05:00
|
|
|
NewSessionDialog::create_control_bus() const
|
2005-11-14 03:38:16 -05:00
|
|
|
{
|
2005-11-28 00:04:14 -05:00
|
|
|
return m_create_control_bus->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-28 00:04:14 -05:00
|
|
|
return m_control_bus_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
|
|
|
}
|