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

Classes

class  Disc
 
class  DiscError
 
class  TOCError
 

Functions

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

Variables

dictionary _FEATURE_MAPPING = {"read": 1 << 0, "mcn": 1 << 1, "isrc": 1 << 2}
 
 FEATURES_IMPLEMENTED = list(_FEATURE_MAPPING.keys())
 

Function Documentation

◆ read()

def discid.disc.read (   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 disc.py.

Referenced by avi_read_index(), MediaMonitorUnix.CheckDeviceNotifications(), MythCDROMLinux.checkMedia(), hardwareprofile.os_detect.OSWithFile.do_test(), get_avi_from_index(), baidu.lyricsScraper.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(), MythWebSocket.Read(), ExternIO.Read(), RemoteFile.Read(), read_avi_header(), hardwareprofile.smolt.read_cpuinfo(), ZMClient.readData(), ring_write_file(), MpegRecorder.run(), DeviceReadBuffer.run(), JoystickMenuThread.run(), DVBStreamHandler.RunSR(), DVBStreamHandler.RunTS(), V4LRecorder.RunVBIDevice(), safe_read(), MythFileBuffer.SafeRead(), save_read(), V4L2encStreamHandler.StartEncoding(), MpegRecorder.StartEncoding(), hardwareprofile.os_detect.get_os_info.ubuntu(), vbi_handler(), and MythHTTPSocket.Write().

◆ put()

def discid.disc.put (   first,
  last,
  disc_sectors,
  track_offsets 
)
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 disc.py.

Variable Documentation

◆ _FEATURE_MAPPING

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

Definition at line 30 of file disc.py.

◆ FEATURES_IMPLEMENTED

discid.disc.FEATURES_IMPLEMENTED = list(_FEATURE_MAPPING.keys())

Definition at line 33 of file disc.py.