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>
24 #include <boost/scoped_ptr.hpp>
28 #include <gtkmm2ext/gtk_ui.h>
30 #include "ardour/playlist.h"
31 #include "ardour/audioregion.h"
32 #include "ardour/audiosource.h"
33 #include "ardour/profile.h"
34 #include "ardour/session.h"
36 #include "pbd/memento_command.h"
37 #include "pbd/stacktrace.h"
39 #include "evoral/Curve.hpp"
41 #include "streamview.h"
42 #include "audio_region_view.h"
43 #include "audio_time_axis.h"
44 #include "simplerect.h"
45 #include "simpleline.h"
47 #include "public_editor.h"
48 #include "audio_region_editor.h"
49 #include "audio_streamview.h"
50 #include "region_gain_line.h"
51 #include "control_point.h"
52 #include "ghostregion.h"
53 #include "audio_time_axis.h"
55 #include "rgb_macros.h"
56 #include "gui_thread.h"
57 #include "ardour_ui.h"
61 #define MUTED_ALPHA 10
64 using namespace ARDOUR;
66 using namespace Editing;
67 using namespace ArdourCanvas;
69 static const int32_t sync_mark_width = 9;
70 static double const handle_size = 6; /* height of fade handles */
72 AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
73 Gdk::Color const & basic_color)
74 : RegionView (parent, tv, r, spu, basic_color)
82 , start_xfade_rect (0)
83 , _start_xfade_visible (false)
87 , _end_xfade_visible (false)
88 , _amplitude_above_axis(1.0)
91 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
94 AudioRegionView::AudioRegionView (ArdourCanvas::Group *parent, RouteTimeAxisView &tv, boost::shared_ptr<AudioRegion> r, double spu,
95 Gdk::Color const & basic_color, bool recording, TimeAxisViewItem::Visibility visibility)
96 : RegionView (parent, tv, r, spu, basic_color, recording, visibility)
103 , start_xfade_out (0)
104 , start_xfade_rect (0)
105 , _start_xfade_visible (false)
109 , _end_xfade_visible (false)
110 , _amplitude_above_axis(1.0)
113 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
116 AudioRegionView::AudioRegionView (const AudioRegionView& other, boost::shared_ptr<AudioRegion> other_region)
117 : RegionView (other, boost::shared_ptr<Region> (other_region))
123 , start_xfade_out (0)
124 , start_xfade_rect (0)
125 , _start_xfade_visible (false)
129 , _end_xfade_visible (false)
130 , _amplitude_above_axis (other._amplitude_above_axis)
136 UINT_TO_RGBA (other.fill_color, &r, &g, &b, &a);
137 c.set_rgb_p (r/255.0, g/255.0, b/255.0);
141 Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&AudioRegionView::parameter_changed, this, _1), gui_context());
145 AudioRegionView::init (Gdk::Color const & basic_color, bool wfd)
147 // FIXME: Some redundancy here with RegionView::init. Need to figure out
148 // where order is important and where it isn't...
150 RegionView::init (basic_color, wfd);
152 _amplitude_above_axis = 1.0;
154 compute_colors (basic_color);
158 fade_in_shape = new ArdourCanvas::Polygon (*group);
159 fade_in_shape->property_fill_color_rgba() = fade_color;
160 fade_in_shape->set_data ("regionview", this);
162 fade_out_shape = new ArdourCanvas::Polygon (*group);
163 fade_out_shape->property_fill_color_rgba() = fade_color;
164 fade_out_shape->set_data ("regionview", this);
167 fade_in_handle = new ArdourCanvas::SimpleRect (*group);
168 fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
169 fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
171 fade_in_handle->set_data ("regionview", this);
173 fade_out_handle = new ArdourCanvas::SimpleRect (*group);
174 fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fill_color, 0);
175 fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
177 fade_out_handle->set_data ("regionview", this);
180 setup_fade_handle_positions ();
182 if (!trackview.session()->config.get_show_region_fades()) {
183 set_fade_visibility (false);
186 const string line_name = _region->name() + ":gain";
188 if (!Profile->get_sae()) {
189 gain_line.reset (new AudioRegionGainLine (line_name, *this, *group, audio_region()->envelope()));
192 update_envelope_visibility ();
195 set_height (trackview.current_height());
198 region_sync_changed ();
200 region_resized (ARDOUR::bounds_change);
201 set_waveview_data_src();
203 envelope_active_changed ();
204 fade_in_active_changed ();
205 fade_out_active_changed ();
207 reset_width_dependent_items (_pixel_width);
209 fade_in_shape->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_event), fade_in_shape, this));
210 if (fade_in_handle) {
211 fade_in_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_in_handle_event), fade_in_handle, this));
214 fade_out_shape->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_event), fade_out_shape, this));
216 if (fade_out_handle) {
217 fade_out_handle->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_fade_out_handle_event), fade_out_handle, this));
222 setup_waveform_visibility ();
223 setup_waveform_shape ();
224 setup_waveform_scale ();
226 /* XXX sync mark drag? */
229 AudioRegionView::~AudioRegionView ()
231 in_destructor = true;
233 RegionViewGoingAway (this); /* EMIT_SIGNAL */
235 for (vector<GnomeCanvasWaveViewCache *>::iterator cache = wave_caches.begin(); cache != wave_caches.end() ; ++cache) {
236 gnome_canvas_waveview_cache_destroy (*cache);
239 for (vector<ScopedConnection*>::iterator i = _data_ready_connections.begin(); i != _data_ready_connections.end(); ++i) {
243 for (list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator i = feature_lines.begin(); i != feature_lines.end(); ++i) {
244 delete ((*i).second);
247 /* all waveviews etc will be destroyed when the group is destroyed */
250 boost::shared_ptr<ARDOUR::AudioRegion>
251 AudioRegionView::audio_region() const
253 // "Guaranteed" to succeed...
254 return boost::dynamic_pointer_cast<AudioRegion>(_region);
258 AudioRegionView::region_changed (const PropertyChange& what_changed)
260 ENSURE_GUI_THREAD (*this, &AudioRegionView::region_changed, what_changed);
262 RegionView::region_changed (what_changed);
264 if (what_changed.contains (ARDOUR::Properties::scale_amplitude)) {
265 region_scale_amplitude_changed ();
267 if (what_changed.contains (ARDOUR::Properties::fade_in)) {
270 if (what_changed.contains (ARDOUR::Properties::fade_out)) {
273 if (what_changed.contains (ARDOUR::Properties::fade_in_active)) {
274 fade_in_active_changed ();
276 if (what_changed.contains (ARDOUR::Properties::fade_out_active)) {
277 fade_out_active_changed ();
279 if (what_changed.contains (ARDOUR::Properties::envelope_active)) {
280 envelope_active_changed ();
282 if (what_changed.contains (ARDOUR::Properties::valid_transients)) {
283 transients_changed ();
288 AudioRegionView::fade_in_changed ()
290 reset_fade_in_shape ();
294 AudioRegionView::fade_out_changed ()
296 reset_fade_out_shape ();
300 AudioRegionView::fade_in_active_changed ()
302 if (audio_region()->fade_in_active()) {
303 fade_in_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,90); // FIXME make a themeable colour
304 fade_in_shape->property_width_pixels() = 1;
306 fade_in_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,20); // FIXME make a themeable colour
307 fade_in_shape->property_width_pixels() = 1;
312 AudioRegionView::fade_out_active_changed ()
314 if (audio_region()->fade_out_active()) {
315 fade_out_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,90); // FIXME make a themeable colour
316 fade_out_shape->property_width_pixels() = 1;
318 fade_out_shape->property_fill_color_rgba() = RGBA_TO_UINT(45,45,45,20); // FIXME make a themeable colour
319 fade_out_shape->property_width_pixels() = 1;
325 AudioRegionView::region_scale_amplitude_changed ()
327 ENSURE_GUI_THREAD (*this, &AudioRegionView::region_scale_amplitude_changed)
329 for (uint32_t n = 0; n < waves.size(); ++n) {
330 // force a reload of the cache
331 waves[n]->property_data_src() = _region.get();
336 AudioRegionView::region_renamed ()
338 std::string str = RegionView::make_name ();
340 if (audio_region()->speed_mismatch (trackview.session()->frame_rate())) {
341 str = string ("*") + str;
344 if (_region->muted()) {
345 str = string ("!") + str;
348 set_item_name (str, this);
353 AudioRegionView::region_resized (const PropertyChange& what_changed)
355 AudioGhostRegion* agr;
357 RegionView::region_resized(what_changed);
358 PropertyChange interesting_stuff;
360 interesting_stuff.add (ARDOUR::Properties::start);
361 interesting_stuff.add (ARDOUR::Properties::length);
363 if (what_changed.contains (interesting_stuff)) {
365 for (uint32_t n = 0; n < waves.size(); ++n) {
366 waves[n]->property_region_start() = _region->start();
369 for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
370 if ((agr = dynamic_cast<AudioGhostRegion*>(*i)) != 0) {
372 for (vector<WaveView*>::iterator w = agr->waves.begin(); w != agr->waves.end(); ++w) {
373 (*w)->property_region_start() = _region->start();
378 /* hide transient lines that extend beyond the region end */
380 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
382 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
383 if (l->first > _region->length() - 1) {
393 AudioRegionView::reset_width_dependent_items (double pixel_width)
395 RegionView::reset_width_dependent_items(pixel_width);
396 assert(_pixel_width == pixel_width);
398 if (fade_in_handle) {
399 if (pixel_width <= 6.0 || _height < 5.0 || !trackview.session()->config.get_show_region_fades()) {
400 fade_in_handle->hide();
401 fade_out_handle->hide();
404 fade_in_handle->show();
405 fade_out_handle->show();
409 AnalysisFeatureList analysis_features = _region->transients();
410 AnalysisFeatureList::const_iterator i;
412 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
414 for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
416 float x_pos = trackview.editor().frame_to_pixel (*i);
418 ArdourCanvas::Points points;
419 points.push_back(Gnome::Art::Point(x_pos, 2.0)); // first x-coord needs to be a non-normal value
420 points.push_back(Gnome::Art::Point(x_pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
423 (*l).second->property_points() = points;
426 reset_fade_shapes ();
430 AudioRegionView::region_muted ()
432 RegionView::region_muted();
434 for (uint32_t n=0; n < waves.size(); ++n) {
435 if (_region->muted()) {
436 waves[n]->property_wave_color() = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA);
438 waves[n]->property_wave_color() = ARDOUR_UI::config()->canvasvar_WaveForm.get();
444 AudioRegionView::setup_fade_handle_positions()
446 /* position of fade handle offset from the top of the region view */
447 double const handle_pos = 2;
449 if (fade_in_handle) {
450 fade_in_handle->property_y1() = handle_pos;
451 fade_in_handle->property_y2() = handle_pos + handle_size;
454 if (fade_out_handle) {
455 fade_out_handle->property_y1() = handle_pos;
456 fade_out_handle->property_y2() = handle_pos + handle_size;
461 AudioRegionView::set_height (gdouble height)
463 RegionView::set_height (height);
465 uint32_t wcnt = waves.size();
467 for (uint32_t n = 0; n < wcnt; ++n) {
470 if (height < NAME_HIGHLIGHT_THRESH) {
471 ht = ((height - 2 * wcnt) / (double) wcnt);
473 ht = (((height - 2 * wcnt) - NAME_HIGHLIGHT_SIZE) / (double) wcnt);
476 gdouble yoff = n * (ht + 1);
478 waves[n]->property_height() = ht;
479 waves[n]->property_y() = yoff + 2;
484 if ((height/wcnt) < NAME_HIGHLIGHT_THRESH) {
487 update_envelope_visibility ();
490 gain_line->set_height ((uint32_t) rint (height - NAME_HIGHLIGHT_SIZE) - 2);
493 reset_fade_shapes ();
495 /* Update hights for any active feature lines */
496 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
498 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
500 float pos_x = trackview.editor().frame_to_pixel((*l).first);
502 ArdourCanvas::Points points;
504 points.push_back(Gnome::Art::Point(pos_x, 2.0)); // first x-coord needs to be a non-normal value
505 points.push_back(Gnome::Art::Point(pos_x, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
507 (*l).second->property_points() = points;
511 name_pixbuf->raise_to_top();
516 AudioRegionView::reset_fade_shapes ()
518 reset_fade_in_shape ();
519 reset_fade_out_shape ();
523 AudioRegionView::reset_fade_in_shape ()
525 reset_fade_in_shape_width (audio_region(), (framecnt_t) audio_region()->fade_in()->back()->when);
529 AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
531 if (fade_in_handle == 0) {
535 fade_in_handle->show ();
537 /* smallest size for a fade is 64 frames */
539 width = std::max ((framecnt_t) 64, width);
543 /* round here to prevent little visual glitches with sub-pixel placement */
544 double const pwidth = rint (width / samples_per_unit);
545 uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
548 double const handle_center = pwidth;
550 /* Put the fade in handle so that its left side is at the end-of-fade line */
551 fade_in_handle->property_x1() = handle_center;
552 fade_in_handle->property_x2() = handle_center + handle_size;
556 fade_in_shape->hide();
560 if (trackview.session()->config.get_show_region_fades()) {
561 fade_in_shape->show();
564 float curve[npoints];
565 audio_region()->fade_in()->curve().get_vector (0, audio_region()->fade_in()->back()->when, curve, npoints);
567 points = get_canvas_points ("fade in shape", npoints + 3);
569 if (_height >= NAME_HIGHLIGHT_THRESH) {
570 h = _height - NAME_HIGHLIGHT_SIZE - 2;
575 /* points *MUST* be in anti-clockwise order */
578 double xdelta = pwidth/npoints;
580 for (pi = 0, pc = 0; pc < npoints; ++pc) {
581 (*points)[pi].set_x(1 + (pc * xdelta));
582 (*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
587 (*points)[pi].set_x(pwidth);
588 (*points)[pi++].set_y(2);
590 (*points)[pi].set_x(1);
591 (*points)[pi++].set_y(2);
593 /* connect the dots ... */
595 (*points)[pi] = (*points)[0];
597 fade_in_shape->property_points() = *points;
600 redraw_start_xfade_to ( ar, width);
602 /* ensure trim handle stays on top */
603 if (frame_handle_start) {
604 frame_handle_start->raise_to_top();
610 AudioRegionView::reset_fade_out_shape ()
612 reset_fade_out_shape_width (audio_region(), (framecnt_t) audio_region()->fade_out()->back()->when);
616 AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar, framecnt_t width)
618 if (fade_out_handle == 0) {
622 fade_out_handle->show ();
624 /* smallest size for a fade is 64 frames */
626 width = std::max ((framecnt_t) 64, width);
630 /* round here to prevent little visual glitches with sub-pixel placement */
631 double const pwidth = rint (width / samples_per_unit);
632 uint32_t npoints = std::min (gdk_screen_width(), (int) pwidth);
635 double const handle_center = (_region->length() - width) / samples_per_unit;
637 /* Put the fade out handle so that its right side is at the end-of-fade line;
638 * it's `one out' for precise pixel accuracy.
640 fade_out_handle->property_x1() = handle_center - 5;
641 fade_out_handle->property_x2() = handle_center + 1;
643 /* don't show shape if its too small */
647 fade_out_shape->hide();
651 if (trackview.session()->config.get_show_region_fades()) {
652 fade_out_shape->show();
655 float curve[npoints];
656 audio_region()->fade_out()->curve().get_vector (0, audio_region()->fade_out()->back()->when, curve, npoints);
658 if (_height >= NAME_HIGHLIGHT_THRESH) {
659 h = _height - NAME_HIGHLIGHT_SIZE - 2;
664 /* points *MUST* be in anti-clockwise order */
666 points = get_canvas_points ("fade out shape", npoints + 3);
669 double xdelta = pwidth/npoints;
671 for (pi = 0, pc = 0; pc < npoints; ++pc) {
672 (*points)[pi].set_x(_pixel_width - pwidth + (pc * xdelta));
673 (*points)[pi++].set_y(2 + (h - (curve[pc] * h)));
678 (*points)[pi].set_x(_pixel_width);
679 (*points)[pi++].set_y(h);
681 (*points)[pi].set_x(_pixel_width);
682 (*points)[pi++].set_y(2);
684 /* connect the dots ... */
686 (*points)[pi] = (*points)[0];
688 fade_out_shape->property_points() = *points;
691 redraw_end_xfade_to (ar, width);
693 /* ensure trim handle stays on top */
694 if (frame_handle_end) {
695 frame_handle_end->raise_to_top();
701 AudioRegionView::get_fade_in_shape_width ()
703 return audio_region()->fade_in()->back()->when;
707 AudioRegionView::get_fade_out_shape_width ()
709 return audio_region()->fade_out()->back()->when;
714 AudioRegionView::set_samples_per_unit (gdouble spu)
716 RegionView::set_samples_per_unit (spu);
718 if (Config->get_show_waveforms ()) {
719 for (uint32_t n = 0; n < waves.size(); ++n) {
720 waves[n]->property_samples_per_unit() = spu;
728 reset_fade_shapes ();
732 AudioRegionView::set_amplitude_above_axis (gdouble spp)
734 for (uint32_t n=0; n < waves.size(); ++n) {
735 waves[n]->property_amplitude_above_axis() = spp;
740 AudioRegionView::compute_colors (Gdk::Color const & basic_color)
742 RegionView::compute_colors (basic_color);
744 /* gain color computed in envelope_active_changed() */
746 fade_color = UINT_RGBA_CHANGE_A (fill_color, 120);
750 AudioRegionView::set_colors ()
752 RegionView::set_colors();
755 gain_line->set_line_color (audio_region()->envelope_active() ? ARDOUR_UI::config()->canvasvar_GainLine.get() : ARDOUR_UI::config()->canvasvar_GainLineInactive.get());
758 for (uint32_t n=0; n < waves.size(); ++n) {
759 if (_region->muted()) {
760 waves[n]->property_wave_color() = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA);
762 waves[n]->property_wave_color() = ARDOUR_UI::config()->canvasvar_WaveForm.get();
765 waves[n]->property_clip_color() = ARDOUR_UI::config()->canvasvar_WaveFormClip.get();
766 waves[n]->property_zero_color() = ARDOUR_UI::config()->canvasvar_ZeroLine.get();
771 AudioRegionView::setup_waveform_visibility ()
773 if (Config->get_show_waveforms ()) {
774 for (uint32_t n = 0; n < waves.size(); ++n) {
775 /* make sure the zoom level is correct, since we don't update
776 this when waveforms are hidden.
778 waves[n]->property_samples_per_unit() = samples_per_unit;
782 for (uint32_t n = 0; n < waves.size(); ++n) {
789 AudioRegionView::temporarily_hide_envelope ()
797 AudioRegionView::unhide_envelope ()
799 update_envelope_visibility ();
803 AudioRegionView::update_envelope_visibility ()
809 if (Config->get_show_region_gain() || trackview.editor().current_mouse_mode() == Editing::MouseGain) {
810 gain_line->add_visibility (AutomationLine::Line);
817 AudioRegionView::create_waves ()
819 // cerr << "AudioRegionView::create_waves() called on " << this << endl;//DEBUG
820 RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
826 ChanCount nchans = atv.track()->n_channels();
828 // cerr << "creating waves for " << _region->name() << " with wfd = " << wait_for_data
829 // << " and channels = " << nchans.n_audio() << endl;
831 /* in tmp_waves, set up null pointers for each channel so the vector is allocated */
832 for (uint32_t n = 0; n < nchans.n_audio(); ++n) {
833 tmp_waves.push_back (0);
836 for (vector<ScopedConnection*>::iterator i = _data_ready_connections.begin(); i != _data_ready_connections.end(); ++i) {
840 _data_ready_connections.clear ();
842 for (uint32_t i = 0; i < nchans.n_audio(); ++i) {
843 _data_ready_connections.push_back (0);
846 for (uint32_t n = 0; n < nchans.n_audio(); ++n) {
848 if (n >= audio_region()->n_channels()) {
852 wave_caches.push_back (WaveView::create_cache ());
854 // cerr << "\tchannel " << n << endl;
857 if (audio_region()->audio_source(n)->peaks_ready (boost::bind (&AudioRegionView::peaks_ready_handler, this, n), &_data_ready_connections[n], gui_context())) {
858 // cerr << "\tData is ready\n";
859 create_one_wave (n, true);
861 // cerr << "\tdata is not ready\n";
862 // we'll get a PeaksReady signal from the source in the future
863 // and will call create_one_wave(n) then.
867 // cerr << "\tdon't delay, display today!\n";
868 create_one_wave (n, true);
875 AudioRegionView::create_one_wave (uint32_t which, bool /*direct*/)
877 //cerr << "AudioRegionView::create_one_wave() called which: " << which << " this: " << this << endl;//DEBUG
878 RouteTimeAxisView& atv (*(dynamic_cast<RouteTimeAxisView*>(&trackview))); // ick
879 uint32_t nchans = atv.track()->n_channels().n_audio();
881 uint32_t nwaves = std::min (nchans, audio_region()->n_channels());
884 if (trackview.current_height() < NAME_HIGHLIGHT_THRESH) {
885 ht = ((trackview.current_height()) / (double) nchans);
887 ht = ((trackview.current_height() - NAME_HIGHLIGHT_SIZE) / (double) nchans);
890 gdouble yoff = which * ht;
892 WaveView *wave = new WaveView(*group);
894 wave->property_data_src() = (gpointer) _region.get();
895 wave->property_cache() = wave_caches[which];
896 wave->property_cache_updater() = true;
897 wave->property_channel() = which;
898 wave->property_length_function() = (gpointer) region_length_from_c;
899 wave->property_sourcefile_length_function() = (gpointer) sourcefile_length_from_c;
900 wave->property_peak_function() = (gpointer) region_read_peaks_from_c;
901 wave->property_x() = 0.0;
902 wave->property_y() = yoff;
903 wave->property_height() = (double) ht;
904 wave->property_samples_per_unit() = samples_per_unit;
905 wave->property_amplitude_above_axis() = _amplitude_above_axis;
908 wave->property_wave_color() = _region->muted() ? UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_RecWaveForm.get(), MUTED_ALPHA) : ARDOUR_UI::config()->canvasvar_RecWaveForm.get();
909 wave->property_fill_color() = ARDOUR_UI::config()->canvasvar_RecWaveFormFill.get();
911 wave->property_wave_color() = _region->muted() ? UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA) : ARDOUR_UI::config()->canvasvar_WaveForm.get();
912 wave->property_fill_color() = ARDOUR_UI::config()->canvasvar_WaveFormFill.get();
915 wave->property_clip_color() = ARDOUR_UI::config()->canvasvar_WaveFormClip.get();
916 wave->property_zero_color() = ARDOUR_UI::config()->canvasvar_ZeroLine.get();
917 wave->property_zero_line() = true;
918 wave->property_region_start() = _region->start();
919 wave->property_rectified() = Config->get_waveform_shape() == Rectified;
920 wave->property_logscaled() = Config->get_waveform_scale() == Logarithmic;
922 if (!Config->get_show_waveforms ()) {
926 /* note: calling this function is serialized by the lock
927 held in the peak building thread that signals that
928 peaks are ready for use *or* by the fact that it is
929 called one by one from the GUI thread.
932 if (which < nchans) {
933 tmp_waves[which] = wave;
935 /* n-channel track, >n-channel source */
938 /* see if we're all ready */
940 for (n = 0; n < nchans; ++n) {
941 if (tmp_waves[n] == 0) {
946 if (n == nwaves && waves.empty()) {
947 /* all waves are ready */
948 tmp_waves.resize(nwaves);
953 /* all waves created, don't hook into peaks ready anymore */
954 delete _data_ready_connections[which];
955 _data_ready_connections[which] = 0;
960 AudioRegionView::peaks_ready_handler (uint32_t which)
962 Gtkmm2ext::UI::instance()->call_slot (invalidator (*this), boost::bind (&AudioRegionView::create_one_wave, this, which, false));
963 // cerr << "AudioRegionView::peaks_ready_handler() called on " << which << " this: " << this << endl;
967 AudioRegionView::add_gain_point_event (ArdourCanvas::Item *item, GdkEvent *ev)
975 /* don't create points that can't be seen */
977 update_envelope_visibility ();
984 framepos_t fx = trackview.editor().pixel_to_frame (x);
986 if (fx > _region->length()) {
990 /* compute vertical fractional position */
992 y = 1.0 - (y / (_height - NAME_HIGHLIGHT_SIZE));
994 /* map using gain line */
996 gain_line->view_to_model_coord (x, y);
998 /* XXX STATEFUL: can't convert to stateful diff until we
999 can represent automation data with it.
1002 trackview.session()->begin_reversible_command (_("add gain control point"));
1003 XMLNode &before = audio_region()->envelope()->get_state();
1005 if (!audio_region()->envelope_active()) {
1006 XMLNode ®ion_before = audio_region()->get_state();
1007 audio_region()->set_envelope_active(true);
1008 XMLNode ®ion_after = audio_region()->get_state();
1009 trackview.session()->add_command (new MementoCommand<AudioRegion>(*(audio_region().get()), ®ion_before, ®ion_after));
1012 audio_region()->envelope()->add (fx, y);
1014 XMLNode &after = audio_region()->envelope()->get_state();
1015 trackview.session()->add_command (new MementoCommand<AutomationList>(*audio_region()->envelope().get(), &before, &after));
1016 trackview.session()->commit_reversible_command ();
1020 AudioRegionView::remove_gain_point_event (ArdourCanvas::Item *item, GdkEvent */*ev*/)
1022 ControlPoint *cp = reinterpret_cast<ControlPoint *> (item->get_data ("control_point"));
1023 audio_region()->envelope()->erase (cp->model());
1027 AudioRegionView::setup_waveform_shape ()
1029 for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
1030 (*wave)->property_rectified() = Config->get_waveform_shape() == Rectified;
1035 AudioRegionView::setup_waveform_scale ()
1037 for (vector<WaveView *>::iterator wave = waves.begin(); wave != waves.end() ; ++wave) {
1038 (*wave)->property_logscaled() = Config->get_waveform_scale() == Logarithmic;
1044 AudioRegionView::add_ghost (TimeAxisView& tv)
1046 RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*>(&trackview);
1049 double unit_position = _region->position () / samples_per_unit;
1050 AudioGhostRegion* ghost = new AudioGhostRegion (tv, trackview, unit_position);
1053 nchans = rtv->track()->n_channels().n_audio();
1055 for (uint32_t n = 0; n < nchans; ++n) {
1057 if (n >= audio_region()->n_channels()) {
1061 WaveView *wave = new WaveView(*ghost->group);
1063 wave->property_data_src() = _region.get();
1064 wave->property_cache() = wave_caches[n];
1065 wave->property_cache_updater() = false;
1066 wave->property_channel() = n;
1067 wave->property_length_function() = (gpointer)region_length_from_c;
1068 wave->property_sourcefile_length_function() = (gpointer) sourcefile_length_from_c;
1069 wave->property_peak_function() = (gpointer) region_read_peaks_from_c;
1070 wave->property_x() = 0.0;
1071 wave->property_samples_per_unit() = samples_per_unit;
1072 wave->property_amplitude_above_axis() = _amplitude_above_axis;
1074 wave->property_region_start() = _region->start();
1076 ghost->waves.push_back(wave);
1079 ghost->set_height ();
1080 ghost->set_duration (_region->length() / samples_per_unit);
1081 ghost->set_colors();
1082 ghosts.push_back (ghost);
1088 AudioRegionView::entered (bool internal_editing)
1090 trackview.editor().set_current_trimmable (_region);
1091 trackview.editor().set_current_movable (_region);
1093 if (gain_line && trackview.editor().current_mouse_mode() == Editing::MouseGain) {
1094 gain_line->add_visibility (AutomationLine::ControlPoints);
1097 if (fade_in_handle && !internal_editing) {
1098 fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 255);
1099 fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
1100 fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 255);
1101 fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 255);
1106 AudioRegionView::exited ()
1108 trackview.editor().set_current_trimmable (boost::shared_ptr<Trimmable>());
1109 trackview.editor().set_current_movable (boost::shared_ptr<Movable>());
1111 if (gain_line && trackview.editor().current_mouse_mode() == Editing::MouseGain) {
1112 gain_line->remove_visibility (AutomationLine::ControlPoints);
1115 if (fade_in_handle) {
1116 fade_in_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
1117 fade_in_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
1118 fade_out_handle->property_outline_color_rgba() = RGBA_TO_UINT (0, 0, 0, 0);
1119 fade_out_handle->property_fill_color_rgba() = UINT_RGBA_CHANGE_A (fade_color, 0);
1124 AudioRegionView::envelope_active_changed ()
1127 gain_line->set_line_color (audio_region()->envelope_active() ? ARDOUR_UI::config()->canvasvar_GainLine.get() : ARDOUR_UI::config()->canvasvar_GainLineInactive.get());
1132 AudioRegionView::set_waveview_data_src()
1134 AudioGhostRegion* agr;
1135 double unit_length= _region->length() / samples_per_unit;
1137 for (uint32_t n = 0; n < waves.size(); ++n) {
1138 // TODO: something else to let it know the channel
1139 waves[n]->property_data_src() = _region.get();
1142 for (vector<GhostRegion*>::iterator i = ghosts.begin(); i != ghosts.end(); ++i) {
1144 (*i)->set_duration (unit_length);
1146 if((agr = dynamic_cast<AudioGhostRegion*>(*i)) != 0) {
1147 for (vector<WaveView*>::iterator w = agr->waves.begin(); w != agr->waves.end(); ++w) {
1148 (*w)->property_data_src() = _region.get();
1156 AudioRegionView::color_handler ()
1158 //case cMutedWaveForm:
1160 //case cWaveFormClip:
1164 //case cGainLineInactive:
1166 envelope_active_changed();
1171 AudioRegionView::set_frame_color ()
1177 if (_region->opaque()) {
1183 TimeAxisViewItem::set_frame_color ();
1189 if (_region->muted()) {
1190 wc = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_SelectedWaveForm.get(), MUTED_ALPHA);
1192 wc = ARDOUR_UI::config()->canvasvar_SelectedWaveForm.get();
1194 fc = ARDOUR_UI::config()->canvasvar_SelectedWaveFormFill.get();
1197 if (_region->muted()) {
1198 wc = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_RecWaveForm.get(), MUTED_ALPHA);
1200 wc = ARDOUR_UI::config()->canvasvar_RecWaveForm.get();
1202 fc = ARDOUR_UI::config()->canvasvar_RecWaveFormFill.get();
1204 if (_region->muted()) {
1205 wc = UINT_RGBA_CHANGE_A(ARDOUR_UI::config()->canvasvar_WaveForm.get(), MUTED_ALPHA);
1207 wc = ARDOUR_UI::config()->canvasvar_WaveForm.get();
1209 fc = ARDOUR_UI::config()->canvasvar_WaveFormFill.get();
1213 for (vector<ArdourCanvas::WaveView*>::iterator w = waves.begin(); w != waves.end(); ++w) {
1214 if (_region->muted()) {
1215 (*w)->property_wave_color() = wc;
1217 (*w)->property_wave_color() = wc;
1218 (*w)->property_fill_color() = fc;
1224 AudioRegionView::set_fade_visibility (bool yn)
1227 if (fade_in_shape) {
1228 fade_in_shape->show();
1230 if (fade_out_shape) {
1231 fade_out_shape->show ();
1233 if (fade_in_handle) {
1234 fade_in_handle->show ();
1236 if (fade_out_handle) {
1237 fade_out_handle->show ();
1240 if (fade_in_shape) {
1241 fade_in_shape->hide();
1243 if (fade_out_shape) {
1244 fade_out_shape->hide ();
1246 if (fade_in_handle) {
1247 fade_in_handle->hide ();
1249 if (fade_out_handle) {
1250 fade_out_handle->hide ();
1256 AudioRegionView::update_coverage_frames (LayerDisplay d)
1258 RegionView::update_coverage_frames (d);
1260 if (fade_in_handle) {
1261 fade_in_handle->raise_to_top ();
1262 fade_out_handle->raise_to_top ();
1267 AudioRegionView::show_region_editor ()
1270 editor = new AudioRegionEditor (trackview.session(), audio_region());
1274 editor->set_position (Gtk::WIN_POS_MOUSE);
1279 AudioRegionView::transients_changed ()
1281 AnalysisFeatureList analysis_features = _region->transients();
1283 while (feature_lines.size() < analysis_features.size()) {
1285 ArdourCanvas::Line* canvas_item = new ArdourCanvas::Line(*group);
1287 ArdourCanvas::Points points;
1289 points.push_back(Gnome::Art::Point(-1.0, 2.0)); // first x-coord needs to be a non-normal value
1290 points.push_back(Gnome::Art::Point(1.0, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
1292 canvas_item->property_points() = points;
1293 canvas_item->property_width_pixels() = 1;
1294 canvas_item->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ZeroLine.get();
1295 canvas_item->property_first_arrowhead() = TRUE;
1296 canvas_item->property_last_arrowhead() = TRUE;
1297 canvas_item->property_arrow_shape_a() = 11.0;
1298 canvas_item->property_arrow_shape_b() = 0.0;
1299 canvas_item->property_arrow_shape_c() = 4.0;
1301 canvas_item->raise_to_top ();
1302 canvas_item->show ();
1304 canvas_item->set_data ("regionview", this);
1305 canvas_item->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_feature_line_event), canvas_item, this));
1307 feature_lines.push_back (make_pair(0, canvas_item));
1310 while (feature_lines.size() > analysis_features.size()) {
1311 ArdourCanvas::Line* line = feature_lines.back().second;
1312 feature_lines.pop_back ();
1316 AnalysisFeatureList::const_iterator i;
1317 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
1319 for (i = analysis_features.begin(), l = feature_lines.begin(); i != analysis_features.end() && l != feature_lines.end(); ++i, ++l) {
1321 ArdourCanvas::Points points;
1323 float *pos = new float;
1324 *pos = trackview.editor().frame_to_pixel (*i);
1326 points.push_back(Gnome::Art::Point(*pos, 2.0)); // first x-coord needs to be a non-normal value
1327 points.push_back(Gnome::Art::Point(*pos, _height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 1));
1329 (*l).second->property_points() = points;
1330 (*l).second->set_data ("position", pos);
1337 AudioRegionView::update_transient(float /*old_pos*/, float new_pos)
1339 /* Find frame at old pos, calulate new frame then update region transients*/
1340 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
1342 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
1344 /* Line has been updated in drag so we compare to new_pos */
1346 float* pos = (float*) (*l).second->get_data ("position");
1348 if (rint(new_pos) == rint(*pos)) {
1350 framepos_t old_frame = (*l).first;
1351 framepos_t new_frame = trackview.editor().pixel_to_frame (new_pos);
1353 _region->update_transient (old_frame, new_frame);
1361 AudioRegionView::remove_transient(float pos)
1363 /* Find frame at old pos, calulate new frame then update region transients*/
1364 list<std::pair<framepos_t, ArdourCanvas::Line*> >::iterator l;
1366 for (l = feature_lines.begin(); l != feature_lines.end(); ++l) {
1368 /* Line has been updated in drag so we compare to new_pos */
1369 float *line_pos = (float*) (*l).second->get_data ("position");
1371 if (rint(pos) == rint(*line_pos)) {
1372 _region->remove_transient ((*l).first);
1379 AudioRegionView::thaw_after_trim ()
1381 RegionView::thaw_after_trim ();
1387 AudioRegionView::redraw_start_xfade ()
1389 boost::shared_ptr<AudioRegion> ar (audio_region());
1391 if (!ar->fade_in() || ar->fade_in()->empty()) {
1397 redraw_start_xfade_to (ar, ar->fade_in()->back()->when);
1401 AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t len)
1403 int32_t const npoints = trackview.editor().frame_to_pixel (len);
1409 if (!start_xfade_in) {
1410 start_xfade_in = new ArdourCanvas::Line (*group);
1411 start_xfade_in->property_width_pixels() = 1;
1412 start_xfade_in->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
1415 if (!start_xfade_out) {
1416 start_xfade_out = new ArdourCanvas::Line (*group);
1417 start_xfade_out->property_width_pixels() = 1;
1418 uint32_t col = UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 128);
1419 start_xfade_out->property_fill_color_rgba() = col;
1422 if (!start_xfade_rect) {
1423 start_xfade_rect = new ArdourCanvas::SimpleRect (*group);
1424 start_xfade_rect->property_draw() = true;
1425 start_xfade_rect->property_fill() = true;;
1426 start_xfade_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get();
1427 start_xfade_rect->property_outline_pixels() = 0;
1428 start_xfade_rect->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_start_xfade_event), start_xfade_rect, this));
1429 start_xfade_rect->set_data ("regionview", this);
1432 Points* points = get_canvas_points ("xfade edit redraw", npoints);
1433 boost::scoped_array<float> vec (new float[npoints]);
1435 double effective_height;
1436 if (_height >= NAME_HIGHLIGHT_THRESH) {
1437 effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
1439 effective_height = _height - 2;
1442 ar->fade_in()->curve().get_vector (0, ar->fade_in()->back()->when, vec.get(), npoints);
1444 for (int i = 0, pci = 0; i < npoints; ++i) {
1445 Gnome::Art::Point &p ((*points)[pci++]);
1447 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1450 start_xfade_rect->property_x1() = ((*points)[0]).get_x();
1451 start_xfade_rect->property_y1() = 1.0;
1452 start_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
1453 start_xfade_rect->property_y2() = effective_height;
1454 start_xfade_rect->show ();
1456 start_xfade_in->property_points() = *points;
1457 start_xfade_in->show ();
1458 start_xfade_in->raise_to_top ();
1462 boost::shared_ptr<AutomationList> inverse = ar->inverse_fade_in();
1466 for (int i = 0, pci = 0; i < npoints; ++i) {
1467 Gnome::Art::Point &p ((*points)[pci++]);
1469 p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
1474 inverse->curve().get_vector (0, inverse->back()->when, vec.get(), npoints);
1476 for (int i = 0, pci = 0; i < npoints; ++i) {
1477 Gnome::Art::Point &p ((*points)[pci++]);
1479 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1483 start_xfade_out->property_points() = *points;
1484 start_xfade_out->show ();
1485 start_xfade_out->raise_to_top ();
1487 start_xfade_rect->raise_to_top (); //this needs to be topmost so the lines don't steal mouse focus
1495 AudioRegionView::redraw_end_xfade ()
1497 boost::shared_ptr<AudioRegion> ar (audio_region());
1499 if (!ar->fade_out() || ar->fade_out()->empty()) {
1505 redraw_end_xfade_to (ar, ar->fade_out()->back()->when);
1509 AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecnt_t len)
1511 int32_t const npoints = trackview.editor().frame_to_pixel (len);
1517 if (!end_xfade_in) {
1518 end_xfade_in = new ArdourCanvas::Line (*group);
1519 end_xfade_in->property_width_pixels() = 1;
1520 end_xfade_in->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_GainLine.get();
1523 if (!end_xfade_out) {
1524 end_xfade_out = new ArdourCanvas::Line (*group);
1525 end_xfade_out->property_width_pixels() = 1;
1526 uint32_t col UINT_RGBA_CHANGE_A (ARDOUR_UI::config()->canvasvar_GainLine.get(), 128);
1527 end_xfade_out->property_fill_color_rgba() = col;
1530 if (!end_xfade_rect) {
1531 end_xfade_rect = new ArdourCanvas::SimpleRect (*group);
1532 end_xfade_rect->property_draw() = true;
1533 end_xfade_rect->property_fill() = true;;
1534 end_xfade_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_ActiveCrossfade.get();
1535 end_xfade_rect->property_outline_pixels() = 0;
1536 end_xfade_rect->signal_event().connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_end_xfade_event), end_xfade_rect, this));
1537 end_xfade_rect->set_data ("regionview", this);
1540 Points* points = get_canvas_points ("xfade edit redraw", npoints);
1541 boost::scoped_ptr<float> vec (new float[npoints]);
1543 ar->fade_out()->curve().get_vector (0, ar->fade_out()->back()->when, vec.get(), npoints);
1545 double rend = trackview.editor().frame_to_pixel (_region->length() - len);
1547 double effective_height;
1548 if (_height >= NAME_HIGHLIGHT_THRESH) {
1549 effective_height = _height - NAME_HIGHLIGHT_SIZE - 2;
1551 effective_height = _height - 2;
1554 for (int i = 0, pci = 0; i < npoints; ++i) {
1555 Gnome::Art::Point &p ((*points)[pci++]);
1557 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1560 end_xfade_rect->property_x1() = ((*points)[0]).get_x();
1561 end_xfade_rect->property_y1() = 1;
1562 end_xfade_rect->property_x2() = ((*points)[npoints-1]).get_x();
1563 end_xfade_rect->property_y2() = effective_height;
1564 end_xfade_rect->show ();
1566 end_xfade_in->property_points() = *points;
1567 end_xfade_in->show ();
1568 end_xfade_in->raise_to_top ();
1572 boost::shared_ptr<AutomationList> inverse = ar->inverse_fade_out ();
1576 for (int i = 0, pci = 0; i < npoints; ++i) {
1577 Gnome::Art::Point &p ((*points)[pci++]);
1579 p.set_y (1.0 + effective_height - (effective_height * (1.0 - vec.get()[i])));
1584 inverse->curve().get_vector (inverse->front()->when, inverse->back()->when, vec.get(), npoints);
1586 for (int i = 0, pci = 0; i < npoints; ++i) {
1587 Gnome::Art::Point &p ((*points)[pci++]);
1589 p.set_y (1.0 + effective_height - (effective_height * vec.get()[i]));
1593 end_xfade_out->property_points() = *points;
1594 end_xfade_out->show ();
1595 end_xfade_out->raise_to_top ();
1597 end_xfade_rect->raise_to_top (); //this needs to be topmost so the lines don't steal mouse focus
1605 AudioRegionView::hide_xfades ()
1607 hide_start_xfade ();
1612 AudioRegionView::hide_start_xfade ()
1614 if (start_xfade_in) {
1615 start_xfade_in->hide();
1617 if (start_xfade_out) {
1618 start_xfade_out->hide();
1620 if (start_xfade_rect) {
1621 start_xfade_rect->hide ();
1624 _start_xfade_visible = false;
1628 AudioRegionView::hide_end_xfade ()
1631 end_xfade_in->hide();
1633 if (end_xfade_out) {
1634 end_xfade_out->hide();
1636 if (end_xfade_rect) {
1637 end_xfade_rect->hide ();
1640 _end_xfade_visible = false;
1644 AudioRegionView::show_start_xfade ()
1646 if (start_xfade_in) {
1647 start_xfade_in->show();
1649 if (start_xfade_out) {
1650 start_xfade_out->show();
1652 if (start_xfade_rect) {
1653 start_xfade_rect->show ();
1656 _start_xfade_visible = true;
1660 AudioRegionView::show_end_xfade ()
1663 end_xfade_in->show();
1665 if (end_xfade_out) {
1666 end_xfade_out->show();
1668 if (end_xfade_rect) {
1669 end_xfade_rect->show ();
1672 _end_xfade_visible = true;
1676 AudioRegionView::show_xfades ()
1678 show_start_xfade ();
1683 AudioRegionView::drag_start ()
1685 TimeAxisViewItem::drag_start ();
1687 //we used to hide xfades here. I don't see the point with the new model, but we can re-implement if needed
1691 AudioRegionView::drag_end ()
1693 TimeAxisViewItem::drag_end ();
1695 //see comment for drag_start
1699 AudioRegionView::parameter_changed (string const & p)
1701 if (p == "show-waveforms") {
1702 setup_waveform_visibility ();
1703 } else if (p == "waveform-scale") {
1704 setup_waveform_scale ();
1705 } else if (p == "waveform-shape") {
1706 setup_waveform_shape ();