MythTV  master
Classes | Functions | Variables
discid.disc Namespace Reference


class  Disc
class  DiscError
class  TOCError


def read (device=None, features=[])
def put (first, last, disc_sectors, track_offsets)


dictionary _FEATURE_MAPPING = {"read": 1 << 0, "mcn": 1 << 1, "isrc": 1 << 2}

Function Documentation

◆ read()

def (   device = None,
  features = [] 
Reads the TOC from the device given as string
and returns a :class:`Disc` object.

That string can be either of:
:obj:`str <python:str>`, :obj:`unicode` or :obj:`bytes`.
However, it should in no case contain non-ASCII characters.
If no device is given, a default, also given by :func:`get_default_device`
is used.

You can optionally add a subset of the features in
:data:`FEATURES` or the whole list to read more than just the TOC.
In contrast to libdiscid, :func:`read` won't read any
of the additional features by default.

A :exc:`DiscError` exception is raised when the reading fails,
and :exc:`NotImplementedError` when libdiscid doesn't support
reading discs on the current platform.

Definition at line 35 of file

Referenced by common.audiofile.AudioFile.AnalyzeFlac(), common.audiofile.AudioFile.AnalyzeMp3(), common.audiofile.AudioFile.AnalyzeOgg(), common.audiofile.AudioFile.AnalyzeWma(), avi_read_index(), MediaMonitorUnix.CheckDeviceNotifications(), MythCDROMLinux.checkMedia(), UnzipPrivate.decryptBytes(), hardwareprofile.os_detect.OSWithFile.do_test(), UnzipPrivate.extractFile(), get_avi_from_index(), lyricsmode.LyricsFetcher.get_lyrics(), baidu.LyricsFetcher.get_lyrics(), hardwareprofile.distros.mythtv_data.uuiddb._UuidDb.get_pub_uuid(), LIRC.GetCodes(), MythDVDInfo.GetNameAndSerialNum(), AudioInputOSS.GetSamples(), getsize(), ExternIO.GetStatus(), MythSystemLegacyIOHandler.HandleRead(), SignalHandler.handleSignal(), lirc_nextcode(), lirc_read_string(), hardwareprofile.MultipartPostHandler.main(), MythFileRead(), MythFileBuffer.OpenFile(), DeviceReadBuffer.Poll(), ExternIO.Read(), RemoteFile.Read(), read_avi_header(), hardwareprofile.smolt.read_cpuinfo(), common.audiofile.AudioFile.ReadAudioStream(), ZMClient.readData(), ring_write_file(),,,, DVBStreamHandler.RunSR(), DVBStreamHandler.RunTS(), V4LRecorder.RunVBIDevice(), safe_read(), MythFileBuffer.SafeRead(), save_read(), V4L2encStreamHandler.StartEncoding(), MpegRecorder.StartEncoding(), hardwareprofile.os_detect.get_os_info.ubuntu(), and vbi_handler().

◆ put()

def discid.disc.put (   first,
Creates a TOC based on the information given
and returns a :class:`Disc` object.

Takes the `first` track and `last` **audio** track as :obj:`int`.
`disc_sectors` is the end of the last audio track,
normally the total sector count of the disc.
`track_offsets` is a list of all audio track offsets.

Depending on how you get the total sector count,
you might have to substract 11400 (2:32 min.) for discs with data tracks.

A :exc:`TOCError` exception is raised when illegal parameters
are provided.

.. seealso:: :musicbrainz:`Disc ID Calculation`

Definition at line 58 of file

Variable Documentation


dictionary discid.disc._FEATURE_MAPPING = {"read": 1 << 0, "mcn": 1 << 1, "isrc": 1 << 2}

Definition at line 30 of file



Definition at line 33 of file