# -*- coding: UTF-8 -*-

"""
RIFF parser, able to parse:
   * AVI video container
   * WAV audio container
   * CDA file

Documents:
- libavformat source code from ffmpeg library
  http://ffmpeg.mplayerhq.hu/
- Video for Windows Programmer's Guide
  http://www.opennet.ru/docs/formats/avi.txt
- What is an animated cursor?
  http://www.gdgsoft.com/anituner/help/aniformat.htm

Authors:
   * Aurélien Jacobs
   * Mickaël KENIKSSI
   * Victor Stinner
Changelog:
   * 2007-03-30: support ACON (animated icons)
   * 2006-08-08: merge AVI, WAV and CDA parsers into RIFF parser
   * 2006-08-03: creation of CDA parser by Mickaël KENIKSSI
   * 2005-06-21: creation of WAV parser by Victor Stinner
   * 2005-06-08: creation of AVI parser by Victor Stinner and Aurélien Jacobs
Thanks to:
   * Wojtek Kaniewski (wojtekka AT logonet.com.pl) for its CDA file
     format information
"""

from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
    UInt8, UInt16, UInt32, Enum,
    Bit, NullBits, NullBytes,
    RawBytes, String, PaddingBytes,
    SubFile)
from lib.hachoir_core.tools import alignValue, humanDuration
from lib.hachoir_core.endian import LITTLE_ENDIAN
from lib.hachoir_core.text_handler import filesizeHandler, textHandler
from lib.hachoir_parser.video.fourcc import audio_codec_name, video_fourcc_name
from lib.hachoir_parser.image.ico import IcoFile
from datetime import timedelta

def parseText(self):
    yield String(self, "text", self["size"].value,
        strip=" \0", truncate="\0",
        charset="ISO-8859-1")

def parseRawFormat(self, size):
    yield RawBytes(self, "raw_format", size)

def parseVideoFormat(self, size):
    yield UInt32(self, "video_size", "Video format: Size")
    yield UInt32(self, "width", "Video format: Width")
    yield UInt32(self, "height", "Video format: Height")
    yield UInt16(self, "panes", "Video format: Panes")
    yield UInt16(self, "depth", "Video format: Depth")
    yield UInt32(self, "tag1", "Video format: Tag1")
    yield UInt32(self, "img_size", "Video format: Image size")
    yield UInt32(self, "xpels_meter", "Video format: XPelsPerMeter")
    yield UInt32(self, "ypels_meter", "Video format: YPelsPerMeter")
    yield UInt32(self, "clr_used", "Video format: ClrUsed")
    yield UInt32(self, "clr_important", "Video format: ClrImportant")

def parseAudioFormat(self, size):
    yield Enum(UInt16(self, "codec", "Audio format: Codec id"), audio_codec_name)
    yield UInt16(self, "channel", "Audio format: Channels")
    yield UInt32(self, "sample_rate", "Audio format: Sample rate")
    yield UInt32(self, "bit_rate", "Audio format: Bit rate")
    yield UInt16(self, "block_align", "Audio format: Block align")
    if size >= 16:
        yield UInt16(self, "bits_per_sample", "Audio format: Bits per sample")
    if size >= 18:
        yield UInt16(self, "ext_size", "Audio format: Size of extra information")
    if size >= 28: # and self["a_channel"].value > 2
        yield UInt16(self, "reserved", "Audio format: ")
        yield UInt32(self, "channel_mask", "Audio format: channels placement bitmask")
        yield UInt32(self, "subformat", "Audio format: Subformat id")

def parseAVIStreamFormat(self):
    size = self["size"].value
    strtype = self["../stream_hdr/stream_type"].value
    TYPE_HANDLER = {
        "vids": (parseVideoFormat, 40),
        "auds": (parseAudioFormat, 16)
    }
    handler = parseRawFormat
    if strtype in TYPE_HANDLER:
        info = TYPE_HANDLER[strtype]
        if info[1] <= size:
            handler = info[0]
    for field in handler(self, size):
        yield field

def parseAVIStreamHeader(self):
    if self["size"].value != 56:
        raise ParserError("Invalid stream header size")
    yield String(self, "stream_type", 4, "Stream type four character code", charset="ASCII")
    field = String(self, "fourcc", 4, "Stream four character code", strip=" \0", charset="ASCII")
    if self["stream_type"].value == "vids":
        yield Enum(field, video_fourcc_name, lambda text: text.upper())
    else:
        yield field
    yield UInt32(self, "flags", "Stream flags")
    yield UInt16(self, "priority", "Stream priority")
    yield String(self, "language", 2, "Stream language", charset="ASCII", strip="\0")
    yield UInt32(self, "init_frames", "InitialFrames")
    yield UInt32(self, "scale", "Time scale")
    yield UInt32(self, "rate", "Divide by scale to give frame rate")
    yield UInt32(self, "start", "Stream start time (unit: rate/scale)")
    yield UInt32(self, "length", "Stream length (unit: rate/scale)")
    yield UInt32(self, "buf_size", "Suggested buffer size")
    yield UInt32(self, "quality", "Stream quality")
    yield UInt32(self, "sample_size", "Size of samples")
    yield UInt16(self, "left", "Destination rectangle (left)")
    yield UInt16(self, "top", "Destination rectangle (top)")
    yield UInt16(self, "right", "Destination rectangle (right)")
    yield UInt16(self, "bottom", "Destination rectangle (bottom)")

class RedBook(FieldSet):
    """
    RedBook offset parser, used in CD audio (.cda) file
    """
    def createFields(self):
        yield UInt8(self, "frame")
        yield UInt8(self, "second")
        yield UInt8(self, "minute")
        yield PaddingBytes(self, "notused", 1)

def formatSerialNumber(field):
    """
    Format an disc serial number.
    Eg. 0x00085C48 => "0008-5C48"
    """
    sn = field.value
    return "%04X-%04X" % (sn >> 16, sn & 0xFFFF)

def parseCDDA(self):
    """
    HSG address format: number of 1/75 second

    HSG offset = (minute*60 + second)*75 + frame + 150 (from RB offset)
    HSG length = (minute*60 + second)*75 + frame (from RB length)
    """
    yield UInt16(self, "cda_version", "CD file version (currently 1)")
    yield UInt16(self, "track_no", "Number of track")
    yield textHandler(UInt32(self, "disc_serial", "Disc serial number"),
        formatSerialNumber)
    yield UInt32(self, "hsg_offset", "Track offset (HSG format)")
    yield UInt32(self, "hsg_length", "Track length (HSG format)")
    yield RedBook(self, "rb_offset", "Track offset (Red-book format)")
    yield RedBook(self, "rb_length", "Track length (Red-book format)")

def parseWAVFormat(self):
    size = self["size"].value
    if size not in (16, 18):
        self.warning("Format with size of %s bytes is not supported!" % size)
    yield Enum(UInt16(self, "codec", "Audio codec"), audio_codec_name)
    yield UInt16(self, "nb_channel", "Number of audio channel")
    yield UInt32(self, "sample_per_sec", "Sample per second")
    yield UInt32(self, "byte_per_sec", "Average byte per second")
    yield UInt16(self, "block_align", "Block align")
    yield UInt16(self, "bit_per_sample", "Bits per sample")

def parseWAVFact(self):
    yield UInt32(self, "nb_sample", "Number of samples in audio stream")

def parseAviHeader(self):
    yield UInt32(self, "microsec_per_frame", "Microsecond per frame")
    yield UInt32(self, "max_byte_per_sec", "Maximum byte per second")
    yield NullBytes(self, "reserved", 4)

    # Flags
    yield NullBits(self, "reserved[]", 4)
    yield Bit(self, "has_index")
    yield Bit(self, "must_use_index")
    yield NullBits(self, "reserved[]", 2)
    yield Bit(self, "is_interleaved")
    yield NullBits(self, "reserved[]", 2)
    yield Bit(self, "trust_cktype")
    yield NullBits(self, "reserved[]", 4)
    yield Bit(self, "was_capture_file")
    yield Bit(self, "is_copyrighted")
    yield NullBits(self, "reserved[]", 14)

    yield UInt32(self, "total_frame", "Total number of frames in the video")
    yield UInt32(self, "init_frame", "Initial frame (used in interleaved video)")
    yield UInt32(self, "nb_stream", "Number of streams")
    yield UInt32(self, "sug_buf_size", "Suggested buffer size")
    yield UInt32(self, "width", "Width in pixel")
    yield UInt32(self, "height", "Height in pixel")
    yield UInt32(self, "scale")
    yield UInt32(self, "rate")
    yield UInt32(self, "start")
    yield UInt32(self, "length")

def parseODML(self):
    yield UInt32(self, "total_frame", "Real number of frame of OpenDML video")
    padding = self["size"].value - 4
    if 0 < padding:
        yield NullBytes(self, "padding[]", padding)

class AVIIndexEntry(FieldSet):
    size = 16*8
    def createFields(self):
        yield String(self, "tag", 4, "Tag", charset="ASCII")
        yield UInt32(self, "flags")
        yield UInt32(self, "start", "Offset from start of movie data")
        yield UInt32(self, "length")

def parseIndex(self):
    while not self.eof:
        yield AVIIndexEntry(self, "index[]")

