traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src/traverso/songcanvas Cursors.cpp


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src/traverso/songcanvas Cursors.cpp
Date: Sat, 01 Dec 2007 19:23:30 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/12/01 19:23:30

Modified files:
        src/traverso/songcanvas: Cursors.cpp 

Log message:
        * only apply audiobuffer latency to playhead positioning if the 
transport is rolling, and don't set a play cursor postion < 0 if the transport 
was rolling

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/songcanvas/Cursors.cpp?cvsroot=traverso&r1=1.32&r2=1.33

Patches:
Index: Cursors.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/songcanvas/Cursors.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -b -r1.32 -r1.33
--- Cursors.cpp 27 Nov 2007 13:11:56 -0000      1.32
+++ Cursors.cpp 1 Dec 2007 19:23:29 -0000       1.33
@@ -129,8 +129,15 @@
 void PlayHead::update_position()
 {
        QPointF newPos(m_song->get_transport_location() / 
m_sv->timeref_scalefactor, 1);
-       qreal playBufferTimePositionCompensation = 
audiodevice().get_buffer_latency() / m_sv->timeref_scalefactor;
-       newPos.setX(newPos.x() - playBufferTimePositionCompensation);
+       qreal playBufferTimePositionCompensation = 0;
+       if (m_song->is_transport_rolling()) {
+               playBufferTimePositionCompensation = 
audiodevice().get_buffer_latency() / m_sv->timeref_scalefactor;
+       }
+       qreal newXPos = newPos.x() - playBufferTimePositionCompensation;
+       if (newXPos < 0.0) {
+               newXPos = 0.0;
+       }
+       newPos.setX(newXPos);
        
        if (int(newPos.x()) != int(pos().x()) && (m_animation.state() != 
QTimeLine::Running)) {
                setPos(newPos);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]