Skip to content

Commit

Permalink
I felt progress needed an explaination of the variable since it's the…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
erodozer committed Jul 10, 2010
1 parent 5b8134c commit 85ff56c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Rockmeter.py
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 85ff56c

Please sign in to comment.