* morituri/image/cue.py:

* morituri/image/image.py:
	* morituri/image/table.py:
	* morituri/image/toc.py:
	* morituri/program/cdrdao.py:
	* morituri/test/test_image_cue.py:
	* morituri/test/test_image_table.py:
	  Rename ITTrack to Track.
This commit is contained in:
Thomas Vander Stichele
2009-05-16 09:29:01 +00:00
parent df2182724d
commit 09fe46ee99
8 changed files with 26 additions and 15 deletions

View File

@@ -1,3 +1,14 @@
2009-05-16 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/image/cue.py:
* morituri/image/image.py:
* morituri/image/table.py:
* morituri/image/toc.py:
* morituri/program/cdrdao.py:
* morituri/test/test_image_cue.py:
* morituri/test/test_image_table.py:
Rename ITTrack to Track.
2009-05-16 Thomas Vander Stichele <thomas at apestaart dot org>
* morituri/common/common.py:

View File

@@ -114,7 +114,7 @@ class CueFile(object, log.Loggable):
trackMode = m.group('mode')
self.debug('found track %d', trackNumber)
currentTrack = table.ITTrack(trackNumber)
currentTrack = table.Track(trackNumber)
self.table.tracks.append(currentTrack)
continue

View File

@@ -79,7 +79,7 @@ class Image(object, log.Loggable):
length = self.cue.getTrackLength(self.cue.table.tracks[i])
if length == -1:
length = verify.lengths[i + 1]
t = table.ITTrack(i + 1, audio=True)
t = table.Track(i + 1, audio=True)
tracks.append(t)
# FIXME: this probably only works for non-compliant .CUE files
# where pregap is put at end of previous file

View File

@@ -50,7 +50,7 @@ CDTEXT_FIELDS = [
]
class ITTrack:
class Track:
"""
I represent a track entry in an IndexTable.
@@ -117,12 +117,12 @@ class IndexTable(object, log.Loggable):
I represent a table of indexes on a CD.
@ivar tracks: tracks on this CD
@type tracks: list of L{ITTrack}
@type tracks: list of L{Track}
@ivar catalog: catalog number
@type catalog: str
"""
tracks = None # list of ITTrack
tracks = None # list of Track
leadout = None # offset where the leadout starts
catalog = None # catalog number; FIXME: is this UPC ?
cdtext = None

View File

@@ -142,7 +142,7 @@ class TocFile(object, log.Loggable):
pregapLength = 0
# FIXME: track mode
currentTrack = table.ITTrack(trackNumber)
currentTrack = table.Track(trackNumber)
self.table.tracks.append(currentTrack)
continue

View File

@@ -27,7 +27,7 @@ import signal
import subprocess
import tempfile
from morituri.common import task, log
from morituri.common import task, log, common
from morituri.image import toc, table
from morituri.extern import asyncsub
@@ -106,8 +106,8 @@ class OutputParser(object, log.Loggable):
if m and self._track is not None:
track = self.table.tracks[self._track - 1]
frame = (track.getIndex(1).absolute or 0) \
+ int(m.group('hh')) * 60 * 75 \
+ int(m.group('mm')) * 75 \
+ int(m.group('hh')) * 60 * common.FRAMES_PER_SECOND \
+ int(m.group('mm')) * common.FRAMES_PER_SECOND \
+ int(m.group('ss'))
self.log('at frame %d of %d', frame, self._frames)
self._task.setProgress(float(frame) / self._frames)
@@ -155,7 +155,7 @@ class OutputParser(object, log.Loggable):
m = _TRACK_RE.search(line)
if m:
self._tracks = int(m.group('track'))
track = table.ITTrack(self._tracks)
track = table.Track(self._tracks)
track.index(1, absolute=int(m.group('start')))
self.table.tracks.append(track)
self.debug('Found track %d', self._tracks)

View File

@@ -57,11 +57,11 @@ class WriteCueFileTestCase(unittest.TestCase):
it = table.IndexTable()
t = table.ITTrack(1)
t = table.Track(1)
t.index(1, path='track01.wav', relative=0, counter=1)
it.tracks.append(t)
t = table.ITTrack(2)
t = table.Track(2)
t.index(0, path='track01.wav', relative=1000, counter=1)
t.index(1, path='track02.wav', relative=0, counter=2)
it.tracks.append(t)

View File

@@ -21,8 +21,8 @@ class LadyhawkeTestCase(unittest.TestCase):
self.table = table.IndexTable()
for i in range(12):
self.table.tracks.append(table.ITTrack(i + 1, audio=True))
self.table.tracks.append(table.ITTrack(13, audio=False))
self.table.tracks.append(table.Track(i + 1, audio=True))
self.table.tracks.append(table.Track(13, audio=False))
offsets = [0, 15537, 31691, 50866, 66466, 81202, 99409,
115920, 133093, 149847, 161560, 177682, 207106]
@@ -56,7 +56,7 @@ class MusicBrainzTestCase(unittest.TestCase):
self.table = table.IndexTable()
for i in range(6):
self.table.tracks.append(table.ITTrack(i + 1, audio=True))
self.table.tracks.append(table.Track(i + 1, audio=True))
offsets = [0, 15213, 32164, 46442, 63264, 80339]
t = self.table.tracks