char buf[64];
snprintf (buf, sizeof (buf), "%d:%d:%d", color.get_red(), color.get_green(), color.get_blue());
gui_state.set (group_gui_id (group), "color", buf);
+
+ /* This is a bit of a hack, but this might change
+ our route's effective color, so emit gui_changed
+ for our routes.
+ */
+
+ for (RouteList::iterator i = group->route_list()->begin(); i != group->route_list()->end(); ++i) {
+ (*i)->gui_changed (X_("color"), 0);
+ }
}
/** @return the ID string to use for the GUI state of a route group */
revert_to_default_display ();
- if (set_color_from_route()) {
- set_color (unique_random_color());
- }
-
if (route()->is_master()) {
solo_button->hide ();
below_panner_box.hide ();
, _select (_("Selection"))
, _edit (_("Editing"))
, _route_active (_("Route active state"))
+ , _share_color (_("Color"))
{
set_modal (true);
set_skip_taskbar_hint (true);
_name.set_text (_group->name ());
_active.set_active (_group->is_active ());
+ _color.set_color (GroupTabs::group_color (_group));
VBox* options_box = manage (new VBox);
options_box->set_spacing (6);
_select.set_active (_group->is_select());
_edit.set_active (_group->is_edit());
_route_active.set_active (_group->is_route_active());
- _color.set_color (GroupTabs::group_color (_group));
+ _share_color.set_active (_group->is_color());
_name.signal_changed().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
+ _color.signal_color_set().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_gain.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_relative.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_mute.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_select.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_edit.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
_route_active.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
- _color.signal_color_set().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
-
+ _share_color.signal_toggled().connect (sigc::mem_fun (*this, &RouteGroupDialog::update));
+
gain_toggled ();
Table* table = manage (new Table (11, 4, false));
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);
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);
options_box->pack_start (*table, false, true);
main_vbox->pack_start (*options_box, false, true);
plist.add (Properties::relative, _relative.get_active());
plist.add (Properties::active, _active.get_active());
plist.add (Properties::name, string (_name.get_text()));
+ plist.add (Properties::color, _share_color.get_active());
- GroupTabs::set_group_color (_group, _color.get_color ());
-
_group->apply_changes (plist);
+
+ GroupTabs::set_group_color (_group, _color.get_color ());
}
void
Gtk::CheckButton _select;
Gtk::CheckButton _edit;
Gtk::CheckButton _route_active;
+ Gtk::CheckButton _share_color;
Gtk::Button* _ok;
Gtk::ColorButton _color;
RouteTimeAxisView::route_color_changed ()
{
if (_view) {
- _view->apply_color (_color, StreamView::RegionColor);
+ _view->apply_color (color(), StreamView::RegionColor);
}
}
{
return string_compose ("rtav %1", _route->id().to_s());
}
+
#include "mixer_strip.h"
#include "automation_time_axis.h"
#include "route_time_axis.h"
+#include "group_tabs.h"
#include "ardour/route.h"
#include "ardour/event_type_map.h"
}
}
}
+
+/** @return the color that this route should use; it maybe its own,
+ or it maybe that of its route group.
+*/
+Gdk::Color
+RouteUI::color () const
+{
+ RouteGroup* g = _route->route_group ();
+
+ if (g && g->is_color()) {
+ return GroupTabs::group_color (g);
+ }
+
+ return _color;
+}
virtual ~RouteUI();
+ Gdk::Color color () const;
+
virtual void set_route (boost::shared_ptr<ARDOUR::Route>);
virtual void set_button_names () = 0;
}
void
-StreamView::apply_color (Gdk::Color& color, ColorTarget target)
+StreamView::apply_color (Gdk::Color color, ColorTarget target)
{
list<RegionView *>::iterator i;
};
Gdk::Color get_region_color () const { return region_color; }
- void apply_color (Gdk::Color&, ColorTarget t);
+ void apply_color (Gdk::Color, ColorTarget t);
uint32_t num_selected_regionviews () const;
extern PBD::PropertyDescriptor<bool> select;
extern PBD::PropertyDescriptor<bool> edit;
extern PBD::PropertyDescriptor<bool> route_active;
+ extern PBD::PropertyDescriptor<bool> color;
/* we use this, but its declared in region.cc */
extern PBD::PropertyDescriptor<bool> hidden;
};
bool is_select () const { return _select.val(); }
bool is_edit () const { return _edit.val(); }
bool is_route_active () const { return _route_active.val(); }
+ bool is_color () const { return _color.val(); }
bool empty() const {return routes->empty();}
size_t size() const { return routes->size();}
void set_select (bool yn);
void set_edit (bool yn);
void set_route_active (bool yn);
+ void set_color (bool yn);
bool enabled_property (PBD::PropertyID);
PBD::Property<bool> _select;
PBD::Property<bool> _edit;
PBD::Property<bool> _route_active;
+ PBD::Property<bool> _color;
void remove_when_going_away (boost::weak_ptr<Route>);
int set_state_2X (const XMLNode&, int);
PropertyDescriptor<bool> select;
PropertyDescriptor<bool> edit;
PropertyDescriptor<bool> route_active;
+ PropertyDescriptor<bool> color;
}
}
DEBUG_TRACE (DEBUG::Properties, string_compose ("quark for edit = %1\n", Properties::edit.property_id));
Properties::route_active.property_id = g_quark_from_static_string (X_("route-active"));
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));
}
#define ROUTE_GROUP_DEFAULT_PROPERTIES _relative (Properties::relative, false) \
, _recenable (Properties::recenable, false) \
, _select (Properties::select, false) \
, _edit (Properties::edit, false) \
- , _route_active (Properties::route_active, false)
+ , _route_active (Properties::route_active, false) \
+ , _color (Properties::color, false)
RouteGroup::RouteGroup (Session& s, const string &n)
: SessionObject (s, n)
add_property (_select);
add_property (_edit);
add_property (_route_active);
+ add_property (_color);
}
RouteGroup::~RouteGroup ()
_recenable = true;
_edit = false;
_route_active = true;
+ _color = false;
} else if (node.name() == "EditGroup") {
_gain = false;
_mute = false;
_recenable = false;
_edit = true;
_route_active = false;
+ _color = false;
}
return 0;
_route_active = yn;
}
+void
+RouteGroup::set_color (bool yn)
+{
+ if (is_color() == yn) {
+ return;
+ }
+ _color = yn;
+
+ /* This is a bit of a hack, but this might change
+ our route's effective color, so emit gui_changed
+ for our routes.
+ */
+
+ for (RouteList::iterator i = routes->begin(); i != routes->end(); ++i) {
+ (*i)->gui_changed (X_("color"), this);
+ }
+}
+
void
RouteGroup::set_active (bool yn, void* /*src*/)
{
}
}
- PropertyChanged (Properties::hidden); /* EMIT SIGNAL */
+ send_change (Properties::hidden);
_session.set_dirty ();
}