From 5b449171d1a666cad0ef59723bc4c59779a73724 Mon Sep 17 00:00:00 2001 From: Paul Giblock Date: Sat, 13 Sep 2008 16:56:37 +0000 Subject: [PATCH] Keep timeline loop points from being equal git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@1603 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 5 +++++ src/core/timeline.cpp | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 94e4e5d4f..3a83248f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-08 Paul Giblock + + * src/core/timeline.cpp: + Keep loop markers from being in same position + 2008-09-11 Tobias Doerffel * include/audio_port.h: diff --git a/src/core/timeline.cpp b/src/core/timeline.cpp index 6d8c052e7..5633ab4f3 100644 --- a/src/core/timeline.cpp +++ b/src/core/timeline.cpp @@ -350,6 +350,17 @@ void timeLine::mouseMoveEvent( QMouseEvent * _me ) { m_loopPos[i] = t.toNearestTact(); } + // Catch begin == end + if( m_loopPos[0] == m_loopPos[1] ) + { + // Note, swap 1 and 0 below and the behavior "skips" the other + // marking instead of pushing it. However, I think pushing the + // other marker makes more sense it keeps the markers in order + if( m_action == MoveLoopBegin ) + m_loopPos[1] += midiTime::ticksPerTact(); + else + m_loopPos[0] -= midiTime::ticksPerTact(); + } update(); break; }