opaque xfade patch + a version of the editor ruler/playhead/click patch
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 27 Aug 2007 13:00:08 +0000 (13:00 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 27 Aug 2007 13:00:08 +0000 (13:00 +0000)
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2350 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.cc
gtk2_ardour/editor_rulers.cc
libs/ardour/audio_playlist.cc
libs/ardour/crossfade.cc
libs/ardour/playlist.cc

index 0fa6ee0f34cbab59c4c7368b398e0beadda2ae65..647d62ca17d997d456eaa0a7a45effa2b01fa486 100644 (file)
@@ -889,16 +889,19 @@ Editor::control_scroll (float fraction)
        }
 
        double step = fraction * current_page_frames();
+
        /*
                _control_scroll_target is an optional<T>
        
-               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;
        }
index 2370d8406c74599d2faa99fd471729bbdaecb0a1..8e658f041f7100160b38d1b9fe4e7a46ff3cf793 100644 (file)
@@ -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:
index 1a7405dbd3daad7563aff415d040c4c93277ad5b..a2778276ed867ad658580902e1c7a6638baab272 100644 (file)
@@ -380,6 +380,10 @@ AudioPlaylist::check_dependents (boost::shared_ptr<Region> r, bool norefresh)
                        top = other;
                        bottom = region;
                }
+               
+               if (!(top->opaque())) {
+                       continue;
+               }
 
 
 
index c217b76422698e0592674284db687cbc396ae4f9..e1df8228ce4957d632b8d9b990b4a40f9361cd37 100644 (file)
@@ -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());
index 807bcd23ca66781d8e4a0e6974643136ef9c1a00..b020680a0d9af736055f8c8273d51581b9b94a4a 100644 (file)
@@ -1170,7 +1170,7 @@ Playlist::region_changed (Change what_changed, boost::shared_ptr<Region> 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);
                }