X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Faudio_region_view.cc;h=ac0d317a13a14e5f3fe2186555c487c3ccb46020;hb=ac61c228eba8dec7e81498b47013196681ca7ce8;hp=270373a26f337e81d7e60050d6804739ecd272ae;hpb=989d6b3d2a2c1d1132ef3e77f1acfac3593ee701;p=ardour.git diff --git a/gtk2_ardour/audio_region_view.cc b/gtk2_ardour/audio_region_view.cc index 270373a26f..ac0d317a13 100644 --- a/gtk2_ardour/audio_region_view.cc +++ b/gtk2_ardour/audio_region_view.cc @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - $Id$ */ #include @@ -90,14 +89,37 @@ AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView { } + +AudioRegionView::AudioRegionView (const AudioRegionView& other) + : RegionView (other) + , zero_line(0) + , fade_in_shape(0) + , fade_out_shape(0) + , fade_in_handle(0) + , fade_out_handle(0) + , gain_line(0) + , _amplitude_above_axis(1.0) + , _flags(0) + , fade_color(0) + +{ + Gdk::Color c; + int r,g,b,a; + + UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a); + c.set_rgb_p (r/255.0, g/255.0, b/255.0); + + init (c, false); +} + void AudioRegionView::init (Gdk::Color& basic_color, bool wfd) { // FIXME: Some redundancy here with RegionView::init. Need to figure out // where order is important and where it isn't... - RegionView::init(basic_color, wfd); - + RegionView::init(basic_color, false); + XMLNode *node; _amplitude_above_axis = 1.0; @@ -656,6 +678,9 @@ AudioRegionView::set_colors () } else { waves[n]->property_wave_color() = color_map[cWaveForm]; } + + waves[n]->property_clip_color() = color_map[cWaveFormClip]; + waves[n]->property_zero_color() = color_map[cZeroLine]; } } @@ -730,8 +755,6 @@ AudioRegionView::set_envelope_visible (bool yn) void AudioRegionView::create_waves () { - bool create_zero_line = true; - RouteTimeAxisView& atv (*(dynamic_cast(&trackview))); // ick if (!atv.get_diskstream()) { @@ -757,23 +780,11 @@ AudioRegionView::create_waves () if (audio_region()->source(n)->peaks_ready (bind (mem_fun(*this, &AudioRegionView::peaks_ready_handler), n), data_ready_connection)) { create_one_wave (n, true); } else { - create_zero_line = false; } } else { create_one_wave (n, true); } } - - if (create_zero_line) { - if (zero_line) { - delete zero_line; - } - zero_line = new ArdourCanvas::SimpleLine (*group); - zero_line->property_x1() = (gdouble) 1.0; - zero_line->property_x2() = (gdouble) (_region->length() / samples_per_unit) - 1.0; - zero_line->property_color_rgba() = (guint) color_map[cZeroLine]; - manage_zero_line (); - } } void @@ -808,6 +819,8 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct) wave->property_samples_per_unit() = samples_per_unit; wave->property_amplitude_above_axis() = _amplitude_above_axis; wave->property_wave_color() = _region->muted() ? color_map[cMutedWaveForm] : color_map[cWaveForm]; + wave->property_clip_color() = color_map[cWaveFormClip]; + wave->property_zero_color() = color_map[cZeroLine]; wave->property_region_start() = _region->start(); wave->property_rectified() = (bool) (_flags & WaveformRectified); wave->property_logscaled() = (bool) (_flags & WaveformLogScaled); @@ -846,6 +859,7 @@ AudioRegionView::create_one_wave (uint32_t which, bool direct) /* all waves created, don't hook into peaks ready anymore */ data_ready_connection.disconnect (); + if(0) if (!zero_line) { zero_line = new ArdourCanvas::SimpleLine (*group); zero_line->property_x1() = (gdouble) 1.0; @@ -1053,6 +1067,8 @@ AudioRegionView::add_ghost (AutomationTimeAxisView& atv) wave->property_samples_per_unit() = samples_per_unit; wave->property_amplitude_above_axis() = _amplitude_above_axis; wave->property_wave_color() = color_map[cGhostTrackWave]; + wave->property_clip_color() = color_map[cGhostTrackWaveClip]; + wave->property_zero_color() = color_map[cGhostTrackZeroLine]; wave->property_region_start() = _region->start(); ghost->waves.push_back(wave); @@ -1137,6 +1153,8 @@ AudioRegionView::color_handler (ColorID id, uint32_t val) switch (id) { case cMutedWaveForm: case cWaveForm: + case cWaveFormClip: + case cZeroLine: set_colors (); break; @@ -1144,15 +1162,6 @@ AudioRegionView::color_handler (ColorID id, uint32_t val) case cGainLine: envelope_active_changed(); break; - - case cZeroLine: - if (zero_line) { - zero_line->property_color_rgba() = (guint) color_map[cZeroLine]; - } - break; - - case cGhostTrackWave: - break; default: break;