class Chunk(FieldSet):
    TAG_INFO = {
        # This dictionnary is edited by RiffFile.validate()

        "LIST": ("list[]", None, "Sub-field list"),
        "JUNK": ("junk[]", None, "Junk (padding)"),

        # Metadata
        "INAM": ("title", parseText, "Document title"),
        "IART": ("artist", parseText, "Artist"),
        "ICMT": ("comment", parseText, "Comment"),
        "ICOP": ("copyright", parseText, "Copyright"),
        "IENG": ("author", parseText, "Author"),
        "ICRD": ("creation_date", parseText, "Creation date"),
        "ISFT": ("producer", parseText, "Producer"),
        "IDIT": ("datetime", parseText, "Date time"),

        # TODO: Todo: see below
        # "strn": Stream description
        # TWOCC code, movie/field[]/tag.value[2:4]:
        #   "db": "Uncompressed video frame",
        #   "dc": "Compressed video frame",
        #   "wb": "Audio data",
        #   "pc": "Palette change"
    }

    subtag_info = {
        "INFO": ("info", "File informations"),
        "hdrl": ("headers", "Headers"),
        "strl": ("stream[]", "Stream header list"),
        "movi": ("movie", "Movie stream"),
        "odml": ("odml", "ODML"),
    }

    def __init__(self, *args, **kw):
        FieldSet.__init__(self, *args, **kw)
        self._size = (8 + alignValue(self["size"].value, 2)) * 8
        tag = self["tag"].value
        if tag in self.TAG_INFO:
            self.tag_info = self.TAG_INFO[tag]
            if tag == "LIST":
                subtag = self["subtag"].value
                if subtag in self.subtag_info:
                    info = self.subtag_info[subtag]
                    self.tag_info = (info[0], None, info[1])
            self._name = self.tag_info[0]
            self._description = self.tag_info[2]
        else:
            self.tag_info = ("field[]", None, None)

    def createFields(self):
        yield String(self, "tag", 4, "Tag", charset="ASCII")
        yield filesizeHandler(UInt32(self, "size", "Size"))
        if not self["size"].value:
            return
        if self["tag"].value == "LIST":
            yield String(self, "subtag", 4, "Sub-tag", charset="ASCII")
            handler = self.tag_info[1]
            while 8 < (self.size - self.current_size)/8:
                field = self.__class__(self, "field[]")
                yield field
                if (field.size/8) % 2 != 0:
                    yield UInt8(self, "padding[]", "Padding")
        else:
            handler = self.tag_info[1]
            if handler:
                for field in handler(self):
                    yield field
            else:
                yield RawBytes(self, "raw_content", self["size"].value)
            padding = self.seekBit(self._size)
            if padding:
                yield padding

    def createDescription(self):
        tag = self["tag"].display
        return u"Chunk (tag %s)" % tag

class ChunkAVI(Chunk):
    TAG_INFO = Chunk.TAG_INFO.copy()
    TAG_INFO.update({
        "strh": ("stream_hdr", parseAVIStreamHeader, "Stream header"),
        "strf": ("stream_fmt", parseAVIStreamFormat, "Stream format"),
        "avih": ("avi_hdr", parseAviHeader, "AVI header"),
        "idx1": ("index", parseIndex, "Stream index"),
        "dmlh": ("odml_hdr", parseODML, "ODML header"),
    })

class ChunkCDDA(Chunk):
    TAG_INFO = Chunk.TAG_INFO.copy()
    TAG_INFO.update({
        'fmt ': ("cdda", parseCDDA, "CD audio informations"),
    })

class ChunkWAVE(Chunk):
    TAG_INFO = Chunk.TAG_INFO.copy()
    TAG_INFO.update({
        'fmt ': ("format", parseWAVFormat, "Audio format"),
        'fact': ("nb_sample", parseWAVFact, "Number of samples"),
        'data': ("audio_data", None, "Audio stream data"),
    })

def parseAnimationHeader(self):
    yield UInt32(self, "hdr_size", "Size of header (36 bytes)")
    if self["hdr_size"].value != 36:
        self.warning("Animation header with unknown size (%s)" % self["size"].value)
    yield UInt32(self, "nb_frame", "Number of unique Icons in this cursor")
    yield UInt32(self, "nb_step", "Number of Blits before the animation cycles")
    yield UInt32(self, "cx")
    yield UInt32(self, "cy")
    yield UInt32(self, "bit_count")
    yield UInt32(self, "planes")
    yield UInt32(self, "jiffie_rate", "Default Jiffies (1/60th of a second) if rate chunk not present")
    yield Bit(self, "is_icon")
    yield NullBits(self, "padding", 31)

def parseAnimationSequence(self):
    while not self.eof:
        yield UInt32(self, "icon[]")

def formatJiffie(field):
    sec = float(field.value) / 60
    return humanDuration(timedelta(seconds=sec))

def parseAnimationRate(self):
    while not self.eof:
        yield textHandler(UInt32(self, "rate[]"), formatJiffie)

def parseIcon(self):
    yield SubFile(self, "icon_file", self["size"].value, parser_class=IcoFile)

class ChunkACON(Chunk):
    TAG_INFO = Chunk.TAG_INFO.copy()
    TAG_INFO.update({
        'anih': ("anim_hdr", parseAnimationHeader, "Animation header"),
        'seq ': ("anim_seq", parseAnimationSequence, "Animation sequence"),
        'rate': ("anim_rate", parseAnimationRate, "Animation sequence"),
        'icon': ("icon[]", parseIcon, "Icon"),
    })

