From 8755c7124512613f4bfa74b13887285c64146747 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 27 Aug 2007 13:00:08 +0000 Subject: [PATCH] opaque xfade patch + a version of the editor ruler/playhead/click patch git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2350 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/editor.cc | 15 +++++++++------ gtk2_ardour/editor_rulers.cc | 8 ++++---- libs/ardour/audio_playlist.cc | 4 ++++ libs/ardour/crossfade.cc | 14 ++++++++++++++ libs/ardour/playlist.cc | 2 +- 5 files changed, 32 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 0fa6ee0f34..647d62ca17 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -889,16 +889,19 @@ Editor::control_scroll (float fraction) } double step = fraction * current_page_frames(); + /* _control_scroll_target is an optional - it acts like a pointer to an nframes_t, with a operator conversion to boolean - to check that it has a value - could possibly use playhead_cursor->current_frame to store - the value and a boolean in the class to know when it's out of date + it acts like a pointer to an nframes_t, with + a operator conversion to boolean to check + that it has a value could possibly use + playhead_cursor->current_frame to store the + value and a boolean in the class to know + when it's out of date */ - if ( !_control_scroll_target ) - { + + if (!_control_scroll_target) { _control_scroll_target = session->transport_frame(); _dragging_playhead = true; } diff --git a/gtk2_ardour/editor_rulers.cc b/gtk2_ardour/editor_rulers.cc index 2370d8406c..8e658f041f 100644 --- a/gtk2_ardour/editor_rulers.cc +++ b/gtk2_ardour/editor_rulers.cc @@ -151,14 +151,14 @@ Editor::ruler_button_press (GdkEventButton* ev) switch (ev->button) { case 1: - // Since we are about to move the playhead, cancel any running + // Since we will locate the playhead on button release, cancel any running // auditions. if (session->is_auditioning()) { session->cancel_audition (); } - /* transport playhead */ + /* playhead cursor */ snap_to (where); - session->request_locate (where); + playhead_cursor->set_position (where); _dragging_playhead = true; break; @@ -202,7 +202,7 @@ Editor::ruler_button_release (GdkEventButton* ev) /* transport playhead */ _dragging_playhead = false; snap_to (where); - session->request_locate (where); + session->request_locate (where, session->transport_rolling()); break; case 2: diff --git a/libs/ardour/audio_playlist.cc b/libs/ardour/audio_playlist.cc index 1a7405dbd3..a2778276ed 100644 --- a/libs/ardour/audio_playlist.cc +++ b/libs/ardour/audio_playlist.cc @@ -380,6 +380,10 @@ AudioPlaylist::check_dependents (boost::shared_ptr r, bool norefresh) top = other; bottom = region; } + + if (!(top->opaque())) { + continue; + } diff --git a/libs/ardour/crossfade.cc b/libs/ardour/crossfade.cc index c217b76422..e1df8228ce 100644 --- a/libs/ardour/crossfade.cc +++ b/libs/ardour/crossfade.cc @@ -268,6 +268,13 @@ Crossfade::read_at (Sample *buf, Sample *mixdown_buffer, offset = start - _position; + /* Prevent data from piling up inthe crossfade buffers when reading a transparent region */ + if (!(_out->opaque())) { + memset (crossfade_buffer_out, 0, sizeof (Sample) * to_write); + } else if (!(_in->opaque())) { + memset (crossfade_buffer_in, 0, sizeof (Sample) * to_write); + } + _out->read_at (crossfade_buffer_out, mixdown_buffer, gain_buffer, start, to_write, chan_n, read_frames, skip_frames); _in->read_at (crossfade_buffer_in, mixdown_buffer, gain_buffer, start, to_write, chan_n, read_frames, skip_frames); @@ -332,6 +339,13 @@ Crossfade::refresh () return false; } + /* Top layer shouldn't be transparent */ + + if (!((layer_relation > 0 ? _in : _out)->opaque())) { + Invalidated (shared_from_this()); + return false; + } + /* layer ordering cannot change */ int32_t new_layer_relation = (int32_t) (_in->layer() - _out->layer()); diff --git a/libs/ardour/playlist.cc b/libs/ardour/playlist.cc index 807bcd23ca..b020680a0d 100644 --- a/libs/ardour/playlist.cc +++ b/libs/ardour/playlist.cc @@ -1170,7 +1170,7 @@ Playlist::region_changed (Change what_changed, boost::shared_ptr region) save = !(_splicing || _nudging); } - if ((what_changed & Region::MuteChanged) && + if ((what_changed & our_interests) && !(what_changed & Change (ARDOUR::PositionChanged|ARDOUR::LengthChanged))) { check_dependents (region, false); } -- 2.30.2