21 from ctypes
import c_int, c_void_p, c_char_p
24 from discid.util import _decode, _sectors_to_seconds
28 """Track objects are part of the :class:`Disc` class.
34 assert self.
_disc._handle.value
is not None
37 assert self.
_disc._success
40 _LIB.discid_get_track_offset.argtypes = (c_void_p, c_int)
41 _LIB.discid_get_track_offset.restype = c_int
43 assert self.
_disc._success
44 return _LIB.discid_get_track_offset(self.
_disc._handle, self.
number)
46 _LIB.discid_get_track_length.argtypes = (c_void_p, c_int)
47 _LIB.discid_get_track_length.restype = c_int
49 assert self.
_disc._success
50 return _LIB.discid_get_track_length(self.
_disc._handle, self.
number)
53 _LIB.discid_get_track_isrc.argtypes = (c_void_p, c_int)
54 _LIB.discid_get_track_isrc.restype = c_char_p
55 except AttributeError:
58 assert self.
_disc._success
59 if "isrc" in self.
_disc._requested_features:
61 result = _LIB.discid_get_track_isrc(self.
_disc._handle,
63 except AttributeError:
73 """The track number"""
78 """The track offset"""
83 """The track length in sectors"""
87 """This is an alias for :attr:`sectors`"""
91 """Track length in seconds"""
96 """The International Standard Recording Code
98 This will be `None` when the `"isrc"` feature was not requested
99 or not supported, otherwise this is a :obj:`unicode` or
100 :obj:`str <python:str>` object.