1
### jack_TOCentry - class for CDDA TOCs - part ("module") of
2
### jack - extract audio from a CD and MP3ify it using 3rd party software
3
### Copyright (C) 1999,2000 Arne Zellentin <arne@unix-ag.org>
5
### This program is free software; you can redistribute it and/or modify
6
### it under the terms of the GNU General Public License as published by
7
### the Free Software Foundation; either version 2 of the License, or
8
### (at your option) any later version.
10
### This program is distributed in the hope that it will be useful,
11
### but WITHOUT ANY WARRANTY; without even the implied warranty of
12
### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
### GNU General Public License for more details.
15
### You should have received a copy of the GNU General Public License
16
### along with this program; if not, write to the Free Software
17
### Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
entry_fields = ['type', 'copy', 'preemphasis', 'channels', 'media',
20
'filename', 'start', 'length', 'pregap']
21
compat_fields = ['number', 'length', 'start', 'copy', 'preemphasis', 'channels', 'rip', 'bitrate', 'rip_name']
25
def __init__(self, raw_dict={}):
28
self.copy = None # means no
29
self.preemphasis = None # means no
31
self.media = None # "image" or "cd"
32
self.image_name = None # only for image-reader: name of image
33
self.readable_name = None # name the file is renamed to
34
self.rip_name = None # name of file while ripping / encoding
38
self.bitrate = None # compat?#XXX
39
self.rip = None # compat
41
if raw_dict: # for compatibility: allow to read old-style track info
43
for i in compat_fields:
44
self.__dict__[i] = raw_dict[num]
50
for i in compat_fields:
51
track.append(self.__dict__[i])
54
# intercept setting of attributes
55
def __setattr__(self, name, value):
56
if name == 'pregap' and value:
57
self.__dict__['start'] = self.start + (value - self.pregap)
58
self.__dict__['length'] = self.length - (value - self.pregap)
59
self.__dict__['pregap'] = value
62
self.__dict__[name] = value
64
# for debugging purposes only.
65
def initialized(self):
67
for i in entry_fields:
68
if not self.__dict__[i]: