|
From: Tapio V. <aa...@us...> - 2011-02-24 08:32:42
|
Author: Tapio Vierros <tap...@gm...>
Date: Thu Feb 24 10:31:13 2011 +0200
Guard playbackTimer killing to avoid runtime warnings on Windows.
---
notegraphwidget.cc | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index 6349ba4..47cc182 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -287,16 +287,17 @@ void NoteGraphWidget::updateMusicPos(qint64 time, bool smoothing)
{
m_playbackPos = time;
int x = s2px(m_playbackPos / 1000.0) - m_seekHandle.width() / 2;
- killTimer(m_playbackTimer);
+ if (m_playbackTimer) killTimer(m_playbackTimer);
m_seekHandle.move(x, 0);
- if (smoothing)
- m_playbackTimer = startTimer(20); // Hope for 50 fps
+ if (smoothing) m_playbackTimer = startTimer(20); // Hope for 50 fps
+ else m_playbackTimer = 0;
m_playbackInterval.restart();
}
void NoteGraphWidget::stopMusic()
{
- killTimer(m_playbackTimer);
+ if (m_playbackTimer) killTimer(m_playbackTimer);
+ m_playbackTimer = 0;
}
void NoteGraphWidget::seek(int x)
|