2 Copyright (C) 2001-2006 Paul Davis
4 This program is free software; you can r>edistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 #include <boost/scoped_array.hpp>
27 #include <gtkmm2ext/gtk_ui.h>
29 #include "ardour/playlist.h"
30 #include "ardour/audioregion.h"
31 #include "ardour/audiosource.h"
32 #include "ardour/profile.h"
33 #include "ardour/session.h"
35 #include "pbd/memento_command.h"
36 #include "pbd/stacktrace.h"
38 #include "evoral/Curve.hpp"
40 #include "streamview.h"
41 #include "audio_region_view.h"
42 #include "audio_time_axis.h"
43 #include "simplerect.h"
44 #include "simpleline.h"
46 #include "public_editor.h"
47 #include "audio_region_editor.h"
48 #include "audio_streamview.h"
49 #include "region_gain_line.h"
50 #include "control_point.h"
51 #include "ghostregion.h"
52 #include "audio_time_axis.h"
54 #include "rgb_macros.h"
55 #include "gui_thread.h"
56 #include "ardour_ui.h"
60 #define MUTED_ALPHA 10
63 using namespace ARDOUR;
65 using namespace Editing;
66 using namespace ArdourCanvas;
68 static const int32_t sync_mark_width = 9;
69 static double const handle_size = 6; /* height of fade handles */
71 AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
72 Gdk::Color const & basic_color)
73 : RegionView (parent, tv, r, spu, basic_color)
81 , start_xfade_rect (0)
82 , _start_xfade_visible (false)
86 , _end_xfade_visible (false)
87 , _amplitude_above_axis(1.0)
90 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
93 AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
94 Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
95 : RegionView (parent, tv, r, spu, basic_color, recording, visibility)
102 , start_xfade_out (0)
103 , start_xfade_rect (0)
104 , _start_xfade_visible (false)
108 , _end_xfade_visible (false)
109 , _amplitude_above_axis(1.0)
112 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
115 AudioRegionView::AudioRegionView (const AudioRegionView& other, boost::shared_ptr<AudioRegion> other_region)
116 : RegionView (other, boost::shared_ptr<Region> (other_region))
122 , start_xfade_out (0)
123 , start_xfade_rect (0)
124 , _start_xfade_visible (false)
128 , _end_xfade_visible (false)
129 , _amplitude_above_axis (other._amplitude_above_axis)
135 UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
136 c.set_rgb_p (r/255.0, g/255.0, b/255.0);
140 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
144 AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
146 // FIXME: Some redundancy here with RegionView::init. Need to figure out
147 // where order is important and where it isn't...
149 RegionView::init (basic_color, wfd);
151 _amplitude_above_axis = 1.0;
153 compute_colors (basic_color);
157 fade_in_shape = new ArdourCanvas::Polygon (*group);
158 fade_in_shape->property_fill_color_rgba() = fade_color;
159 fade_in_shape->set_data ("regionview", this);
161 fade_out_shape = new ArdourCanvas::Polygon (*group);
162 fade_out_shape->property_fill_color_rgba() = fade_color;
163 fade_out_shape->set_data ("regionview", this);
166 fade_in_handle = new ArdourCanvas::SimpleRect (*group);
167 fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
168 fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
170 fade_in_handle->set_data ("regionview", this);
172 fade_out_handle = new ArdourCanvas::SimpleRect (*group);
173 fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
174 fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
176 fade_out_handle->set_data ("regionview", this);
179 setup_fade_handle_positions ();
181 if (!trackview.session()->config.get_show_region_fades()) {
182 set_fade_visibility (false);
185 const string line_name = _region->name() + ":gain";
187 if (!Profile->get_sae()) {
188 gain_line.reset (new AudioRegionGainLine (line_name, *this, *group, audio_region()->envelope()));
191 update_envelope_visibility ();
194 set_height (trackview.current_height());
197 region_sync_changed ();
199 region_resized (ARDOUR::bounds_change);
200 set_waveview_data_src();
202 envelope_active_changed ();
203 fade_in_active_changed ();
204 fade_out_active_changed ();
206 reset_width_dependent_items (_pixel_width);
208 fade_in_shape->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_event), fade_in_shape, this));
209 if (fade_in_handle) {
210 fade_in_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_handle_event), fade_in_handle, this));
213 fade_out_shape->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_event), fade_out_shape, this));
215 if (fade_out_handle) {
216 fade_out_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_handle_event), fade_out_handle, this));
221 setup_waveform_visibility ();
222 setup_waveform_shape ();
223 setup_waveform_scale ();
225 /* XXX sync mark drag? */
228 AudioRegionView::~AudioRegionView ()
230 in_destructor = true;
232 RegionViewGoingAway (this); /* EMIT_SIGNAL */
234 for (vector<GnomeCanvasWaveViewCache *>::iterator cache = wave_caches.begin(); cache != wave_caches.end() ; ++cache) {
235 gnome_canvas_waveview_cache_destroy (*cache);
238 for (vector<ScopedConnection*>::iterator i = _data_ready_connections.begin(); i != _data_ready_connections.end(); ++i) {
242 for (list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) {
243 delete ((*i).second);
246 /* all waveviews etc will be destroyed when the group is destroyed */
249 boost::shared_ptr<ARDOUR::AudioRegion>
250 AudioRegionView::audio_region() const
252 // "Guaranteed" to succeed...
253 return boost::dynamic_pointer_cast<AudioRegion>(_region);
257 AudioRegionView::region_changed (const PropertyChange& what_changed)
259 ENSURE_GUI_THREAD (*this, &AudioRegionView::region_changed, what_changed);
261 RegionView::region_changed (what_changed);
263 if (what_changed.contains (ARDOUR::Properties::scale_amplitude)) {
264 region_scale_amplitude_changed ();
266 if (what_changed.contains (ARDOUR::Properties::fade_in)) {
269 if (what_changed.contains (ARDOUR::Properties::fade_out)) {
272 if (what_changed.contains (ARDOUR::Properties::fade_in_active)) {
273 fade_in_active_changed ();
275 if (what_changed.contains (ARDOUR::Properties::fade_out_active)) {
276 fade_out_active_changed ();
278 if (what_changed.contains (ARDOUR::Properties::envelope_active)) {
279 envelope_active_changed ();
281 if (what_changed.contains (ARDOUR::Properties::valid_transients)) {
282 transients_changed ();
287 AudioRegionView::fade_in_changed ()
289 reset_fade_in_shape ();
293 AudioRegionView::fade_out_changed ()
295 reset_fade_out_shape ();
299 AudioRegionView::fade_in_active_changed ()
301 if (audio_region()->fade_in_active()) {
302 fade_in_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,90); // FIXME make a themeable colour
303 fade_in_shape->property_width_pixels() = 1;
305 fade_in_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,20); // FIXME make a themeable colour
306 fade_in_shape->property_width_pixels() = 1;
311 AudioRegionView::fade_out_active_changed ()
313 if (audio_region()->fade_out_active()) {
314 fade_out_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,90); // FIXME make a themeable colour
315 fade_out_shape->property_width_pixels() = 1;
317 fade_out_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,20); // FIXME make a themeable colour
318 fade_out_shape->property_width_pixels() = 1;
324 AudioRegionView::region_scale_amplitude_changed ()
326 ENSURE_GUI_THREAD (*this, &AudioRegionView::region_scale_amplitude_changed)
328 for (uint32_t n = 0; n < waves.size(); ++n) {
329 // force a reload of the cache
330 waves[n]->property_data_src() = _region.get();
335 AudioRegionView::region_renamed ()
337 std::string str = RegionView::make_name ();
339 if (audio_region()->speed_mismatch (trackview.session()->frame_rate())) {
340 str = string ("*") + str;
343 if (_region->muted()) {
344 str = string ("!") + str;
347 set_item_name (str, this);
352 AudioRegionView::region_resized (const PropertyChange& what_changed)
354 AudioGhostRegion* agr;
356 RegionView::region_resized(what_changed);
357 PropertyChange interesting_stuff;
359 interesting_stuff.add (ARDOUR::Properties::start);
360 interesting_stuff.add (ARDOUR::Properties::length);
362 if (what_changed.contains (interesting_stuff)) {
364 for (uint32_t n = 0; n < waves.size(); ++n) {
365 waves[n]->property_region_start() = _region->start();
368 for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
369 if ((agr = dynamic_cast<AudioGhostRegion*>(*i)) != 0) {
371 for (vector<WaveView*>::iterator w = agr->waves.begin(); w != agr->waves.end(); ++w) {
372 (*w)->property_region_start() = _region->start();
377 /* hide transient lines that extend beyond the region end */
379 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
381 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
382 if (l->first > _region->length() - 1) {
392 AudioRegionView::reset_width_dependent_items (double pixel_width)
394 RegionView::reset_width_dependent_items(pixel_width);
395 assert(_pixel_width == pixel_width);
397 if (fade_in_handle) {
398 if (pixel_width <= 6.0 || _height < 5.0 || !trackview.session()->config.get_show_region_fades()) {
399 fade_in_handle->hide();
400 fade_out_handle->hide();
403 fade_in_handle->show();
404 fade_out_handle->show();
408 AnalysisFeatureList analysis_features = _region->transients();
409 AnalysisFeatureList::const_iterator i;
411 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
413 for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
415 float x_pos = trackview.editor().frame_to_pixel (*i);
417 ArdourCanvas::Points points;
418 points.push_back(Gnome::Art::Point(x_pos, 2.0)); // first x-coord needs to be a non-normal value
419 points.push_back(Gnome::Art::Point(x_pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
422 (*l).second->property_points() = points;
425 reset_fade_shapes ();
429 AudioRegionView::region_muted ()
431 RegionView::region_muted();
433 for (uint32_t n=0; n < waves.size(); ++n) {
434 if (_region->muted()) {
435 waves[n]->property_wave_color() = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA);
437 waves[n]->property_wave_color() = ARDOUR_UI::config()->canvasvar_WaveForm.get();
443 AudioRegionView::setup_fade_handle_positions()
445 /* position of fade handle offset from the top of the region view */
446 double const handle_pos = 2;
448 if (fade_in_handle) {
449 fade_in_handle->property_y1() = handle_pos;
450 fade_in_handle->property_y2() = handle_pos + handle_size;
453 if (fade_out_handle) {
454 fade_out_handle->property_y1() = handle_pos;
455 fade_out_handle->property_y2() = handle_pos + handle_size;
460 AudioRegionView::set_height (gdouble height)
462 RegionView::set_height (height);
464 uint32_t wcnt = waves.size();
466 for (uint32_t n = 0; n < wcnt; ++n) {
469 if (height < NAME_HIGHLIGHT_THRESH) {
470 ht = ((height - 2 * wcnt) / (double) wcnt);
472 ht = (((height - 2 * wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
475 gdouble yoff = n * (ht + 1);
477 waves[n]->property_height() = ht;
478 waves[n]->property_y() = yoff + 2;
483 if ((height/wcnt) < NAME_HIGHLIGHT_THRESH) {
486 update_envelope_visibility ();
489 gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE) - 2);
492 reset_fade_shapes ();
494 /* Update hights for any active feature lines */
495 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
497 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
499 float pos_x = trackview.editor().frame_to_pixel((*l).first);
501 ArdourCanvas::Points points;
503 points.push_back(Gnome::Art::Point(pos_x, 2.0)); // first x-coord needs to be a non-normal value
504 points.push_back(Gnome::Art::Point(pos_x, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
506 (*l).second->property_points() = points;
510 name_pixbuf->raise_to_top();
515 AudioRegionView::reset_fade_shapes ()
517 reset_fade_in_shape ();
518 reset_fade_out_shape ();
522 AudioRegionView::reset_fade_in_shape ()
524 reset_fade_in_shape_width (audio_region(), (framecnt_t) audio_region()->fade_in()->back()->when);
528 AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
530 if (fade_in_handle == 0) {
534 fade_in_handle->show ();
536 /* smallest size for a fade is 64 frames */
538 width = std::max ((framecnt_t) 64, width);
542 /* round here to prevent little visual glitches with sub-pixel placement */
543 double const pwidth = rint (width / samples_per_unit);
544 uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
547 double const handle_center = pwidth;
549 /* Put the fade in handle so that its left side is at the end-of-fade line */
550 fade_in_handle->property_x1() = handle_center;
551 fade_in_handle->property_x2() = handle_center + handle_size;
555 fade_in_shape->hide();
559 if (trackview.session()->config.get_show_region_fades()) {
560 fade_in_shape->show();
563 float curve[npoints];
564 audio_region()->fade_in()->curve().get_vector (0, audio_region()->fade_in()->back()->when, curve, npoints);
566 points = get_canvas_points ("fade in shape", npoints + 3);
568 if (_height >= NAME_HIGHLIGHT_THRESH) {
569 h = _height - NAME_HIGHLIGHT_SIZE - 2;
574 /* points *MUST* be in anti-clockwise order */
577 double xdelta = pwidth/npoints;
579 for (pi = 0, pc = 0; pc < npoints; ++pc) {
580 (*points)[pi].set_x(1 + (pc * xdelta));
581 (*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
586 (*points)[pi].set_x(pwidth);
587 (*points)[pi++].set_y(2);
589 (*points)[pi].set_x(1);
590 (*points)[pi++].set_y(2);
592 /* connect the dots ... */
594 (*points)[pi] = (*points)[0];
596 fade_in_shape->property_points() = *points;
599 redraw_start_xfade_to ( ar, width);
601 /* ensure trim handle stays on top */
602 if (frame_handle_start) {
603 frame_handle_start->raise_to_top();
609 AudioRegionView::reset_fade_out_shape ()
611 reset_fade_out_shape_width (audio_region(), (framecnt_t) audio_region()->fade_out()->back()->when);
615 AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
617 if (fade_out_handle == 0) {
621 fade_out_handle->show ();
623 /* smallest size for a fade is 64 frames */
625 width = std::max ((framecnt_t) 64, width);
629 /* round here to prevent little visual glitches with sub-pixel placement */
630 double const pwidth = rint (width / samples_per_unit);
631 uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
634 double const handle_center = (_region->length() - width) / samples_per_unit;
636 /* Put the fade out handle so that its right side is at the end-of-fade line;
637 * it's `one out' for precise pixel accuracy.
639 fade_out_handle->property_x1() = handle_center - 5;
640 fade_out_handle->property_x2() = handle_center + 1;
642 /* don't show shape if its too small */
646 fade_out_shape->hide();
650 if (trackview.session()->config.get_show_region_fades()) {
651 fade_out_shape->show();
654 float curve[npoints];
655 audio_region()->fade_out()->curve().get_vector (0, audio_region()->fade_out()->back()->when, curve, npoints);
657 if (_height >= NAME_HIGHLIGHT_THRESH) {
658 h = _height - NAME_HIGHLIGHT_SIZE - 2;
663 /* points *MUST* be in anti-clockwise order */
665 points = get_canvas_points ("fade out shape", npoints + 3);
668 double xdelta = pwidth/npoints;
670 for (pi = 0, pc = 0; pc < npoints; ++pc) {
671 (*points)[pi].set_x(_pixel_width - pwidth + (pc * xdelta));
672 (*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
677 (*points)[pi].set_x(_pixel_width);
678 (*points)[pi++].set_y(h);
680 (*points)[pi].set_x(_pixel_width);
681 (*points)[pi++].set_y(2);
683 /* connect the dots ... */
685 (*points)[pi] = (*points)[0];
687 fade_out_shape->property_points() = *points;
690 redraw_end_xfade_to (ar, width);
692 /* ensure trim handle stays on top */
693 if (frame_handle_end) {
694 frame_handle_end->raise_to_top();
700 AudioRegionView::get_fade_in_shape_width ()
702 return audio_region()->fade_in()->back()->when;
706 AudioRegionView::get_fade_out_shape_width ()
708 return audio_region()->fade_out()->back()->when;
713 AudioRegionView::set_samples_per_unit (gdouble spu)
715 RegionView::set_samples_per_unit (spu);
717 if (Config->get_show_waveforms ()) {
718 for (uint32_t n = 0; n < waves.size(); ++n) {
719 waves[n]->property_samples_per_unit() = spu;
727 reset_fade_shapes ();
731 AudioRegionView::set_amplitude_above_axis (gdouble spp)
733 for (uint32_t n=0; n < waves.size(); ++n) {
734 waves[n]->property_amplitude_above_axis() = spp;
739 AudioRegionView::compute_colors (Gdk::Color const & basic_color)
741 RegionView::compute_colors (basic_color);
743 /* gain color computed in envelope_active_changed() */
745 fade_color = UINT_RGBA_CHANGE_A (fill_color, 120);
749 AudioRegionView::set_colors ()
751 RegionView::set_colors();
754 gain_line->set_line_color (audio_region()->envelope_active() ? ARDOUR_UI::config()->canvasvar_GainLine.get() : ARDOUR_UI::config()->canvasvar_GainLineInactive.get());
757 for (uint32_t n=0; n < waves.size(); ++n) {
758 if (_region->muted()) {
759 waves[n]->property_wave_color() = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA);
761 waves[n]->property_wave_color() = ARDOUR_UI::config()->canvasvar_WaveForm.get();
764 waves[n]->property_clip_color() = ARDOUR_UI::config()->canvasvar_WaveFormClip.get();
765 waves[n]->property_zero_color() = ARDOUR_UI::config()->canvasvar_ZeroLine.get();
770 AudioRegionView::setup_waveform_visibility ()
772 if (Config->get_show_waveforms ()) {
773 for (uint32_t n = 0; n < waves.size(); ++n) {
774 /* make sure the zoom level is correct, since we don't update
775 this when waveforms are hidden.
777 waves[n]->property_samples_per_unit() = samples_per_unit;
781 for (uint32_t n = 0; n < waves.size(); ++n) {
788 AudioRegionView::temporarily_hide_envelope ()
796 AudioRegionView::unhide_envelope ()
798 update_envelope_visibility ();
802 AudioRegionView::update_envelope_visibility ()
808 if (Config->get_show_region_gain() || trackview.editor().current_mouse_mode() == Editing::MouseGain) {
809 gain_line->add_visibility (AutomationLine::Line);
816 AudioRegionView::create_waves ()
818 // cerr << "AudioRegionView::create_waves() called on " << this << endl;//DEBUG
819 RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
825 ChanCount nchans = atv.track()->n_channels();
827 // cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data
828 // << " and channels = " << nchans.n_audio() << endl;
830 /* in tmp_waves, set up null pointers for each channel so the vector is allocated */
831 for (uint32_t n = 0; n < nchans.n_audio(); ++n) {
832 tmp_waves.push_back (0);
835 for (vector<ScopedConnection*>::iterator i = _data_ready_connections.begin(); i != _data_ready_connections.end(); ++i) {
839 _data_ready_connections.clear ();
841 for (uint32_t i = 0; i < nchans.n_audio(); ++i) {
842 _data_ready_connections.push_back (0);
845 for (uint32_t n = 0; n < nchans.n_audio(); ++n) {
847 if (n >= audio_region()->n_channels()) {
851 wave_caches.push_back (WaveView::create_cache ());
853 // cerr << "\tchannel " << n << endl;
856 if (audio_region()->audio_source(n)->peaks_ready (boost::bind (&AudioRegionView::peaks_ready_handler, this, n), &_data_ready_connections[n], gui_context())) {
857 // cerr << "\tData is ready\n";
858 create_one_wave (n, true);
860 // cerr << "\tdata is not ready\n";
861 // we'll get a PeaksReady signal from the source in the future
862 // and will call create_one_wave(n) then.
866 // cerr << "\tdon't delay, display today!\n";
867 create_one_wave (n, true);
874 AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
876 //cerr << "AudioRegionView::create_one_wave() called which: " << which << " this: " << this << endl;//DEBUG
877 RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
878 uint32_t nchans = atv.track()->n_channels().n_audio();
880 uint32_t nwaves = std::min (nchans, audio_region()->n_channels());
883 if (trackview.current_height() < NAME_HIGHLIGHT_THRESH) {
884 ht = ((trackview.current_height()) / (double) nchans);
886 ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
889 gdouble yoff = which * ht;
891 WaveView *wave = new WaveView(*group);
893 wave->property_data_src() = (gpointer) _region.get();
894 wave->property_cache() = wave_caches[which];
895 wave->property_cache_updater() = true;
896 wave->property_channel() = which;
897 wave->property_length_function() = (gpointer) region_length_from_c;
898 wave->property_sourcefile_length_function() = (gpointer) sourcefile_length_from_c;
899 wave->property_peak_function() = (gpointer) region_read_peaks_from_c;
900 wave->property_x() = 0.0;
901 wave->property_y() = yoff;
902 wave->property_height() = (double) ht;
903 wave->property_samples_per_unit() = samples_per_unit;
904 wave->property_amplitude_above_axis() = _amplitude_above_axis;
907 wave->property_wave_color() = _region->muted() ? UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_RecWaveForm.get(), MUTED_ALPHA) : ARDOUR_UI::config()->canvasvar_RecWaveForm.get();
908 wave->property_fill_color() = ARDOUR_UI::config()->canvasvar_RecWaveFormFill.get();
910 wave->property_wave_color() = _region->muted() ? UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA) : ARDOUR_UI::config()->canvasvar_WaveForm.get();
911 wave->property_fill_color() = ARDOUR_UI::config()->canvasvar_WaveFormFill.get();
914 wave->property_clip_color() = ARDOUR_UI::config()->canvasvar_WaveFormClip.get();
915 wave->property_zero_color() = ARDOUR_UI::config()->canvasvar_ZeroLine.get();
916 wave->property_zero_line() = true;
917 wave->property_region_start() = _region->start();
918 wave->property_rectified() = Config->get_waveform_shape() == Rectified;
919 wave->property_logscaled() = Config->get_waveform_scale() == Logarithmic;
921 if (!Config->get_show_waveforms ()) {
925 /* note: calling this function is serialized by the lock
926 held in the peak building thread that signals that
927 peaks are ready for use *or* by the fact that it is
928 called one by one from the GUI thread.
931 if (which < nchans) {
932 tmp_waves[which] = wave;
934 /* n-channel track, >n-channel source */
937 /* see if we're all ready */
939 for (n = 0; n < nchans; ++n) {
940 if (tmp_waves[n] == 0) {
945 if (n == nwaves && waves.empty()) {
946 /* all waves are ready */
947 tmp_waves.resize(nwaves);
952 /* all waves created, don't hook into peaks ready anymore */
953 delete _data_ready_connections[which];
954 _data_ready_connections[which] = 0;
959 AudioRegionView::peaks_ready_handler (uint32_t which)
961 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&AudioRegionView::create_one_wave, this, which, false));
962 // cerr << "AudioRegionView::peaks_ready_handler() called on " << which << " this: " << this << endl;
966 AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
974 /* don't create points that can't be seen */
976 update_envelope_visibility ();
983 framepos_t fx = trackview.editor().pixel_to_frame (x);
985 if (fx > _region->length()) {
989 /* compute vertical fractional position */
991 y = 1.0 - (y / (_height - NAME_HIGHLIGHT_SIZE));
993 /* map using gain line */
995 gain_line->view_to_model_coord (x, y);
997 /* XXX STATEFUL: can't convert to stateful diff until we
998 can represent automation data with it.
1001 trackview.session()->begin_reversible_command (_("add gain control point"));
1002 XMLNode &before = audio_region()->envelope()->get_state();
1004 if (!audio_region()->envelope_active()) {
1005 XMLNode ®ion_before = audio_region()->get_state();
1006 audio_region()->set_envelope_active(true);
1007 XMLNode ®ion_after = audio_region()->get_state();
1008 trackview.session()->add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), ®ion_before, ®ion_after));
1011 audio_region()->envelope()->add (fx, y);
1013 XMLNode &after = audio_region()->envelope()->get_state();
1014 trackview.session()->add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));
1015 trackview.session()->commit_reversible_command ();
1019 AudioRegionView::remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent */*ev*/)
1021 ControlPoint *cp = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"));
1022 audio_region()->envelope()->erase (cp->model());
1026 AudioRegionView::setup_waveform_shape ()
1028 for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
1029 (*wave)->property_rectified() = Config->get_waveform_shape() == Rectified;
1034 AudioRegionView::setup_waveform_scale ()
1036 for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
1037 (*wave)->property_logscaled() = Config->get_waveform_scale() == Logarithmic;
1043 AudioRegionView::add_ghost (TimeAxisView& tv)
1045 RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&trackview);
1048 double unit_position = _region->position () / samples_per_unit;
1049 AudioGhostRegion* ghost = new AudioGhostRegion (tv, trackview, unit_position);
1052 nchans = rtv->track()->n_channels().n_audio();
1054 for (uint32_t n = 0; n < nchans; ++n) {
1056 if (n >= audio_region()->n_channels()) {
1060 WaveView *wave = new WaveView(*ghost->group);
1062 wave->property_data_src() = _region.get();
1063 wave->property_cache() = wave_caches[n];
1064 wave->property_cache_updater() = false;
1065 wave->property_channel() = n;
1066 wave->property_length_function() = (gpointer)region_length_from_c;
1067 wave->property_sourcefile_length_function() = (gpointer) sourcefile_length_from_c;
1068 wave->property_peak_function() = (gpointer) region_read_peaks_from_c;
1069 wave->property_x() = 0.0;
1070 wave->property_samples_per_unit() = samples_per_unit;
1071 wave->property_amplitude_above_axis() = _amplitude_above_axis;
1073 wave->property_region_start() = _region->start();
1075 ghost->waves.push_back(wave);
1078 ghost->set_height ();
1079 ghost->set_duration (_region->length() / samples_per_unit);
1080 ghost->set_colors();
1081 ghosts.push_back (ghost);
1087 AudioRegionView::entered (bool internal_editing)
1089 trackview.editor().set_current_trimmable (_region);
1090 trackview.editor().set_current_movable (_region);
1092 if (gain_line && trackview.editor().current_mouse_mode() == Editing::MouseGain) {
1093 gain_line->add_visibility (AutomationLine::ControlPoints);
1096 if (fade_in_handle && !internal_editing) {
1097 fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 255);
1098 fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
1099 fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 255);
1100 fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
1105 AudioRegionView::exited ()
1107 trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>());
1108 trackview.editor().set_current_movable (boost::shared_ptr<Movable>());
1110 if (gain_line && trackview.editor().current_mouse_mode() == Editing::MouseGain) {
1111 gain_line->remove_visibility (AutomationLine::ControlPoints);
1114 if (fade_in_handle) {
1115 fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
1116 fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
1117 fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
1118 fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
1123 AudioRegionView::envelope_active_changed ()
1126 gain_line->set_line_color (audio_region()->envelope_active() ? ARDOUR_UI::config()->canvasvar_GainLine.get() : ARDOUR_UI::config()->canvasvar_GainLineInactive.get());
1131 AudioRegionView::set_waveview_data_src()
1133 AudioGhostRegion* agr;
1134 double unit_length= _region->length() / samples_per_unit;
1136 for (uint32_t n = 0; n < waves.size(); ++n) {
1137 // TODO: something else to let it know the channel
1138 waves[n]->property_data_src() = _region.get();
1141 for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
1143 (*i)->set_duration (unit_length);
1145 if((agr = dynamic_cast<AudioGhostRegion*>(*i)) != 0) {
1146 for (vector<WaveView*>::iterator w = agr->waves.begin(); w != agr->waves.end(); ++w) {
1147 (*w)->property_data_src() = _region.get();
1155 AudioRegionView::color_handler ()
1157 //case cMutedWaveForm:
1159 //case cWaveFormClip:
1163 //case cGainLineInactive:
1165 envelope_active_changed();
1170 AudioRegionView::set_frame_color ()
1176 if (_region->opaque()) {
1182 TimeAxisViewItem::set_frame_color ();
1188 if (_region->muted()) {
1189 wc = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_SelectedWaveForm.get(), MUTED_ALPHA);
1191 wc = ARDOUR_UI::config()->canvasvar_SelectedWaveForm.get();
1193 fc = ARDOUR_UI::config()->canvasvar_SelectedWaveFormFill.get();
1196 if (_region->muted()) {
1197 wc = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_RecWaveForm.get(), MUTED_ALPHA);
1199 wc = ARDOUR_UI::config()->canvasvar_RecWaveForm.get();
1201 fc = ARDOUR_UI::config()->canvasvar_RecWaveFormFill.get();
1203 if (_region->muted()) {
1204 wc = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA);
1206 wc = ARDOUR_UI::config()->canvasvar_WaveForm.get();
1208 fc = ARDOUR_UI::config()->canvasvar_WaveFormFill.get();
1212 for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
1213 if (_region->muted()) {
1214 (*w)->property_wave_color() = wc;
1216 (*w)->property_wave_color() = wc;
1217 (*w)->property_fill_color() = fc;
1223 AudioRegionView::set_fade_visibility (bool yn)
1226 if (fade_in_shape) {
1227 fade_in_shape->show();
1229 if (fade_out_shape) {
1230 fade_out_shape->show ();
1232 if (fade_in_handle) {
1233 fade_in_handle->show ();
1235 if (fade_out_handle) {
1236 fade_out_handle->show ();
1239 if (fade_in_shape) {
1240 fade_in_shape->hide();
1242 if (fade_out_shape) {
1243 fade_out_shape->hide ();
1245 if (fade_in_handle) {
1246 fade_in_handle->hide ();
1248 if (fade_out_handle) {
1249 fade_out_handle->hide ();
1255 AudioRegionView::update_coverage_frames (LayerDisplay d)
1257 RegionView::update_coverage_frames (d);
1259 if (fade_in_handle) {
1260 fade_in_handle->raise_to_top ();
1261 fade_out_handle->raise_to_top ();
1266 AudioRegionView::show_region_editor ()
1269 editor = new AudioRegionEditor (trackview.session(), audio_region());
1277 AudioRegionView::transients_changed ()
1279 AnalysisFeatureList analysis_features = _region->transients();
1281 while (feature_lines.size() < analysis_features.size()) {
1283 ArdourCanvas::Line* canvas_item = new ArdourCanvas::Line(*group);
1285 ArdourCanvas::Points points;
1287 points.push_back(Gnome::Art::Point(-1.0, 2.0)); // first x-coord needs to be a non-normal value
1288 points.push_back(Gnome::Art::Point(1.0, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
1290 canvas_item->property_points() = points;
1291 canvas_item->property_width_pixels() = 1;
1292 canvas_item->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ZeroLine.get();
1293 canvas_item->property_first_arrowhead() = TRUE;
1294 canvas_item->property_last_arrowhead() = TRUE;
1295 canvas_item->property_arrow_shape_a() = 11.0;
1296 canvas_item->property_arrow_shape_b() = 0.0;
1297 canvas_item->property_arrow_shape_c() = 4.0;
1299 canvas_item->raise_to_top ();
1300 canvas_item->show ();
1302 canvas_item->set_data ("regionview", this);
1303 canvas_item->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_feature_line_event), canvas_item, this));
1305 feature_lines.push_back (make_pair(0, canvas_item));
1308 while (feature_lines.size() > analysis_features.size()) {
1309 ArdourCanvas::Line* line = feature_lines.back().second;
1310 feature_lines.pop_back ();
1314 AnalysisFeatureList::const_iterator i;
1315 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
1317 for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
1319 ArdourCanvas::Points points;
1321 float *pos = new float;
1322 *pos = trackview.editor().frame_to_pixel (*i);
1324 points.push_back(Gnome::Art::Point(*pos, 2.0)); // first x-coord needs to be a non-normal value
1325 points.push_back(Gnome::Art::Point(*pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
1327 (*l).second->property_points() = points;
1328 (*l).second->set_data ("position", pos);
1335 AudioRegionView::update_transient(float /*old_pos*/, float new_pos)
1337 /* Find frame at old pos, calulate new frame then update region transients*/
1338 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
1340 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
1342 /* Line has been updated in drag so we compare to new_pos */
1344 float* pos = (float*) (*l).second->get_data ("position");
1346 if (rint(new_pos) == rint(*pos)) {
1348 framepos_t old_frame = (*l).first;
1349 framepos_t new_frame = trackview.editor().pixel_to_frame (new_pos);
1351 _region->update_transient (old_frame, new_frame);
1359 AudioRegionView::remove_transient(float pos)
1361 /* Find frame at old pos, calulate new frame then update region transients*/
1362 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
1364 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
1366 /* Line has been updated in drag so we compare to new_pos */
1367 float *line_pos = (float*) (*l).second->get_data ("position");
1369 if (rint(pos) == rint(*line_pos)) {
1370 _region->remove_transient ((*l).first);
1377 AudioRegionView::thaw_after_trim ()
1379 RegionView::thaw_after_trim ();
1385 AudioRegionView::redraw_start_xfade ()
1387 boost::shared_ptr<AudioRegion> ar (audio_region());
1389 if (!ar->fade_in() || ar->fade_in()->empty()) {
1395 redraw_start_xfade_to (ar, ar->fade_in()->back()->when);
1399 AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t len)
1401 int32_t const npoints = trackview.editor().frame_to_pixel (len);
1407 if (!start_xfade_in) {
1408 start_xfade_in = new ArdourCanvas::Line (*group);
1409 start_xfade_in->property_width_pixels() = 1;
1410 start_xfade_in->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
1413 if (!start_xfade_out) {
1414 start_xfade_out = new ArdourCanvas::Line (*group);
1415 start_xfade_out->property_width_pixels() = 1;
1416 uint32_t col = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 128);
1417 start_xfade_out->property_fill_color_rgba() = col;
1420 if (!start_xfade_rect) {
1421 start_xfade_rect = new ArdourCanvas::SimpleRect (*group);
1422 start_xfade_rect->property_draw() = true;
1423 start_xfade_rect->property_fill() = true;;
1424 start_xfade_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get();
1425 start_xfade_rect->property_outline_pixels() = 0;
1426 start_xfade_rect->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_start_xfade_event), start_xfade_rect, this));
1427 start_xfade_rect->set_data ("regionview", this);
1430 Points* points = get_canvas_points ("xfade edit redraw", npoints);
1431 boost::scoped_array<float> vec (new float[npoints]);
1433 double effective_height;
1434 if (_height >= NAME_HIGHLIGHT_THRESH) {
1435 effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
1437 effective_height = _height - 2;
1440 ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
1442 for (int i = 0, pci = 0; i < npoints; ++i) {
1443 Gnome::Art::Point &p ((*points)[pci++]);
1445 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1448 start_xfade_rect->property_x1() = ((*points)[0]).get_x();
1449 start_xfade_rect->property_y1() = 1.0;
1450 start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
1451 start_xfade_rect->property_y2() = effective_height;
1452 start_xfade_rect->show ();
1454 start_xfade_in->property_points() = *points;
1455 start_xfade_in->show ();
1456 start_xfade_in->raise_to_top ();
1460 boost::shared_ptr<AutomationList> inverse = ar->inverse_fade_in();
1464 for (int i = 0, pci = 0; i < npoints; ++i) {
1465 Gnome::Art::Point &p ((*points)[pci++]);
1467 p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
1472 inverse->curve().get_vector (0, inverse->back()->when, vec.get(), npoints);
1474 for (int i = 0, pci = 0; i < npoints; ++i) {
1475 Gnome::Art::Point &p ((*points)[pci++]);
1477 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1481 start_xfade_out->property_points() = *points;
1482 start_xfade_out->show ();
1483 start_xfade_out->raise_to_top ();
1485 start_xfade_rect->raise_to_top (); //this needs to be topmost so the lines don't steal mouse focus
1493 AudioRegionView::redraw_end_xfade ()
1495 boost::shared_ptr<AudioRegion> ar (audio_region());
1497 if (!ar->fade_out() || ar->fade_out()->empty()) {
1503 redraw_end_xfade_to (ar, ar->fade_out()->back()->when);
1507 AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t len)
1509 int32_t const npoints = trackview.editor().frame_to_pixel (len);
1515 if (!end_xfade_in) {
1516 end_xfade_in = new ArdourCanvas::Line (*group);
1517 end_xfade_in->property_width_pixels() = 1;
1518 end_xfade_in->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
1521 if (!end_xfade_out) {
1522 end_xfade_out = new ArdourCanvas::Line (*group);
1523 end_xfade_out->property_width_pixels() = 1;
1524 uint32_t col UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 128);
1525 end_xfade_out->property_fill_color_rgba() = col;
1528 if (!end_xfade_rect) {
1529 end_xfade_rect = new ArdourCanvas::SimpleRect (*group);
1530 end_xfade_rect->property_draw() = true;
1531 end_xfade_rect->property_fill() = true;;
1532 end_xfade_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get();
1533 end_xfade_rect->property_outline_pixels() = 0;
1534 end_xfade_rect->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_end_xfade_event), end_xfade_rect, this));
1535 end_xfade_rect->set_data ("regionview", this);
1538 Points* points = get_canvas_points ("xfade edit redraw", npoints);
1539 boost::scoped_array<float> vec (new float[npoints]);
1541 ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
1543 double rend = trackview.editor().frame_to_pixel (_region->length() - len);
1545 double effective_height;
1546 if (_height >= NAME_HIGHLIGHT_THRESH) {
1547 effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
1549 effective_height = _height - 2;
1552 for (int i = 0, pci = 0; i < npoints; ++i) {
1553 Gnome::Art::Point &p ((*points)[pci++]);
1555 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1558 end_xfade_rect->property_x1() = ((*points)[0]).get_x();
1559 end_xfade_rect->property_y1() = 1;
1560 end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
1561 end_xfade_rect->property_y2() = effective_height;
1562 end_xfade_rect->show ();
1564 end_xfade_in->property_points() = *points;
1565 end_xfade_in->show ();
1566 end_xfade_in->raise_to_top ();
1570 boost::shared_ptr<AutomationList> inverse = ar->inverse_fade_out ();
1574 for (int i = 0, pci = 0; i < npoints; ++i) {
1575 Gnome::Art::Point &p ((*points)[pci++]);
1577 p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
1582 inverse->curve().get_vector (inverse->front()->when, inverse->back()->when, vec.get(), npoints);
1584 for (int i = 0, pci = 0; i < npoints; ++i) {
1585 Gnome::Art::Point &p ((*points)[pci++]);
1587 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1591 end_xfade_out->property_points() = *points;
1592 end_xfade_out->show ();
1593 end_xfade_out->raise_to_top ();
1595 end_xfade_rect->raise_to_top (); //this needs to be topmost so the lines don't steal mouse focus
1603 AudioRegionView::hide_xfades ()
1605 hide_start_xfade ();
1610 AudioRegionView::hide_start_xfade ()
1612 if (start_xfade_in) {
1613 start_xfade_in->hide();
1615 if (start_xfade_out) {
1616 start_xfade_out->hide();
1618 if (start_xfade_rect) {
1619 start_xfade_rect->hide ();
1622 _start_xfade_visible = false;
1626 AudioRegionView::hide_end_xfade ()
1629 end_xfade_in->hide();
1631 if (end_xfade_out) {
1632 end_xfade_out->hide();
1634 if (end_xfade_rect) {
1635 end_xfade_rect->hide ();
1638 _end_xfade_visible = false;
1642 AudioRegionView::show_start_xfade ()
1644 if (start_xfade_in) {
1645 start_xfade_in->show();
1647 if (start_xfade_out) {
1648 start_xfade_out->show();
1650 if (start_xfade_rect) {
1651 start_xfade_rect->show ();
1654 _start_xfade_visible = true;
1658 AudioRegionView::show_end_xfade ()
1661 end_xfade_in->show();
1663 if (end_xfade_out) {
1664 end_xfade_out->show();
1666 if (end_xfade_rect) {
1667 end_xfade_rect->show ();
1670 _end_xfade_visible = true;
1674 AudioRegionView::show_xfades ()
1676 show_start_xfade ();
1681 AudioRegionView::drag_start ()
1683 TimeAxisViewItem::drag_start ();
1685 //we used to hide xfades here. I don't see the point with the new model, but we can re-implement if needed
1689 AudioRegionView::drag_end ()
1691 TimeAxisViewItem::drag_end ();
1693 //see comment for drag_start
1697 AudioRegionView::parameter_changed (string const & p)
1699 if (p == "show-waveforms") {
1700 setup_waveform_visibility ();
1701 } else if (p == "waveform-scale") {
1702 setup_waveform_scale ();
1703 } else if (p == "waveform-shape") {
1704 setup_waveform_shape ();