Ejemplo n.º 1
0
 def _read(self):
     self._debug['len_payload']['start'] = self._io.pos()
     self.len_payload = vlq_base128_be.VlqBase128Be(self._io)
     self.len_payload._read()
     self._debug['len_payload']['end'] = self._io.pos()
     self._debug['row_id']['start'] = self._io.pos()
     self.row_id = vlq_base128_be.VlqBase128Be(self._io)
     self.row_id._read()
     self._debug['row_id']['end'] = self._io.pos()
     self._debug['payload']['start'] = self._io.pos()
     self._raw_payload = self._io.read_bytes(self.len_payload.value)
     _io__raw_payload = KaitaiStream(BytesIO(self._raw_payload))
     self.payload = Sqlite3.CellPayload(_io__raw_payload, self, self._root)
     self.payload._read()
     self._debug['payload']['end'] = self._io.pos()
Ejemplo n.º 2
0
        def _read(self):
            self.v_time = vlq_base128_be.VlqBase128Be(self._io)
            self.event_header = self._io.read_u1()
            if self.event_header == 255:
                self.meta_event_body = StandardMidiFile.MetaEventBody(
                    self._io, self, self._root)

            if self.event_header == 240:
                self.sysex_body = StandardMidiFile.SysexEventBody(
                    self._io, self, self._root)

            _on = self.event_type
            if _on == 224:
                self.event_body = StandardMidiFile.PitchBendEvent(
                    self._io, self, self._root)
            elif _on == 144:
                self.event_body = StandardMidiFile.NoteOnEvent(
                    self._io, self, self._root)
            elif _on == 208:
                self.event_body = StandardMidiFile.ChannelPressureEvent(
                    self._io, self, self._root)
            elif _on == 192:
                self.event_body = StandardMidiFile.ProgramChangeEvent(
                    self._io, self, self._root)
            elif _on == 160:
                self.event_body = StandardMidiFile.PolyphonicPressureEvent(
                    self._io, self, self._root)
            elif _on == 176:
                self.event_body = StandardMidiFile.ControllerEvent(
                    self._io, self, self._root)
            elif _on == 128:
                self.event_body = StandardMidiFile.NoteOffEvent(
                    self._io, self, self._root)
Ejemplo n.º 3
0
 def _read(self):
     self.len_header_and_len = vlq_base128_be.VlqBase128Be(self._io)
     self._raw_column_serials = self._io.read_bytes((self.len_header_and_len.value - 1))
     _io__raw_column_serials = KaitaiStream(BytesIO(self._raw_column_serials))
     self.column_serials = Sqlite3.Serials(_io__raw_column_serials, self, self._root)
     self.column_contents = []
     for i in range(len(self.column_serials.entries)):
         self.column_contents.append(Sqlite3.ColumnContent(self.column_serials.entries[i], self._io, self, self._root))
 def _read(self):
     self._debug['len']['start'] = self._io.pos()
     self.len = vlq_base128_be.VlqBase128Be(self._io)
     self.len._read()
     self._debug['len']['end'] = self._io.pos()
     self._debug['data']['start'] = self._io.pos()
     self.data = self._io.read_bytes(self.len.value)
     self._debug['data']['end'] = self._io.pos()
Ejemplo n.º 5
0
 def _read(self):
     self._debug['left_child_page']['start'] = self._io.pos()
     self.left_child_page = self._io.read_u4be()
     self._debug['left_child_page']['end'] = self._io.pos()
     self._debug['row_id']['start'] = self._io.pos()
     self.row_id = vlq_base128_be.VlqBase128Be(self._io)
     self.row_id._read()
     self._debug['row_id']['end'] = self._io.pos()
 def _read(self):
     self._debug['meta_type']['start'] = self._io.pos()
     self.meta_type = KaitaiStream.resolve_enum(self._root.MetaEventBody.MetaTypeEnum, self._io.read_u1())
     self._debug['meta_type']['end'] = self._io.pos()
     self._debug['len']['start'] = self._io.pos()
     self.len = vlq_base128_be.VlqBase128Be(self._io)
     self.len._read()
     self._debug['len']['end'] = self._io.pos()
     self._debug['body']['start'] = self._io.pos()
     self.body = self._io.read_bytes(self.len.value)
     self._debug['body']['end'] = self._io.pos()
Ejemplo n.º 7
0
 def _read(self):
     self._debug['left_child_page']['start'] = self._io.pos()
     self.left_child_page = self._io.read_u4be()
     self._debug['left_child_page']['end'] = self._io.pos()
     self._debug['len_payload']['start'] = self._io.pos()
     self.len_payload = vlq_base128_be.VlqBase128Be(self._io)
     self.len_payload._read()
     self._debug['len_payload']['end'] = self._io.pos()
     self._debug['payload']['start'] = self._io.pos()
     self._raw_payload = self._io.read_bytes(self.len_payload.value)
     _io__raw_payload = KaitaiStream(BytesIO(self._raw_payload))
     self.payload = self._root.CellPayload(_io__raw_payload, self, self._root)
     self.payload._read()
     self._debug['payload']['end'] = self._io.pos()
