summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2010-11-16 14:43:28 +0000
committerCarl Hetherington <carl@carlh.net>2010-11-16 14:43:28 +0000
commit840a81a0e452b39ee7e8c32484c12c3a53ce8172 (patch)
treed28dc69ce2366ee8c3d95db20110b3efb506ac32 /gtk2_ardour
parenteb9530b2bbf1fbdabb905769609d55188c528c1f (diff)
Small cleanups.
git-svn-id: svn://localhost/ardour2/branches/3.0@8047 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/audio_region_view.cc47
1 files changed, 18 insertions, 29 deletions
diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc
index eceb9ab83d..53e70fbd79 100644
--- a/gtk2_ardour/audio_region_view.cc
+++ b/gtk2_ardour/audio_region_view.cc
@@ -185,17 +185,14 @@ AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
fade_out_shape->set_data ("regionview", this);
if (!_recregion) {
- uint32_t r,g,b,a;
- UINT_TO_RGBA(fill_color,&r,&g,&b,&a);
-
fade_in_handle = new ArdourCanvas::SimpleRect (*group);
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
+ fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
fade_in_handle->property_outline_pixels() = 0;
fade_in_handle->set_data ("regionview", this);
fade_out_handle = new ArdourCanvas::SimpleRect (*group);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,0);
+ fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
fade_out_handle->property_outline_pixels() = 0;
fade_out_handle->set_data ("regionview", this);
@@ -789,12 +786,9 @@ AudioRegionView::compute_colors (Gdk::Color const & basic_color)
{
RegionView::compute_colors (basic_color);
- uint32_t r, g, b, a;
-
/* gain color computed in envelope_active_changed() */
- UINT_TO_RGBA (fill_color, &r, &g, &b, &a);
- fade_color = RGBA_TO_UINT(r,g,b,120);
+ fade_color = UINT_RGBA_CHANGE_A (fill_color, 120);
}
void
@@ -1249,13 +1243,9 @@ AudioRegionView::entered (bool internal_editing)
gain_line->show_all_control_points ();
}
- uint32_t r,g,b,a;
- UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
- a=255;
-
if (fade_in_handle && !internal_editing) {
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
+ fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
}
}
@@ -1269,13 +1259,9 @@ AudioRegionView::exited ()
gain_line->hide_all_but_selected_control_points ();
}
- uint32_t r,g,b,a;
- UINT_TO_RGBA(fade_color,&r,&g,&b,&a);
- a=0;
-
if (fade_in_handle) {
- fade_in_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
- fade_out_handle->property_fill_color_rgba() = RGBA_TO_UINT(r,g,b,a);
+ fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
+ fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
}
}
@@ -1339,11 +1325,12 @@ AudioRegionView::set_frame_color ()
fill_opacity = 0;
}
- uint32_t r,g,b,a;
-
if (_selected && should_show_selection) {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);
+ if (fill_opacity) {
+ frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get(), fill_opacity);
+ } else {
+ frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_SelectedFrameBase.get();
+ }
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
if (_region->muted()) {
@@ -1355,8 +1342,7 @@ AudioRegionView::set_frame_color ()
}
} else {
if (_recregion) {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_RecordingRect.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, a);
+ frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_RecordingRect.get();
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
if (_region->muted()) {
@@ -1367,8 +1353,11 @@ AudioRegionView::set_frame_color ()
}
}
} else {
- UINT_TO_RGBA(ARDOUR_UI::config()->canvasvar_FrameBase.get(), &r, &g, &b, &a);
- frame->property_fill_color_rgba() = RGBA_TO_UINT(r, g, b, fill_opacity ? fill_opacity : a);
+ if (fill_opacity) {
+ frame->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_FrameBase.get(), fill_opacity);
+ } else {
+ frame->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_FrameBase.get();
+ }
for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
if (_region->muted()) {