Class RekordboxPdb


  • public class RekordboxPdb
    extends io.kaitai.struct.KaitaiStruct
    This is a relational database format designed to be efficiently used by very low power devices (there were deployments on 16 bit devices with 32K of RAM). Today you are most likely to encounter it within the Pioneer Professional DJ ecosystem, because it is the format that their rekordbox software uses to write USB and SD media which can be mounted in DJ controllers and used to play and mix music. It has been reverse-engineered to facilitate sophisticated integrations with light and laser shows, videos, and other musical instruments, by supporting deep knowledge of what is playing and what is coming next through monitoring the network communications of the players. The file is divided into fixed-size blocks. The first block has a header that establishes the block size, and lists the tables available in the database, identifying their types and the index of the first of the series of linked pages that make up that table. Each table is made up of a series of rows which may be spread across any number of pages. The pages start with a header describing the page and linking to the next page. The rest of the page is used as a heap: rows are scattered around it, and located using an index structure that builds backwards from the end of the page. Each row of a given type has a fixed size structure which links to any variable-sized strings by their offsets within the page. As changes are made to the table, some records may become unused, and there may be gaps within the heap that are too small to be used by other data. There is a bit map in the row index that identifies which rows are actually present. Rows that are not present must be ignored: they do not contain valid (or even necessarily well-formed) data. The majority of the work in reverse-engineering this format was performed by @henrybetts and @flesniak, for which I am hugely grateful. @GreyCat helped me learn the intricacies (and best practices) of Kaitai far faster than I would have managed on my own.
    See Also:
    Source
    • Constructor Detail

      • RekordboxPdb

        public RekordboxPdb​(io.kaitai.struct.KaitaiStream _io)
      • RekordboxPdb

        public RekordboxPdb​(io.kaitai.struct.KaitaiStream _io,
                            io.kaitai.struct.KaitaiStruct _parent)
      • RekordboxPdb

        public RekordboxPdb​(io.kaitai.struct.KaitaiStream _io,
                            io.kaitai.struct.KaitaiStruct _parent,
                            RekordboxPdb _root)
    • Method Detail

      • _unnamed0

        public long _unnamed0()
        Unknown purpose, perhaps an unoriginal signature, seems to always have the value 0.
      • lenPage

        public long lenPage()
        The database page size, in bytes. Pages are referred to by index, so this size is needed to calculate their offset, and table pages have a row index structure which is built from the end of the page backwards, so finding that also requires this value.
      • numTables

        public long numTables()
        Determines the number of table entries that are present. Each table is a linked list of pages containing rows of a particular type.
      • nextUnusedPage

        public long nextUnusedPage()
      • _unnamed4

        public long _unnamed4()
      • sequence

        public long sequence()
      • gap

        public byte[] gap()
        Only exposed until https://github.com/kaitai-io/kaitai_struct/issues/825 can be fixed.
      • _parent

        public io.kaitai.struct.KaitaiStruct _parent()
        Overrides:
        _parent in class io.kaitai.struct.KaitaiStruct