summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/axis_view.h8
-rw-r--r--gtk2_ardour/mixer_strip.cc18
-rw-r--r--gtk2_ardour/mixer_strip.h3
-rw-r--r--gtk2_ardour/route_time_axis.cc4
-rw-r--r--gtk2_ardour/route_time_axis.h4
-rw-r--r--gtk2_ardour/route_ui.cc31
-rw-r--r--gtk2_ardour/route_ui.h5
7 files changed, 42 insertions, 31 deletions
diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h
index e4f4193852..bb29c564c1 100644
--- a/gtk2_ardour/axis_view.h
+++ b/gtk2_ardour/axis_view.h
@@ -45,12 +45,8 @@ namespace ARDOUR {
class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
{
public:
- /**
- * Returns the current 'Track' Color
- *
- * @return the current Track Color
- */
- Gdk::Color color() const { return _color; }
+ /** @return the track's own color */
+ Gdk::Color color () const { return _color; }
ARDOUR::Session* session() const { return _session; }
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index dc0872ce87..9f2f20b22a 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -469,7 +469,6 @@ MixerStrip::set_route (boost::shared_ptr<Route> rt)
}
_route->comment_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::comment_changed, this, _1), gui_context());
- _route->gui_changed.connect (route_connections, invalidator (*this), ui_bind (&MixerStrip::route_gui_changed, this, _1, _2), gui_context());
set_stuff_from_route ();
@@ -918,7 +917,7 @@ MixerStrip::update_diskstream_display ()
input_selector->hide_all ();
}
- show_route_color ();
+ route_color_changed ();
} else {
@@ -1317,21 +1316,8 @@ MixerStrip::route_group_changed ()
}
}
-
-void
-MixerStrip::route_gui_changed (string what_changed, void*)
-{
- ENSURE_GUI_THREAD (*this, &MixerStrip::route_gui_changed, what_changed, ignored)
-
- if (what_changed == "color") {
- if (set_color_from_route () == 0) {
- show_route_color ();
- }
- }
-}
-
void
-MixerStrip::show_route_color ()
+MixerStrip::route_color_changed ()
{
name_button.modify_bg (STATE_NORMAL, color());
top_event_box.modify_bg (STATE_NORMAL, color());
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index 4ef0c2f223..14a2853123 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -264,8 +264,7 @@ class MixerStrip : public RouteUI, public Gtk::EventBox
Gtk::Style *passthru_style;
- void route_gui_changed (std::string, void*);
- void show_route_color ();
+ void route_color_changed ();
void show_passthru_color ();
void name_changed ();
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 66cd38659d..6cf06a048d 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -911,10 +911,8 @@ RouteTimeAxisView::set_height (uint32_t h)
}
void
-RouteTimeAxisView::set_color (Gdk::Color const & c)
+RouteTimeAxisView::route_color_changed ()
{
- RouteUI::set_color (c);
-
if (_view) {
_view->apply_color (_color, StreamView::RegionColor);
}
diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h
index 5952ddfb31..6ace603538 100644
--- a/gtk2_ardour/route_time_axis.h
+++ b/gtk2_ardour/route_time_axis.h
@@ -212,8 +212,6 @@ protected:
void reset_samples_per_unit ();
void horizontal_position_changed ();
- void set_color (Gdk::Color const &);
-
virtual void build_automation_action_menu (bool);
virtual void append_extra_display_menu_items () {}
void build_display_menu ();
@@ -246,6 +244,8 @@ protected:
void setup_processor_menu_and_curves ();
+ void route_color_changed ();
+
boost::shared_ptr<AutomationTimeAxisView> gain_track;
StreamView* _view;
diff --git a/gtk2_ardour/route_ui.cc b/gtk2_ardour/route_ui.cc
index e7d893ddcc..a1a7f49ebc 100644
--- a/gtk2_ardour/route_ui.cc
+++ b/gtk2_ardour/route_ui.cc
@@ -206,6 +206,7 @@ RouteUI::set_route (boost::shared_ptr<Route> rp)
_route->PropertyChanged.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::property_changed, this, _1), gui_context());
_route->io_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::setup_invert_buttons, this), gui_context ());
+ _route->gui_changed.connect (route_connections, invalidator (*this), ui_bind (&RouteUI::route_gui_changed, this, _1), gui_context ());
if (_session->writable() && is_track()) {
boost::shared_ptr<Track> t = boost::dynamic_pointer_cast<Track>(_route);
@@ -1258,6 +1259,9 @@ RouteUI::choose_color ()
}
}
+/** Set the route's own color. This may not be used for display if
+ * the route is in a group which shares its color with its routes.
+ */
void
RouteUI::set_color (const Gdk::Color & c)
{
@@ -1266,14 +1270,26 @@ RouteUI::set_color (const Gdk::Color & c)
_color = c;
snprintf (buf, sizeof (buf), "%d:%d:%d", c.get_red(), c.get_green(), c.get_blue());
- set_gui_property ("color", buf);
+
+ /* note: we use the route state ID here so that color is the same for both
+ the time axis view and the mixer strip
+ */
+
+ gui_object_state().set<string> (route_state_id(), X_("color"), buf);
_route->gui_changed ("color", (void *) 0); /* EMIT_SIGNAL */
}
+/** @return GUI state ID for things that are common to the route in all its representations */
+string
+RouteUI::route_state_id () const
+{
+ return string_compose (X_("route %1"), _route->id().to_s());
+}
+
int
RouteUI::set_color_from_route ()
{
- const string str = gui_property ("color");
+ const string str = gui_object_state().get_string (route_state_id(), X_("color"));
if (str.empty()) {
return 1;
@@ -1782,3 +1798,14 @@ RouteUI::request_redraw ()
_route->gui_changed ("track_height", (void *) 0); /* EMIT_SIGNAL */
}
}
+
+/** The Route's gui_changed signal has been emitted */
+void
+RouteUI::route_gui_changed (string what_changed)
+{
+ if (what_changed == "color") {
+ if (set_color_from_route () == 0) {
+ route_color_changed ();
+ }
+ }
+}
diff --git a/gtk2_ardour/route_ui.h b/gtk2_ardour/route_ui.h
index 9649d74634..7ba9fe6144 100644
--- a/gtk2_ardour/route_ui.h
+++ b/gtk2_ardour/route_ui.h
@@ -222,11 +222,16 @@ class RouteUI : public virtual AxisView
void set_invert_sensitive (bool);
bool verify_new_route_name (const std::string& name);
+ void route_gui_changed (std::string);
+ virtual void route_color_changed () {}
+
private:
void check_rec_enable_sensitivity ();
void parameter_changed (std::string const &);
void relabel_solo_button ();
+ std::string route_state_id () const;
+
struct SoloMuteRelease {
SoloMuteRelease (bool was_active)
: active (was_active)