class RiffFile(Parser):
    PARSER_TAGS = {
        "id": "riff",
        "category": "container",
        "file_ext": ("avi", "cda", "wav", "ani"),
        "min_size": 16*8,
        "mime": (u"video/x-msvideo", u"audio/x-wav", u"audio/x-cda"),
        # FIXME: Use regex "RIFF.{4}(WAVE|CDDA|AVI )"
        "magic": (
            ("AVI LIST", 8*8),
            ("WAVEfmt ", 8*8),
            ("CDDAfmt ", 8*8),
            ("ACONanih", 8*8),
        ),
        "description": "Microsoft RIFF container"
    }
    VALID_TYPES = {
        "WAVE": (ChunkWAVE, u"audio/x-wav",     u"Microsoft WAVE audio", ".wav"),
        "CDDA": (ChunkCDDA, u"audio/x-cda",     u"Microsoft Windows audio CD file (cda)", ".cda"),
        "AVI ": (ChunkAVI,  u"video/x-msvideo", u"Microsoft AVI video", ".avi"),
        "ACON": (ChunkACON, u"image/x-ani",     u"Microsoft Windows animated cursor", ".ani"),
    }
    endian = LITTLE_ENDIAN

    def validate(self):
        if self.stream.readBytes(0, 4) != "RIFF":
            return "Wrong signature"
        if self["type"].value not in self.VALID_TYPES:
            return "Unknown RIFF content type"
        return True

    def createFields(self):
        yield String(self, "signature", 4, "AVI header (RIFF)", charset="ASCII")
        yield filesizeHandler(UInt32(self, "filesize", "File size"))
        yield String(self, "type", 4, "Content type (\"AVI \", \"WAVE\", ...)", charset="ASCII")

        # Choose chunk type depending on file type
        try:
            chunk_cls = self.VALID_TYPES[self["type"].value][0]
        except KeyError:
            chunk_cls = Chunk

        # Parse all chunks up to filesize
        while self.current_size < self["filesize"].value*8+8:
            yield chunk_cls(self, "chunk[]")
        if not self.eof:
            yield RawBytes(self, "padding[]", (self.size-self.current_size)/8)

    def createMimeType(self):
        try:
            return self.VALID_TYPES[self["type"].value][1]
        except KeyError:
            return None

    def createDescription(self):
        tag = self["type"].value
        if tag == "AVI ":
            desc = u"Microsoft AVI video"
            if "headers/avi_hdr" in self:
                header = self["headers/avi_hdr"]
                desc += ": %ux%u pixels" % (header["width"].value, header["height"].value)
                microsec = header["microsec_per_frame"].value
                if microsec:
                    desc += ", %.1f fps" % (1000000.0 / microsec)
                    if "total_frame" in header and header["total_frame"].value:
                        delta = timedelta(seconds=float(header["total_frame"].value) * microsec)
                        desc += ", " + humanDuration(delta)
            return desc
        else:
            try:
                return self.VALID_TYPES[tag][2]
            except KeyError:
                return u"Microsoft RIFF container"

    def createContentSize(self):
        size = (self["filesize"].value + 8) * 8
        return min(size, self.stream.size)

    def createFilenameSuffix(self):
        try:
            return self.VALID_TYPES[self["type"].value][3]
        except KeyError:
            return ".riff"


