summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-06-05 15:39:22 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2016-06-05 16:33:01 -0400
commit384d05dd35191077f3c2e6a5b6547f627aa0b68f (patch)
treee7876235190ccda1b433535caee1b39a9069c840 /gtk2_ardour
parent2aeb33989e2ad46a5ac00df166cce66aed922150 (diff)
change AxisView color API to be virtual and implement per-type variants
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/automation_time_axis.cc6
-rw-r--r--gtk2_ardour/automation_time_axis.h1
-rw-r--r--gtk2_ardour/axis_view.h6
-rw-r--r--gtk2_ardour/meter_strip.cc12
-rw-r--r--gtk2_ardour/meter_strip.h5
-rw-r--r--gtk2_ardour/mixer_strip.cc16
-rw-r--r--gtk2_ardour/mixer_strip.h5
-rw-r--r--gtk2_ardour/route_time_axis.cc15
-rw-r--r--gtk2_ardour/route_time_axis.h6
-rw-r--r--gtk2_ardour/vca_master_strip.cc6
-rw-r--r--gtk2_ardour/vca_master_strip.h2
-rw-r--r--gtk2_ardour/vca_time_axis.cc6
-rw-r--r--gtk2_ardour/vca_time_axis.h1
13 files changed, 80 insertions, 7 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index 8d661df58b..3262898d13 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -1050,3 +1050,9 @@ AutomationTimeAxisView::stripable () const
{
return _route;
}
+
+Gdk::Color
+AutomationTimeAxisView::color () const
+{
+ return gdk_color_from_rgb (_route->presentation_info().color());
+}
diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h
index 893c0d6f1e..d073890061 100644
--- a/gtk2_ardour/automation_time_axis.h
+++ b/gtk2_ardour/automation_time_axis.h
@@ -72,6 +72,7 @@ class AutomationTimeAxisView : public TimeAxisView {
virtual void set_height (uint32_t, TrackHeightMode m = OnlySelf);
void set_samples_per_pixel (double);
std::string name() const { return _name; }
+ Gdk::Color color () const;
boost::shared_ptr<ARDOUR::Stripable> stripable() const;
ARDOUR::PresentationInfo const & presentation_info () const;
diff --git a/gtk2_ardour/axis_view.h b/gtk2_ardour/axis_view.h
index 3f7e8236c5..75a5f7d421 100644
--- a/gtk2_ardour/axis_view.h
+++ b/gtk2_ardour/axis_view.h
@@ -43,15 +43,13 @@ namespace ARDOUR {
* AxisView defines the abstract base class for time-axis trackviews and routes.
*
*/
-class AxisView : public virtual Selectable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr
+class AxisView : public virtual Selectable, public virtual PBD::ScopedConnectionList, public virtual ARDOUR::SessionHandlePtr
{
public:
- /** @return the track's own color */
- Gdk::Color color () const { return _color; }
-
ARDOUR::Session* session() const { return _session; }
virtual std::string name() const = 0;
+ virtual Gdk::Color color() const = 0;
sigc::signal<void> Hiding;
diff --git a/gtk2_ardour/meter_strip.cc b/gtk2_ardour/meter_strip.cc
index c8992ee0b2..596906c5e8 100644
--- a/gtk2_ardour/meter_strip.cc
+++ b/gtk2_ardour/meter_strip.cc
@@ -967,3 +967,15 @@ MeterStrip::set_meter_type_multi (int what, RouteGroup* group, MeterType type)
break;
}
}
+
+string
+MeterStrip::name () const
+{
+ return _route->name();
+}
+
+Gdk::Color
+MeterStrip::color () const
+{
+ return RouteUI::route_color ();
+}
diff --git a/gtk2_ardour/meter_strip.h b/gtk2_ardour/meter_strip.h
index dfeb406976..fc9b61edb1 100644
--- a/gtk2_ardour/meter_strip.h
+++ b/gtk2_ardour/meter_strip.h
@@ -43,13 +43,16 @@ namespace Gtk {
class Style;
}
-class MeterStrip : public Gtk::VBox, public RouteUI
+class MeterStrip : public Gtk::VBox, public AxisView, public RouteUI
{
public:
MeterStrip (ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>);
MeterStrip (int, ARDOUR::MeterType);
~MeterStrip ();
+ std::string name() const;
+ Gdk::Color color () const;
+
void set_session (ARDOUR::Session* s);
void fast_update ();
boost::shared_ptr<ARDOUR::Route> route() { return _route; }
diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc
index 83cb318cd5..ebbf078b3c 100644
--- a/gtk2_ardour/mixer_strip.cc
+++ b/gtk2_ardour/mixer_strip.cc
@@ -450,6 +450,15 @@ MixerStrip::mixer_strip_leave_event (GdkEventCrossing *ev)
return false;
}
+string
+MixerStrip::name() const
+{
+ if (_route) {
+ return _route->name();
+ }
+ return string();
+}
+
void
MixerStrip::set_route (boost::shared_ptr<Route> rt)
{
@@ -2616,6 +2625,13 @@ MixerStrip::update_track_number_visibility ()
number_label.hide ();
}
}
+
+Gdk::Color
+MixerStrip::color () const
+{
+ return route_color ();
+}
+
bool
MixerStrip::marked_for_display () const
{
diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h
index 2ce32ef83b..d2e2236941 100644
--- a/gtk2_ardour/mixer_strip.h
+++ b/gtk2_ardour/mixer_strip.h
@@ -47,6 +47,7 @@
#include "pbd/fastlog.h"
+#include "axis_view.h"
#include "ardour_knob.h"
#include "route_ui.h"
#include "gain_meter.h"
@@ -74,13 +75,15 @@ class MotionController;
class RouteGroupMenu;
class ArdourWindow;
-class MixerStrip : public RouteUI, public Gtk::EventBox
+class MixerStrip : public AxisView, public RouteUI, public Gtk::EventBox
{
public:
MixerStrip (Mixer_UI&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>, bool in_mixer = true);
MixerStrip (Mixer_UI&, ARDOUR::Session*, bool in_mixer = true);
~MixerStrip ();
+ std::string name() const;
+ Gdk::Color color () const;
bool marked_for_display () const;
bool set_marked_for_display (bool);
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 1586a71c97..faf5712905 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -342,6 +342,15 @@ RouteTimeAxisView::~RouteTimeAxisView ()
CatchDeletion (this);
}
+string
+RouteTimeAxisView::name() const
+{
+ if (_route) {
+ return _route->name();
+ }
+ return string();
+}
+
void
RouteTimeAxisView::post_construct ()
{
@@ -2932,6 +2941,12 @@ RouteTimeAxisView::stripable () const
return _route;
}
+Gdk::Color
+RouteTimeAxisView::color () const
+{
+ return route_color ();
+}
+
bool
RouteTimeAxisView::marked_for_display () const
{
diff --git a/gtk2_ardour/route_time_axis.h b/gtk2_ardour/route_time_axis.h
index 9956aa6f3f..e24bd638a6 100644
--- a/gtk2_ardour/route_time_axis.h
+++ b/gtk2_ardour/route_time_axis.h
@@ -78,6 +78,11 @@ public:
RouteTimeAxisView (PublicEditor&, ARDOUR::Session*, ArdourCanvas::Canvas& canvas);
virtual ~RouteTimeAxisView ();
+ std::string name() const;
+ Gdk::Color color () const;
+ bool marked_for_display () const;
+ bool set_marked_for_display (bool);
+
void set_route (boost::shared_ptr<ARDOUR::Route>);
boost::shared_ptr<ARDOUR::Stripable> stripable() const;
@@ -134,7 +139,6 @@ public:
boost::shared_ptr<AutomationTimeAxisView> automation_child(Evoral::Parameter param);
virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
- std::string name() const;
StreamView* view() const { return _view; }
ARDOUR::RouteGroup* route_group() const;
boost::shared_ptr<ARDOUR::Playlist> playlist() const;
diff --git a/gtk2_ardour/vca_master_strip.cc b/gtk2_ardour/vca_master_strip.cc
index 087e562197..b0eaea9a70 100644
--- a/gtk2_ardour/vca_master_strip.cc
+++ b/gtk2_ardour/vca_master_strip.cc
@@ -548,3 +548,9 @@ VCAMasterStrip::drop_button_press ()
{
drop_all_slaves ();
}
+
+Gdk::Color
+VCAMasterStrip::color () const
+{
+ return gdk_color_from_rgb (_vca->presentation_info().color ());
+}
diff --git a/gtk2_ardour/vca_master_strip.h b/gtk2_ardour/vca_master_strip.h
index dc223d237a..711ee7171a 100644
--- a/gtk2_ardour/vca_master_strip.h
+++ b/gtk2_ardour/vca_master_strip.h
@@ -42,11 +42,13 @@ class VCAMasterStrip : public AxisView, public Gtk::EventBox
~VCAMasterStrip ();
std::string name() const;
+ Gdk::Color color () const;
std::string state_id() const { return "VCAMasterStrip"; }
boost::shared_ptr<ARDOUR::VCA> vca() const { return _vca; }
static PBD::Signal1<void,VCAMasterStrip*> CatchDeletion;
+
private:
boost::shared_ptr<ARDOUR::VCA> _vca;
GainMeter gain_meter;
diff --git a/gtk2_ardour/vca_time_axis.cc b/gtk2_ardour/vca_time_axis.cc
index 4f5777e7c4..a9d6725007 100644
--- a/gtk2_ardour/vca_time_axis.cc
+++ b/gtk2_ardour/vca_time_axis.cc
@@ -288,3 +288,9 @@ VCATimeAxisView::stripable () const
{
return _vca;
}
+
+Gdk::Color
+VCATimeAxisView::color () const
+{
+ return gdk_color_from_rgb (_vca->presentation_info().color ());
+}
diff --git a/gtk2_ardour/vca_time_axis.h b/gtk2_ardour/vca_time_axis.h
index 4acd5d3619..e14c2fe3fe 100644
--- a/gtk2_ardour/vca_time_axis.h
+++ b/gtk2_ardour/vca_time_axis.h
@@ -46,6 +46,7 @@ class VCATimeAxisView : public TimeAxisView
boost::shared_ptr<ARDOUR::VCA> vca() const { return _vca; }
std::string name() const;
+ Gdk::Color color () const;
std::string state_id() const;
bool selectable() const { return false; }