# -*- Mode: Python; test-case-name: whipper.test.test_image_table -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of whipper.
#
# whipper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# whipper is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with whipper. If not, see .
"""
Wrap Table of Contents.
"""
import copy
import urllib
import urlparse
import whipper
from whipper.common import common, config
from whipper.extern.freedb import DiscID
import logging
logger = logging.getLogger(__name__)
# FIXME: taken from libcdio, but no reference found for these
CDTEXT_FIELDS = [
'ARRANGER',
'COMPOSER',
'DISCID',
'GENRE',
'MESSAGE',
'ISRC',
'PERFORMER',
'SIZE_INFO',
'SONGWRITER',
'TITLE',
'TOC_INFO',
'TOC_INFO2',
'UPC_EAN',
]
class Track:
"""
I represent a track entry in an Table.
:cvar number: track number (1-based)
:vartype number: int
:cvar audio: whether the track is audio
:vartype audio: bool
:vartype indexes: dict of number -> :any:`Index`
:cvar isrc: ISRC code (12 alphanumeric characters)
:vartype isrc: str
:cvar cdtext: dictionary of CD Text information;
:any:`see CDTEXT_KEYS`
:vartype cdtext: str -> unicode
:cvar pre_emphasis: whether track is pre-emphasised
:vartype pre_emphasis: bool
"""
number = None
audio = None
indexes = None
isrc = None
cdtext = None
session = None
pre_emphasis = None
def __repr__(self):
return '