# Path: external/metadata/core.py
# class ParseError(Exception):
#     pass
# 
# class Collection(Media):
#     """
#     Collection of Digial Media like CD, DVD, Directory, Playlist
#     """
#     _keys = Media._keys + [ 'id', 'tracks' ]
# 
#     def __init__(self):
#         Media.__init__(self)
#         self.tracks = []
# 
# MEDIA_DISC      = 'MEDIA_DISC'
# 
# Path: external/metadata/video/core.py
# class VideoStream(Media):
#     """
#     Video Tracks in a Multiplexed Container.
#     """
#     _keys = Media._keys + VIDEOCORE
#     media = MEDIA_VIDEO


import logging
from ..core import ParseError, Collection, MEDIA_DISC
from ..video.core import VideoStream
from . import cdrom
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------------

# python imports

# kaa imports

# extra cdrom parser

# get logging object
log = logging.getLogger('metadata')

class Disc(Collection):

    _keys = Collection._keys + [ 'mixed', 'label' ]
    media = MEDIA_DISC

    def is_disc(self, device):
        (type, self.id) = cdrom.status(device, handle_mix=1)
        if type != 2:
            if type == 4:
                self.mixed = 1
                type = 1
            return type

        if cdrom.CREATE_MD5_ID:

# Path: external/metadata/core.py
# class ParseError(Exception):
#     pass
# 
# class Collection(Media):
#     """
#     Collection of Digial Media like CD, DVD, Directory, Playlist
#     """
#     _keys = Media._keys + [ 'id', 'tracks' ]
# 
#     def __init__(self):
#         Media.__init__(self)
#         self.tracks = []
# 
# MEDIA_DISC      = 'MEDIA_DISC'
# 
# Path: external/metadata/video/core.py
# class VideoStream(Media):
#     """
#     Video Tracks in a Multiplexed Container.
#     """
#     _keys = Media._keys + VIDEOCORE
#     media = MEDIA_VIDEO


# Path: external/metadata/disc/core.py
import logging
from ..core import ParseError, Collection, MEDIA_DISC
from ..video.core import VideoStream
from . import cdrom

#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------------

# python imports

# kaa imports

# extra cdrom parser

# get logging object
log = logging.getLogger('metadata')

class Disc(Collection):

    _keys = Collection._keys + [ 'mixed', 'label' ]
    media = MEDIA_DISC

    def is_disc(self, device):
        (type, self.id) = cdrom.status(device, handle_mix=1)
        if type != 2:
            if type == 4:
                self.mixed = 1
                type = 1
            return type

        if cdrom.CREATE_MD5_ID:

            if len(self.id) == 32: