From 65dc18eee31c8fea7c40cd5afcda91325003012b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nino=20Mi=C5=A1ki=C4=87-Pletenac?= Date: Wed, 27 Mar 2019 02:50:00 +0100 Subject: CueControl: Fix computation of end position for intro/outro cues --- src/track/cue.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/track/cue.cpp') diff --git a/src/track/cue.cpp b/src/track/cue.cpp index 347458ae06..0376b80854 100644 --- a/src/track/cue.cpp +++ b/src/track/cue.cpp @@ -176,6 +176,17 @@ void Cue::setDirty(bool dirty) { m_bDirty = dirty; } +double Cue::getEndPosition() const { + QMutexLocker lock(&m_mutex); + if (m_samplePosition == -1.0) { + return m_length; + } else if (m_length == 0.0) { + return -1.0; + } else { + return m_samplePosition + m_length; + } +} + bool operator==(const CuePosition& lhs, const CuePosition& rhs) { return lhs.getPosition() == rhs.getPosition() && lhs.getSource() == rhs.getSource(); -- cgit v1.2.3