Ejemplo n.º 8
0
        def _read(self):
            self._debug['entries']['start'] = self._io.pos()
            self.entries = []
            i = 0
            while not self._io.is_eof():
                if not 'arr' in self._debug['entries']:
                    self._debug['entries']['arr'] = []
                self._debug['entries']['arr'].append({'start': self._io.pos()})
                _t_entries = vlq_base128_be.VlqBase128Be(self._io)
                _t_entries._read()
                self.entries.append(_t_entries)
                self._debug['entries']['arr'][len(self.entries) - 1]['end'] = self._io.pos()
                i += 1

            self._debug['entries']['end'] = self._io.pos()
        def _read(self):
            self._debug['v_time']['start'] = self._io.pos()
            self.v_time = vlq_base128_be.VlqBase128Be(self._io)
            self.v_time._read()
            self._debug['v_time']['end'] = self._io.pos()
            self._debug['event_header']['start'] = self._io.pos()
            self.event_header = self._io.read_u1()
            self._debug['event_header']['end'] = self._io.pos()
            if self.event_header == 255:
                self._debug['meta_event_body']['start'] = self._io.pos()
                self.meta_event_body = self._root.MetaEventBody(self._io, self, self._root)
                self.meta_event_body._read()
                self._debug['meta_event_body']['end'] = self._io.pos()

            if self.event_header == 240:
                self._debug['sysex_body']['start'] = self._io.pos()
                self.sysex_body = self._root.SysexEventBody(self._io, self, self._root)
                self.sysex_body._read()
                self._debug['sysex_body']['end'] = self._io.pos()

            self._debug['event_body']['start'] = self._io.pos()
            _on = self.event_type
            if _on == 224:
                self.event_body = self._root.PitchBendEvent(self._io, self, self._root)
                self.event_body._read()
            elif _on == 144:
                self.event_body = self._root.NoteOnEvent(self._io, self, self._root)
                self.event_body._read()
            elif _on == 208:
                self.event_body = self._root.ChannelPressureEvent(self._io, self, self._root)
                self.event_body._read()
            elif _on == 192:
                self.event_body = self._root.ProgramChangeEvent(self._io, self, self._root)
                self.event_body._read()
            elif _on == 160:
                self.event_body = self._root.PolyphonicPressureEvent(self._io, self, self._root)
                self.event_body._read()
            elif _on == 176:
                self.event_body = self._root.ControllerEvent(self._io, self, self._root)
                self.event_body._read()
            elif _on == 128:
                self.event_body = self._root.NoteOffEvent(self._io, self, self._root)
                self.event_body._read()
            self._debug['event_body']['end'] = self._io.pos()
Ejemplo n.º 10
0
        def _read(self):
            self._debug['len_header_and_len']['start'] = self._io.pos()
            self.len_header_and_len = vlq_base128_be.VlqBase128Be(self._io)
            self.len_header_and_len._read()
            self._debug['len_header_and_len']['end'] = self._io.pos()
            self._debug['column_serials']['start'] = self._io.pos()
            self._raw_column_serials = self._io.read_bytes((self.len_header_and_len.value - 1))
            _io__raw_column_serials = KaitaiStream(BytesIO(self._raw_column_serials))
            self.column_serials = Sqlite3.Serials(_io__raw_column_serials, self, self._root)
            self.column_serials._read()
            self._debug['column_serials']['end'] = self._io.pos()
            self._debug['column_contents']['start'] = self._io.pos()
            self.column_contents = [None] * (len(self.column_serials.entries))
            for i in range(len(self.column_serials.entries)):
                if not 'arr' in self._debug['column_contents']:
                    self._debug['column_contents']['arr'] = []
                self._debug['column_contents']['arr'].append({'start': self._io.pos()})
                _t_column_contents = Sqlite3.ColumnContent(self.column_serials.entries[i], self._io, self, self._root)
                _t_column_contents._read()
                self.column_contents[i] = _t_column_contents
                self._debug['column_contents']['arr'][i]['end'] = self._io.pos()

            self._debug['column_contents']['end'] = self._io.pos()
Ejemplo n.º 11
0
 def _read(self):
     self._debug['code']['start'] = self._io.pos()
     self.code = vlq_base128_be.VlqBase128Be(self._io)
     self.code._read()
     self._debug['code']['end'] = self._io.pos()
Ejemplo n.º 12
0
 def _read(self):
     self.code = vlq_base128_be.VlqBase128Be(self._io)
Ejemplo n.º 13
0
 def _read(self):
     self.left_child_page = self._io.read_u4be()
     self.len_payload = vlq_base128_be.VlqBase128Be(self._io)
     self._raw_payload = self._io.read_bytes(self.len_payload.value)
     _io__raw_payload = KaitaiStream(BytesIO(self._raw_payload))
     self.payload = Sqlite3.CellPayload(_io__raw_payload, self, self._root)
Ejemplo n.º 14
0
 def _read(self):
     self.len = vlq_base128_be.VlqBase128Be(self._io)
     self.data = self._io.read_bytes(self.len.value)
Ejemplo n.º 15
0
 def _read(self):
     self.entries = []
     i = 0
     while not self._io.is_eof():
         self.entries.append(vlq_base128_be.VlqBase128Be(self._io))
         i += 1
Ejemplo n.º 16
0
 def _read(self):
     self.left_child_page = self._io.read_u4be()
     self.row_id = vlq_base128_be.VlqBase128Be(self._io)
Ejemplo n.º 17
0
 def _read(self):
     self.meta_type = KaitaiStream.resolve_enum(
         StandardMidiFile.MetaEventBody.MetaTypeEnum,
         self._io.read_u1())
     self.len = vlq_base128_be.VlqBase128Be(self._io)
     self.body = self._io.read_bytes(self.len.value)