2009-06-28 21:07:37 -04:00
|
|
|
/*
|
2009-10-14 12:10:01 -04:00
|
|
|
Copyright (C) 2009 Paul Davis
|
2009-06-28 21:07:37 -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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <gtkmm/table.h>
|
2009-06-20 11:40:26 -04:00
|
|
|
#include <gtkmm/stock.h>
|
|
|
|
#include "ardour/route_group.h"
|
|
|
|
#include "route_group_dialog.h"
|
|
|
|
#include "i18n.h"
|
2009-06-28 20:57:27 -04:00
|
|
|
#include <iostream>
|
2009-06-20 11:40:26 -04:00
|
|
|
|
|
|
|
using namespace Gtk;
|
|
|
|
using namespace ARDOUR;
|
2009-06-28 20:57:27 -04:00
|
|
|
using namespace std;
|
2010-02-18 08:59:49 -05:00
|
|
|
using namespace PBD;
|
2009-06-20 11:40:26 -04:00
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
RouteGroupDialog::RouteGroupDialog (RouteGroup* g, StockID const & s)
|
2009-06-28 21:07:37 -04:00
|
|
|
: ArdourDialog (_("route group dialog")),
|
2009-06-20 11:40:26 -04:00
|
|
|
_group (g),
|
2009-06-21 15:59:56 -04:00
|
|
|
_active (_("Active")),
|
|
|
|
_gain (_("Gain")),
|
2009-06-23 17:29:39 -04:00
|
|
|
_relative (_("Relative")),
|
2009-06-21 15:59:56 -04:00
|
|
|
_mute (_("Muting")),
|
|
|
|
_solo (_("Soloing")),
|
|
|
|
_rec_enable (_("Record enable")),
|
|
|
|
_select (_("Selection")),
|
|
|
|
_edit (_("Editing"))
|
2009-06-20 11:40:26 -04:00
|
|
|
{
|
2009-06-28 21:07:37 -04:00
|
|
|
set_modal (true);
|
|
|
|
set_skip_taskbar_hint (true);
|
|
|
|
set_resizable (false);
|
|
|
|
set_position (Gtk::WIN_POS_MOUSE);
|
|
|
|
set_name (N_("RouteGroupDialog"));
|
|
|
|
|
2009-10-19 13:25:37 -04:00
|
|
|
set_title (_("Route Group"));
|
2009-06-28 21:07:37 -04:00
|
|
|
|
|
|
|
VBox* vbox = manage (new VBox);
|
|
|
|
Gtk::Label* l;
|
|
|
|
|
|
|
|
get_vbox()->set_spacing (4);
|
|
|
|
|
|
|
|
vbox->set_spacing (18);
|
|
|
|
vbox->set_border_width (5);
|
|
|
|
|
|
|
|
HBox* hbox = manage (new HBox);
|
|
|
|
hbox->set_spacing (6);
|
|
|
|
l = manage (new Label (_("Name:"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false ));
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
hbox->pack_start (*l, false, true);
|
|
|
|
hbox->pack_start (_name, true, true);
|
|
|
|
|
|
|
|
vbox->pack_start (*hbox, false, true);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
VBox* options_box = manage (new VBox);
|
|
|
|
options_box->set_spacing (6);
|
|
|
|
|
|
|
|
l = manage (new Label (_("<b>Sharing</b>"), Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false ));
|
|
|
|
l->set_use_markup ();
|
|
|
|
options_box->pack_start (*l, false, true);
|
|
|
|
|
2009-06-20 11:40:26 -04:00
|
|
|
_name.set_text (_group->name ());
|
|
|
|
_active.set_active (_group->is_active ());
|
2009-06-21 15:59:56 -04:00
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
_name.signal_activate ().connect (sigc::bind (sigc::mem_fun (*this, &Dialog::response), RESPONSE_OK));
|
2009-11-20 10:26:34 -05:00
|
|
|
|
2010-02-18 08:59:49 -05:00
|
|
|
_gain.set_active (_group->is_gain());
|
2009-06-23 17:29:39 -04:00
|
|
|
_relative.set_active (_group->is_relative());
|
2010-02-18 08:59:49 -05:00
|
|
|
_mute.set_active (_group->is_mute());
|
|
|
|
_solo.set_active (_group->is_solo());
|
|
|
|
_rec_enable.set_active (_group->is_recenable());
|
|
|
|
_select.set_active (_group->is_select());
|
|
|
|
_edit.set_active (_group->is_edit());
|
2009-06-28 21:07:37 -04:00
|
|
|
|
|
|
|
gain_toggled ();
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
Table* table = manage (new Table (8, 3, false));
|
|
|
|
table->set_row_spacings (6);
|
|
|
|
|
|
|
|
l = manage (new Label ("", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
|
|
|
|
l->set_padding (8, 0);
|
|
|
|
table->attach (*l, 0, 1, 0, 8, Gtk::FILL, Gtk::FILL, 0, 0);
|
|
|
|
|
|
|
|
table->attach (_active, 1, 3, 0, 1, Gtk::FILL, Gtk::FILL, 0, 0);
|
|
|
|
table->attach (_gain, 1, 3, 1, 2, Gtk::FILL, Gtk::FILL, 0, 0);
|
2009-06-20 11:40:26 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
l = manage (new Label ("", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
|
|
|
|
l->set_padding (0, 0);
|
|
|
|
table->attach (*l, 1, 2, 2, 3, Gtk::FILL, Gtk::FILL, 0, 0);
|
|
|
|
table->attach (_relative, 2, 3, 2, 3, Gtk::FILL, Gtk::FILL, 0, 0);
|
2009-06-23 17:29:39 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
table->attach (_mute, 1, 3, 3, 4, Gtk::FILL, Gtk::FILL, 0, 0);
|
|
|
|
table->attach (_solo, 1, 3, 4, 5, Gtk::FILL, Gtk::FILL, 0, 0);
|
|
|
|
table->attach (_rec_enable, 1, 3, 5, 6, Gtk::FILL, Gtk::FILL, 0, 0);
|
|
|
|
table->attach (_select, 1, 3, 6, 7, Gtk::FILL, Gtk::FILL, 0, 0);
|
|
|
|
table->attach (_edit, 1, 3, 7, 8, Gtk::FILL, Gtk::FILL, 0, 0);
|
2009-06-23 17:29:39 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
options_box->pack_start (*table, false, true);
|
|
|
|
vbox->pack_start (*options_box, false, true);
|
2009-06-21 15:59:56 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
get_vbox()->pack_start (*vbox, false, false);
|
|
|
|
|
2009-12-11 18:29:48 -05:00
|
|
|
_gain.signal_toggled().connect(sigc::mem_fun (*this, &RouteGroupDialog::gain_toggled));
|
2009-06-20 11:40:26 -04:00
|
|
|
|
|
|
|
add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
2009-06-21 15:59:56 -04:00
|
|
|
add_button (s, RESPONSE_OK);
|
2009-12-01 10:32:42 -05:00
|
|
|
set_default_response (RESPONSE_OK);
|
2009-06-20 11:40:26 -04:00
|
|
|
|
2009-06-28 21:07:37 -04:00
|
|
|
show_all_children ();
|
2009-06-20 11:40:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
RouteGroupDialog::do_run ()
|
|
|
|
{
|
|
|
|
int const r = run ();
|
|
|
|
|
2009-11-20 10:26:34 -05:00
|
|
|
if (r == Gtk::RESPONSE_OK || r == Gtk::RESPONSE_ACCEPT) {
|
2010-02-18 08:59:49 -05:00
|
|
|
|
|
|
|
PropertyList plist;
|
|
|
|
|
|
|
|
plist.add (Properties::gain, _gain.get_active());
|
|
|
|
plist.add (Properties::recenable, _rec_enable.get_active());
|
|
|
|
plist.add (Properties::mute, _mute.get_active());
|
|
|
|
plist.add (Properties::solo, _solo.get_active ());
|
|
|
|
plist.add (Properties::select, _select.get_active());
|
|
|
|
plist.add (Properties::edit, _edit.get_active());
|
|
|
|
plist.add (Properties::relative, _relative.get_active());
|
|
|
|
plist.add (Properties::active, _active.get_active());
|
|
|
|
plist.add (Properties::name, string (_name.get_text()));
|
2010-04-01 20:21:08 -04:00
|
|
|
|
2010-02-18 08:59:49 -05:00
|
|
|
_group->set_properties (plist);
|
2009-06-20 11:40:26 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
2009-06-28 21:07:37 -04:00
|
|
|
|
|
|
|
void
|
|
|
|
RouteGroupDialog::gain_toggled ()
|
|
|
|
{
|
|
|
|
_relative.set_sensitive (_gain.get_active ());
|
|
|
|
}
|
|
|
|
|