Exemplo n.º 1
0
class RBUF(FrameOpt):
    """Recommended buffer size.

    Attributes:

    * size -- recommended buffer size in bytes
    * info -- if ID3 tags may be elsewhere in the file (optional)
    * offset -- the location of the next ID3 tag, if any

    Mutagen will not find the next tag itself.
    """

    _framespec = [SizedIntegerSpec('size', 3)]

    _optionalspec = [
        ByteSpec('info'),
        SizedIntegerSpec('offset', 4),
    ]

    def __eq__(self, other):
        return self.size == other

    __hash__ = FrameOpt.__hash__

    def __pos__(self):
        return self.size
Exemplo n.º 2
0
class AENC(FrameOpt):
    """Audio encryption.

    Attributes:

    * owner -- key identifying this encryption type
    * preview_start -- unencrypted data block offset
    * preview_length -- number of unencrypted blocks
    * data -- data required for decryption (optional)

    Mutagen cannot decrypt files.
    """

    _framespec = [
        Latin1TextSpec('owner'),
        SizedIntegerSpec('preview_start', 2),
        SizedIntegerSpec('preview_length', 2),
    ]

    _optionalspec = [BinaryDataSpec('data')]

    @property
    def HashKey(self):
        return '%s:%s' % (self.FrameID, self.owner)

    def __str__(self):
        return self.owner.encode('utf-8')

    def __unicode__(self):
        return self.owner

    def __eq__(self, other):
        return self.owner == other

    __hash__ = FrameOpt.__hash__
Exemplo n.º 3
0
class ASPI(Frame):
    """Audio seek point index.

    Attributes: S, L, N, b, and Fi. For the meaning of these, see
    the ID3v2.4 specification. Fi is a list of integers.
    """
    _framespec = [
        SizedIntegerSpec("S", 4),
        SizedIntegerSpec("L", 4),
        SizedIntegerSpec("N", 2),
        ByteSpec("b"),
        ASPIIndexSpec("Fi"),
    ]

    def __eq__(self, other):
        return self.Fi == other

    __hash__ = Frame.__hash__
Exemplo n.º 4
0
class MLLT(Frame):
    """MPEG location lookup table.

    This frame's attributes may be changed in the future based on
    feedback from real-world use.
    """

    _framespec = [
        SizedIntegerSpec('frames', 2),
        SizedIntegerSpec('bytes', 3),
        SizedIntegerSpec('milliseconds', 3),
        ByteSpec('bits_for_bytes'),
        ByteSpec('bits_for_milliseconds'),
        BinaryDataSpec('data'),
    ]

    def __eq__(self, other):
        return self.data == other

    __hash__ = Frame.__hash__
Exemplo n.º 5
0
class RVRB(Frame):
    """Reverb."""

    _framespec = [
        SizedIntegerSpec('left', 2),
        SizedIntegerSpec('right', 2),
        ByteSpec('bounce_left'),
        ByteSpec('bounce_right'),
        ByteSpec('feedback_ltl'),
        ByteSpec('feedback_ltr'),
        ByteSpec('feedback_rtr'),
        ByteSpec('feedback_rtl'),
        ByteSpec('premix_ltr'),
        ByteSpec('premix_rtl'),
    ]

    def __eq__(self, other):
        return (self.left, self.right) == other

    __hash__ = Frame.__hash__