From 85ff56c935ba45bea70e1018434efb62b4b5833f Mon Sep 17 00:00:00 2001 From: nhydock Date: Sat, 10 Jul 2010 13:26:42 -0400 Subject: [PATCH] I felt progress needed an explaination of the variable since it's the only one whose name is somewhat confusing. Also closed the progress variable to between 0 and 1 so then it doesn't also included the beginning countdown. --- src/Rockmeter.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Rockmeter.py b/src/Rockmeter.py index ed5100178..cb8418bb0 100644 --- a/src/Rockmeter.py +++ b/src/Rockmeter.py @@ -69,7 +69,8 @@ secondsSongLength = 0 position = 0 countdownPosition = 1 -progress = 0.0 +progress = 0.0 #this gives a percentage (between 0 and 1) + #of how far the song has played # A graphical rockmeter layer # This is the base template for all rockmeter layer types @@ -330,6 +331,10 @@ def updateTime(self): position = scene.getSongPosition() countdownPosition = songLength - position progress = float(position)/float(songLength) + if progress < 0: + progress = 0 + elif progress > 1: + progress = 1 minutesCountdown, secondsCountdown = (countdownPosition / 60000, (countdownPosition % 60000) / 1000) minutes, seconds = (position / 60000, (position % 60000) / 1000)