add route group support for monitoring choices

git-svn-id: svn://localhost/ardour2/branches/3.0@10268 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis
2011-10-21 15:47:50 +00:00
parent ecbd2ebb74
commit bfe9010959
5 changed files with 37 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
, _edit (_("Editing"))
, _route_active (_("Route active state"))
, _share_color (_("Color"))
, _share_monitoring (_("Monitoring"))
{
set_modal (true);
set_skip_taskbar_hint (true);
@@ -105,6 +106,7 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
_edit.set_active (_group->is_edit());
_route_active.set_active (_group->is_route_active());
_share_color.set_active (_group->is_color());
_share_monitoring.set_active (_group->is_monitoring());
_name.signal_changed().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
@@ -118,10 +120,11 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
_edit.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_route_active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_share_color.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_share_monitoring.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
gain_toggled ();
Table* table = manage (new Table (11, 4, false));
Table* table = manage (new Table (12, 4, false));
table->set_row_spacings (6);
l = manage (new Label ("", Gtk::ALIGN_LEFT, Gtk::ALIGN_CENTER, false));
@@ -142,6 +145,7 @@ RouteGroupDialog::RouteGroupDialog (RouteGroup* g, bool creating_new)
table->attach (_edit, 1, 3, 7, 8, Gtk::FILL, Gtk::FILL, 0, 0);
table->attach (_route_active, 1, 3, 8, 9, Gtk::FILL, Gtk::FILL, 0, 0);
table->attach (_share_color, 1, 3, 9, 10, Gtk::FILL, Gtk::FILL, 0, 0);
table->attach (_share_monitoring, 1, 3, 10, 11, Gtk::FILL, Gtk::FILL, 0, 0);
options_box->pack_start (*table, false, true);
main_vbox->pack_start (*options_box, false, true);
@@ -210,6 +214,7 @@ RouteGroupDialog::update ()
plist.add (Properties::active, _active.get_active());
plist.add (Properties::name, string (_name.get_text()));
plist.add (Properties::color, _share_color.get_active());
plist.add (Properties::monitoring, _share_monitoring.get_active());
_group->apply_changes (plist);

View File

@@ -49,6 +49,7 @@ private:
Gtk::CheckButton _edit;
Gtk::CheckButton _route_active;
Gtk::CheckButton _share_color;
Gtk::CheckButton _share_monitoring;
Gtk::Button* _ok;
Gtk::ColorButton _color;

View File

@@ -683,6 +683,13 @@ RouteUI::monitor_release (GdkEventButton* ev, MonitorChoice monitor_choice)
if (Keyboard::modifier_state_equals (ev->state, Keyboard::ModifierMask (Keyboard::PrimaryModifier|Keyboard::TertiaryModifier))) {
rl = _session->get_routes ();
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier)) {
if (_route->route_group() && _route->route_group()->is_monitoring()) {
rl = _route->route_group()->route_list();
} else {
rl.reset (new RouteList);
rl->push_back (route());
}
} else {
rl.reset (new RouteList);
rl->push_back (route());

View File

@@ -45,6 +45,7 @@ namespace Properties {
extern PBD::PropertyDescriptor<bool> edit;
extern PBD::PropertyDescriptor<bool> route_active;
extern PBD::PropertyDescriptor<bool> color;
extern PBD::PropertyDescriptor<bool> monitoring;
/* we use this, but its declared in region.cc */
extern PBD::PropertyDescriptor<bool> hidden;
};
@@ -73,6 +74,7 @@ class RouteGroup : public SessionObject
bool is_edit () const { return _edit.val(); }
bool is_route_active () const { return _route_active.val(); }
bool is_color () const { return _color.val(); }
bool is_monitoring() const { return _monitoring.val(); }
bool empty() const {return routes->empty();}
size_t size() const { return routes->size();}
@@ -92,6 +94,7 @@ class RouteGroup : public SessionObject
void set_edit (bool yn);
void set_route_active (bool yn);
void set_color (bool yn);
void set_monitoring (bool yn);
bool enabled_property (PBD::PropertyID);
@@ -147,6 +150,7 @@ private:
PBD::Property<bool> _edit;
PBD::Property<bool> _route_active;
PBD::Property<bool> _color;
PBD::Property<bool> _monitoring;
void remove_when_going_away (boost::weak_ptr<Route>);
int set_state_2X (const XMLNode&, int);

View File

@@ -52,6 +52,7 @@ namespace ARDOUR {
PropertyDescriptor<bool> edit;
PropertyDescriptor<bool> route_active;
PropertyDescriptor<bool> color;
PropertyDescriptor<bool> monitoring;
}
}
@@ -80,6 +81,8 @@ RouteGroup::make_property_quarks ()
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for route-active = %1\n", Properties::route_active.property_id));
Properties::color.property_id = g_quark_from_static_string (X_("color"));
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for color = %1\n", Properties::color.property_id));
Properties::monitoring.property_id = g_quark_from_static_string (X_("monitoring"));
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for monitoring = %1\n", Properties::monitoring.property_id));
}
#define ROUTE_GROUP_DEFAULT_PROPERTIES _relative (Properties::relative, false) \
@@ -92,7 +95,8 @@ RouteGroup::make_property_quarks ()
, _select (Properties::select, false) \
, _edit (Properties::edit, false) \
, _route_active (Properties::route_active, false) \
, _color (Properties::color, false)
, _color (Properties::color, false) \
, _monitoring (Properties::monitoring, false)
RouteGroup::RouteGroup (Session& s, const string &n)
: SessionObject (s, n)
@@ -112,6 +116,7 @@ RouteGroup::RouteGroup (Session& s, const string &n)
add_property (_edit);
add_property (_route_active);
add_property (_color);
add_property (_monitoring);
}
RouteGroup::~RouteGroup ()
@@ -379,6 +384,19 @@ RouteGroup::set_color (bool yn)
}
}
void
RouteGroup::set_monitoring (bool yn)
{
if (is_monitoring() == yn) {
return;
}
_monitoring = yn;
send_change (PropertyChange (Properties::monitoring));
_session.set_dirty ();
}
void
RouteGroup::set_active (bool yn, void* /*src*/)
{