[((3846, 3937), 'lib.hachoir_core.field.String', 'String', (['self', '"""fourcc"""', '(4)', '"""Stream four character code"""'], {'strip': "' \\x00'", 'charset': '"""ASCII"""'}), "(self, 'fourcc', 4, 'Stream four character code', strip=' \\x00',\n    charset='ASCII')\n", (3852, 3937), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1459, 1557), 'lib.hachoir_core.field.String', 'String', (['self', '"""text"""', "self['size'].value"], {'strip': "' \\x00'", 'truncate': "'\\x00'", 'charset': '"""ISO-8859-1"""'}), "(self, 'text', self['size'].value, strip=' \\x00', truncate='\\x00',\n    charset='ISO-8859-1')\n", (1465, 1557), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1609, 1643), 'lib.hachoir_core.field.RawBytes', 'RawBytes', (['self', '"""raw_format"""', 'size'], {}), "(self, 'raw_format', size)\n", (1617, 1643), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1689, 1737), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""video_size"""', '"""Video format: Size"""'], {}), "(self, 'video_size', 'Video format: Size')\n", (1695, 1737), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1748, 1792), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""width"""', '"""Video format: Width"""'], {}), "(self, 'width', 'Video format: Width')\n", (1754, 1792), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1803, 1849), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""height"""', '"""Video format: Height"""'], {}), "(self, 'height', 'Video format: Height')\n", (1809, 1849), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1860, 1904), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""panes"""', '"""Video format: Panes"""'], {}), "(self, 'panes', 'Video format: Panes')\n", (1866, 1904), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1915, 1959), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""depth"""', '"""Video format: Depth"""'], {}), "(self, 'depth', 'Video format: Depth')\n", (1921, 1959), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((1970, 2012), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""tag1"""', '"""Video format: Tag1"""'], {}), "(self, 'tag1', 'Video format: Tag1')\n", (1976, 2012), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2023, 2075), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""img_size"""', '"""Video format: Image size"""'], {}), "(self, 'img_size', 'Video format: Image size')\n", (2029, 2075), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2086, 2144), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""xpels_meter"""', '"""Video format: XPelsPerMeter"""'], {}), "(self, 'xpels_meter', 'Video format: XPelsPerMeter')\n", (2092, 2144), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2155, 2213), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""ypels_meter"""', '"""Video format: YPelsPerMeter"""'], {}), "(self, 'ypels_meter', 'Video format: YPelsPerMeter')\n", (2161, 2213), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2224, 2273), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""clr_used"""', '"""Video format: ClrUsed"""'], {}), "(self, 'clr_used', 'Video format: ClrUsed')\n", (2230, 2273), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2284, 2343), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""clr_important"""', '"""Video format: ClrImportant"""'], {}), "(self, 'clr_important', 'Video format: ClrImportant')\n", (2290, 2343), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2471, 2520), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""channel"""', '"""Audio format: Channels"""'], {}), "(self, 'channel', 'Audio format: Channels')\n", (2477, 2520), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2531, 2587), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""sample_rate"""', '"""Audio format: Sample rate"""'], {}), "(self, 'sample_rate', 'Audio format: Sample rate')\n", (2537, 2587), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2598, 2648), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""bit_rate"""', '"""Audio format: Bit rate"""'], {}), "(self, 'bit_rate', 'Audio format: Bit rate')\n", (2604, 2648), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2659, 2715), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""block_align"""', '"""Audio format: Block align"""'], {}), "(self, 'block_align', 'Audio format: Block align')\n", (2665, 2715), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((3699, 3740), 'lib.hachoir_core.field.ParserError', 'ParserError', (['"""Invalid stream header size"""'], {}), "('Invalid stream header size')\n", (3710, 3740), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((3751, 3838), 'lib.hachoir_core.field.String', 'String', (['self', '"""stream_type"""', '(4)', '"""Stream type four character code"""'], {'charset': '"""ASCII"""'}), "(self, 'stream_type', 4, 'Stream type four character code', charset=\n    'ASCII')\n", (3757, 3838), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4088, 4125), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""flags"""', '"""Stream flags"""'], {}), "(self, 'flags', 'Stream flags')\n", (4094, 4125), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4136, 4179), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""priority"""', '"""Stream priority"""'], {}), "(self, 'priority', 'Stream priority')\n", (4142, 4179), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4190, 4267), 'lib.hachoir_core.field.String', 'String', (['self', '"""language"""', '(2)', '"""Stream language"""'], {'charset': '"""ASCII"""', 'strip': "'\\x00'"}), "(self, 'language', 2, 'Stream language', charset='ASCII', strip='\\x00')\n", (4196, 4267), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4276, 4320), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""init_frames"""', '"""InitialFrames"""'], {}), "(self, 'init_frames', 'InitialFrames')\n", (4282, 4320), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4331, 4366), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""scale"""', '"""Time scale"""'], {}), "(self, 'scale', 'Time scale')\n", (4337, 4366), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4377, 4435), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""rate"""', '"""Divide by scale to give frame rate"""'], {}), "(self, 'rate', 'Divide by scale to give frame rate')\n", (4383, 4435), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4446, 4507), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""start"""', '"""Stream start time (unit: rate/scale)"""'], {}), "(self, 'start', 'Stream start time (unit: rate/scale)')\n", (4452, 4507), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4518, 4576), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""length"""', '"""Stream length (unit: rate/scale)"""'], {}), "(self, 'length', 'Stream length (unit: rate/scale)')\n", (4524, 4576), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4587, 4636), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""buf_size"""', '"""Suggested buffer size"""'], {}), "(self, 'buf_size', 'Suggested buffer size')\n", (4593, 4636), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4647, 4688), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""quality"""', '"""Stream quality"""'], {}), "(self, 'quality', 'Stream quality')\n", (4653, 4688), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4699, 4745), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""sample_size"""', '"""Size of samples"""'], {}), "(self, 'sample_size', 'Size of samples')\n", (4705, 4745), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4756, 4808), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""left"""', '"""Destination rectangle (left)"""'], {}), "(self, 'left', 'Destination rectangle (left)')\n", (4762, 4808), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4819, 4869), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""top"""', '"""Destination rectangle (top)"""'], {}), "(self, 'top', 'Destination rectangle (top)')\n", (4825, 4869), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4880, 4934), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""right"""', '"""Destination rectangle (right)"""'], {}), "(self, 'right', 'Destination rectangle (right)')\n", (4886, 4934), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((4945, 5001), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""bottom"""', '"""Destination rectangle (bottom)"""'], {}), "(self, 'bottom', 'Destination rectangle (bottom)')\n", (4951, 5001), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5701, 5761), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""cda_version"""', '"""CD file version (currently 1)"""'], {}), "(self, 'cda_version', 'CD file version (currently 1)')\n", (5707, 5761), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5772, 5815), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""track_no"""', '"""Number of track"""'], {}), "(self, 'track_no', 'Number of track')\n", (5778, 5815), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5927, 5982), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""hsg_offset"""', '"""Track offset (HSG format)"""'], {}), "(self, 'hsg_offset', 'Track offset (HSG format)')\n", (5933, 5982), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5993, 6048), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""hsg_length"""', '"""Track length (HSG format)"""'], {}), "(self, 'hsg_length', 'Track length (HSG format)')\n", (5999, 6048), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6436, 6489), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""nb_channel"""', '"""Number of audio channel"""'], {}), "(self, 'nb_channel', 'Number of audio channel')\n", (6442, 6489), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6500, 6551), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""sample_per_sec"""', '"""Sample per second"""'], {}), "(self, 'sample_per_sec', 'Sample per second')\n", (6506, 6551), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6562, 6617), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""byte_per_sec"""', '"""Average byte per second"""'], {}), "(self, 'byte_per_sec', 'Average byte per second')\n", (6568, 6617), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6628, 6670), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""block_align"""', '"""Block align"""'], {}), "(self, 'block_align', 'Block align')\n", (6634, 6670), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6681, 6730), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""bit_per_sample"""', '"""Bits per sample"""'], {}), "(self, 'bit_per_sample', 'Bits per sample')\n", (6687, 6730), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6766, 6828), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""nb_sample"""', '"""Number of samples in audio stream"""'], {}), "(self, 'nb_sample', 'Number of samples in audio stream')\n", (6772, 6828), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6866, 6925), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""microsec_per_frame"""', '"""Microsecond per frame"""'], {}), "(self, 'microsec_per_frame', 'Microsecond per frame')\n", (6872, 6925), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6936, 6995), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""max_byte_per_sec"""', '"""Maximum byte per second"""'], {}), "(self, 'max_byte_per_sec', 'Maximum byte per second')\n", (6942, 6995), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7006, 7036), 'lib.hachoir_core.field.NullBytes', 'NullBytes', (['self', '"""reserved"""', '(4)'], {}), "(self, 'reserved', 4)\n", (7015, 7036), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7060, 7091), 'lib.hachoir_core.field.NullBits', 'NullBits', (['self', '"""reserved[]"""', '(4)'], {}), "(self, 'reserved[]', 4)\n", (7068, 7091), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7102, 7124), 'lib.hachoir_core.field.Bit', 'Bit', (['self', '"""has_index"""'], {}), "(self, 'has_index')\n", (7105, 7124), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7135, 7162), 'lib.hachoir_core.field.Bit', 'Bit', (['self', '"""must_use_index"""'], {}), "(self, 'must_use_index')\n", (7138, 7162), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7173, 7204), 'lib.hachoir_core.field.NullBits', 'NullBits', (['self', '"""reserved[]"""', '(2)'], {}), "(self, 'reserved[]', 2)\n", (7181, 7204), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7215, 7242), 'lib.hachoir_core.field.Bit', 'Bit', (['self', '"""is_interleaved"""'], {}), "(self, 'is_interleaved')\n", (7218, 7242), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7253, 7284), 'lib.hachoir_core.field.NullBits', 'NullBits', (['self', '"""reserved[]"""', '(2)'], {}), "(self, 'reserved[]', 2)\n", (7261, 7284), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7295, 7320), 'lib.hachoir_core.field.Bit', 'Bit', (['self', '"""trust_cktype"""'], {}), "(self, 'trust_cktype')\n", (7298, 7320), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7331, 7362), 'lib.hachoir_core.field.NullBits', 'NullBits', (['self', '"""reserved[]"""', '(4)'], {}), "(self, 'reserved[]', 4)\n", (7339, 7362), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7373, 7402), 'lib.hachoir_core.field.Bit', 'Bit', (['self', '"""was_capture_file"""'], {}), "(self, 'was_capture_file')\n", (7376, 7402), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7413, 7440), 'lib.hachoir_core.field.Bit', 'Bit', (['self', '"""is_copyrighted"""'], {}), "(self, 'is_copyrighted')\n", (7416, 7440), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7451, 7483), 'lib.hachoir_core.field.NullBits', 'NullBits', (['self', '"""reserved[]"""', '(14)'], {}), "(self, 'reserved[]', 14)\n", (7459, 7483), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7495, 7561), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""total_frame"""', '"""Total number of frames in the video"""'], {}), "(self, 'total_frame', 'Total number of frames in the video')\n", (7501, 7561), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7572, 7643), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""init_frame"""', '"""Initial frame (used in interleaved video)"""'], {}), "(self, 'init_frame', 'Initial frame (used in interleaved video)')\n", (7578, 7643), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7654, 7700), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""nb_stream"""', '"""Number of streams"""'], {}), "(self, 'nb_stream', 'Number of streams')\n", (7660, 7700), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7711, 7764), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""sug_buf_size"""', '"""Suggested buffer size"""'], {}), "(self, 'sug_buf_size', 'Suggested buffer size')\n", (7717, 7764), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7775, 7814), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""width"""', '"""Width in pixel"""'], {}), "(self, 'width', 'Width in pixel')\n", (7781, 7814), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7825, 7866), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""height"""', '"""Height in pixel"""'], {}), "(self, 'height', 'Height in pixel')\n", (7831, 7866), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7877, 7898), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""scale"""'], {}), "(self, 'scale')\n", (7883, 7898), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7909, 7929), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""rate"""'], {}), "(self, 'rate')\n", (7915, 7929), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7940, 7961), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""start"""'], {}), "(self, 'start')\n", (7946, 7961), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((7972, 7994), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""length"""'], {}), "(self, 'length')\n", (7978, 7994), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((8027, 8095), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""total_frame"""', '"""Real number of frame of OpenDML video"""'], {}), "(self, 'total_frame', 'Real number of frame of OpenDML video')\n", (8033, 8095), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((9808, 9844), 'lib.hachoir_core.field.FieldSet.__init__', 'FieldSet.__init__', (['self', '*args'], {}), '(self, *args, **kw)\n', (9825, 9844), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12342, 12395), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""hdr_size"""', '"""Size of header (36 bytes)"""'], {}), "(self, 'hdr_size', 'Size of header (36 bytes)')\n", (12348, 12395), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12528, 12593), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""nb_frame"""', '"""Number of unique Icons in this cursor"""'], {}), "(self, 'nb_frame', 'Number of unique Icons in this cursor')\n", (12534, 12593), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12604, 12674), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""nb_step"""', '"""Number of Blits before the animation cycles"""'], {}), "(self, 'nb_step', 'Number of Blits before the animation cycles')\n", (12610, 12674), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12685, 12703), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""cx"""'], {}), "(self, 'cx')\n", (12691, 12703), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12714, 12732), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""cy"""'], {}), "(self, 'cy')\n", (12720, 12732), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12743, 12768), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""bit_count"""'], {}), "(self, 'bit_count')\n", (12749, 12768), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12779, 12801), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""planes"""'], {}), "(self, 'planes')\n", (12785, 12801), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12812, 12909), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""jiffie_rate"""', '"""Default Jiffies (1/60th of a second) if rate chunk not present"""'], {}), "(self, 'jiffie_rate',\n    'Default Jiffies (1/60th of a second) if rate chunk not present')\n", (12818, 12909), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12916, 12936), 'lib.hachoir_core.field.Bit', 'Bit', (['self', '"""is_icon"""'], {}), "(self, 'is_icon')\n", (12919, 12936), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((12947, 12976), 'lib.hachoir_core.field.NullBits', 'NullBits', (['self', '"""padding"""', '(31)'], {}), "(self, 'padding', 31)\n", (12955, 12976), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((13158, 13180), 'datetime.timedelta', 'timedelta', ([], {'seconds': 'sec'}), '(seconds=sec)\n', (13167, 13180), False, 'from datetime import timedelta\n'), ((13333, 13401), 'lib.hachoir_core.field.SubFile', 'SubFile', (['self', '"""icon_file"""', "self['size'].value"], {'parser_class': 'IcoFile'}), "(self, 'icon_file', self['size'].value, parser_class=IcoFile)\n", (13340, 13401), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2394, 2441), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""codec"""', '"""Audio format: Codec id"""'], {}), "(self, 'codec', 'Audio format: Codec id')\n", (2400, 2441), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2749, 2813), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""bits_per_sample"""', '"""Audio format: Bits per sample"""'], {}), "(self, 'bits_per_sample', 'Audio format: Bits per sample')\n", (2755, 2813), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2847, 2914), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""ext_size"""', '"""Audio format: Size of extra information"""'], {}), "(self, 'ext_size', 'Audio format: Size of extra information')\n", (2853, 2914), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((2982, 3024), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""reserved"""', '"""Audio format: """'], {}), "(self, 'reserved', 'Audio format: ')\n", (2988, 3024), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((3039, 3111), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""channel_mask"""', '"""Audio format: channels placement bitmask"""'], {}), "(self, 'channel_mask', 'Audio format: channels placement bitmask')\n", (3045, 3111), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((3126, 3181), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""subformat"""', '"""Audio format: Subformat id"""'], {}), "(self, 'subformat', 'Audio format: Subformat id')\n", (3132, 3181), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5142, 5162), 'lib.hachoir_core.field.UInt8', 'UInt8', (['self', '"""frame"""'], {}), "(self, 'frame')\n", (5147, 5162), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5177, 5198), 'lib.hachoir_core.field.UInt8', 'UInt8', (['self', '"""second"""'], {}), "(self, 'second')\n", (5182, 5198), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5213, 5234), 'lib.hachoir_core.field.UInt8', 'UInt8', (['self', '"""minute"""'], {}), "(self, 'minute')\n", (5218, 5234), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5249, 5281), 'lib.hachoir_core.field.PaddingBytes', 'PaddingBytes', (['self', '"""notused"""', '(1)'], {}), "(self, 'notused', 1)\n", (5261, 5281), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((5838, 5887), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""disc_serial"""', '"""Disc serial number"""'], {}), "(self, 'disc_serial', 'Disc serial number')\n", (5844, 5887), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((6370, 6406), 'lib.hachoir_core.field.UInt16', 'UInt16', (['self', '"""codec"""', '"""Audio codec"""'], {}), "(self, 'codec', 'Audio codec')\n", (6376, 6406), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((8167, 8204), 'lib.hachoir_core.field.NullBytes', 'NullBytes', (['self', '"""padding[]"""', 'padding'], {}), "(self, 'padding[]', padding)\n", (8176, 8204), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((8295, 8341), 'lib.hachoir_core.field.String', 'String', (['self', '"""tag"""', '(4)', '"""Tag"""'], {'charset': '"""ASCII"""'}), "(self, 'tag', 4, 'Tag', charset='ASCII')\n", (8301, 8341), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((8356, 8377), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""flags"""'], {}), "(self, 'flags')\n", (8362, 8377), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((8392, 8448), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""start"""', '"""Offset from start of movie data"""'], {}), "(self, 'start', 'Offset from start of movie data')\n", (8398, 8448), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((8463, 8485), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""length"""'], {}), "(self, 'length')\n", (8469, 8485), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((10458, 10504), 'lib.hachoir_core.field.String', 'String', (['self', '"""tag"""', '(4)', '"""Tag"""'], {'charset': '"""ASCII"""'}), "(self, 'tag', 4, 'Tag', charset='ASCII')\n", (10464, 10504), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((13050, 13072), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""icon[]"""'], {}), "(self, 'icon[]')\n", (13056, 13072), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((14958, 15024), 'lib.hachoir_core.field.String', 'String', (['self', '"""signature"""', '(4)', '"""AVI header (RIFF)"""'], {'charset': '"""ASCII"""'}), "(self, 'signature', 4, 'AVI header (RIFF)', charset='ASCII')\n", (14964, 15024), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((15108, 15186), 'lib.hachoir_core.field.String', 'String', (['self', '"""type"""', '(4)', '"""Content type ("AVI ", "WAVE", ...)"""'], {'charset': '"""ASCII"""'}), '(self, \'type\', 4, \'Content type ("AVI ", "WAVE", ...)\', charset=\'ASCII\')\n', (15114, 15186), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((9871, 9904), 'lib.hachoir_core.tools.alignValue', 'alignValue', (["self['size'].value", '(2)'], {}), "(self['size'].value, 2)\n", (9881, 9904), False, 'from lib.hachoir_core.tools import alignValue, humanDuration\n'), ((10535, 10563), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""size"""', '"""Size"""'], {}), "(self, 'size', 'Size')\n", (10541, 10563), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((10677, 10730), 'lib.hachoir_core.field.String', 'String', (['self', '"""subtag"""', '(4)', '"""Sub-tag"""'], {'charset': '"""ASCII"""'}), "(self, 'subtag', 4, 'Sub-tag', charset='ASCII')\n", (10683, 10730), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((13263, 13285), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""rate[]"""'], {}), "(self, 'rate[]')\n", (13269, 13285), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((15055, 15092), 'lib.hachoir_core.field.UInt32', 'UInt32', (['self', '"""filesize"""', '"""File size"""'], {}), "(self, 'filesize', 'File size')\n", (15061, 15092), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((15568, 15632), 'lib.hachoir_core.field.RawBytes', 'RawBytes', (['self', '"""padding[]"""', '((self.size - self.current_size) / 8)'], {}), "(self, 'padding[]', (self.size - self.current_size) / 8)\n", (15576, 15632), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((11210, 11259), 'lib.hachoir_core.field.RawBytes', 'RawBytes', (['self', '"""raw_content"""', "self['size'].value"], {}), "(self, 'raw_content', self['size'].value)\n", (11218, 11259), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((10981, 11016), 'lib.hachoir_core.field.UInt8', 'UInt8', (['self', '"""padding[]"""', '"""Padding"""'], {}), "(self, 'padding[]', 'Padding')\n", (10986, 11016), False, 'from lib.hachoir_core.field import FieldSet, ParserError, UInt8, UInt16, UInt32, Enum, Bit, NullBits, NullBytes, RawBytes, String, PaddingBytes, SubFile\n'), ((16471, 16491), 'lib.hachoir_core.tools.humanDuration', 'humanDuration', (['delta'], {}), '(delta)\n', (16484, 16491), False, 'from lib.hachoir_core.tools import alignValue, humanDuration\n')]