diff --git a/morituri/image/table.py b/morituri/image/table.py index 7967709..38da154 100644 --- a/morituri/image/table.py +++ b/morituri/image/table.py @@ -54,15 +54,17 @@ class Track: """ I represent a track entry in an Table. - @ivar number: track number (1-based) - @type number: int - @ivar audio: whether the track is audio - @type audio: bool - @type indexes: dict of number -> L{Index} - @ivar isrc: ISRC code (12 alphanumeric characters) - @type isrc: str - @ivar cdtext: dictionary of CD Text information; see L{CDTEXT_KEYS}. - @type cdtext: str -> unicode + @ivar number: track number (1-based) + @type number: int + @ivar audio: whether the track is audio + @type audio: bool + @type indexes: dict of number -> L{Index} + @ivar isrc: ISRC code (12 alphanumeric characters) + @type isrc: str + @ivar cdtext: dictionary of CD Text information; see L{CDTEXT_KEYS}. + @type cdtext: str -> unicode + @ivar pre_emphasis: whether track is pre-emphasised + @type pre_emphasis: bool """ number = None @@ -71,6 +73,7 @@ class Track: isrc = None cdtext = None session = None + pre_emphasis = None def __repr__(self): return '' % self.number @@ -618,6 +621,9 @@ class Table(object, log.Loggable): if track.isrc is not None: lines.append(" ISRC %s" % track.isrc) + if track.pre_emphasis is not None: + lines.append(" FLAGS PRE") + # handle TRACK 01 INDEX 00 specially if 0 in indexes: index00 = track.indexes[0] diff --git a/morituri/image/toc.py b/morituri/image/toc.py index c83e940..622c262 100644 --- a/morituri/image/toc.py +++ b/morituri/image/toc.py @@ -38,6 +38,9 @@ _CDTEXT_CANDIDATE_RE = re.compile(r'(?P\w+) "(?P.+)"') # header _CATALOG_RE = re.compile(r'^CATALOG "(?P\d+)"$') +# pre emphasis +_PRE_EMPHASIS_RE = re.compile(r'^PRE_EMPHASIS$') + # records _TRACK_RE = re.compile(r""" ^TRACK # TRACK @@ -251,6 +254,12 @@ class TocFile(object, log.Loggable): continue + # look for PRE_EMPHASIS lines + m = _PRE_EMPHASIS_RE.search(line) + if m: + currentTrack.pre_emphasis = True + self.debug('Track has PRE_EMPHASIS') + # look for ISRC lines m = _ISRC_RE.search(line) if m: