diff --git a/ChangeLog b/ChangeLog index f591ba8..a2b4a31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-04 Thomas Vander Stichele + + * morituri/common/common.py: + Add an argument for the delimiter in formatting. + * morituri/common/encode.py: + Most programs use peak volume, not power, so do this too. + 2009-06-04 Thomas Vander Stichele * morituri/test/common.py: diff --git a/morituri/common/common.py b/morituri/common/common.py index dac88bb..5e1c345 100644 --- a/morituri/common/common.py +++ b/morituri/common/common.py @@ -46,14 +46,14 @@ def msfToFrames(msf): return 60 * FRAMES_PER_SECOND * int(m) + FRAMES_PER_SECOND * int(s) + int(f) -def framesToMSF(frames): +def framesToMSF(frames, frameDelimiter=':'): f = frames % FRAMES_PER_SECOND frames -= f s = (frames / FRAMES_PER_SECOND) % 60 frames -= s * 60 m = frames / FRAMES_PER_SECOND / 60 - return "%02d:%02d:%02d" % (m, s, f) + return "%02d:%02d%s%02d" % (m, s, frameDelimiter, f) def framesToHMSF(frames): # cdparanoia style diff --git a/morituri/common/encode.py b/morituri/common/encode.py index c326bbd..22c6349 100644 --- a/morituri/common/encode.py +++ b/morituri/common/encode.py @@ -94,8 +94,8 @@ class EncodeTask(task.Task): I set tags too. I also calculate the peak level of the track. - @param peak: the peak power, from 0.0 to 1.0. To get the peak volume, - square root this value. + @param peak: the peak volume, from 0.0 to 1.0. This is the sqrt of the + peak power. @type peak: float """ @@ -213,4 +213,4 @@ class EncodeTask(task.Task): self.debug('set state to NULL') task.Task.stop(self) - self.peak = math.pow(10, self._peakdB / 10.0) + self.peak = math.sqrt(math.pow(10, self._peakdB / 10.0))