Repository navigation
Edit My Settings, take a stick's, and put them only where a drive has none of its own - #107
Merged
Merged
Conversation
A player loads its settings, and the mixer's, off a stick from four files in PIONEER: MYSETTING.DAT, MYSETTING2.DAT, DJMMYSETTING.DAT and DEVSETTING.DAT. Booth now has them as a set of 46 settings it can change one byte at a time, starting from what rekordbox writes. A file is kept as its bytes, and only the bytes of the 46 named settings are ever changed, with the checksum. rekordcrate, which the map of bytes comes from, reads a file into fields and refuses one with anything unexpected where no setting has been named; a file a player saved, or a newer rekordbox wrote, is where a setting nobody has named would turn up, and writing it back from fields would drop it. What was measured, on the files rekordcrate keeps from rekordbox 6.6.1: - Each of the 74 files with one setting changed differs from rekordbox's default file in exactly one body byte and the checksum. Every byte and value is rekordcrate's. pyrekordbox's docs give hot cue auto load's "rekordbox setting" as 0x83 and number the languages from 0x80; the files say 0x82 and 0x81, as rekordcrate does. - All 82 files' checksums are CRC16-XMODEM over the body, or over everything before the checksum for DJMMYSETTING.DAT. - rekordbox writes the header version as 0.001 for both player files and 1.000 for the mixer's. rekordcrate's default constructors write 6.6.1 in all four, so Booth starts from rekordbox's bytes, not rekordcrate's. Whether a file already on a drive is written over is decided by settings::step: only when it is byte for byte what Booth last put there, or when somebody says so. A player that saved its settings, or rekordbox, made it somebody's choice, and rekordbox does not write over one either. The export writes whatever files it is handed and reads each back. booth-cli settings <drive> says what a drive's files set, marks each setting that is not rekordbox's, and names any byte that differs where no setting is known, which is how a file a CDJ-3000 saved can be looked at. The tests read what Booth writes with rekordcrate, which shares no code with it: every value of every setting written back byte for byte, and moving only the setting of the same name. An ignored test reads the 74 fixtures. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tjgDHGCsZrZcZPVL4Dmon
My Settings, beside Settings in the dock, is a sheet of the 46 player and mixer settings, grouped as rekordbox's preferences group them, each a menu of its values with rekordbox's named on hover. Take a drive's uses the settings on a stick a file at a time, as a player saved them or rekordbox put them; a file that does not read is left out and named, and any byte in one that no setting is known for is kept and counted. The collection has none until somebody sets one. A stick carrying settings changes how a player behaves when they are loaded, and a DJ who never asked for that should not find Quantize back on. A sync puts them on a drive only where it has none of its own. Each drive's record says which files Booth put there and what they were, so an edited set replaces Booth's own files and nothing else; a file a player has saved over since no longer matches and is the drive's own again. The sync sheet has a Settings line saying what each file does, and "Put mine over the drive's own" for the one write it is ticked for. The plan decides from the record alone, so the dock can say "settings" without reading a stick on every change; the sheet and the write ask the stick, as the free-space check already does. The record is changed when the write reports back, not before: recorded ahead, a failed write would leave Booth's old file on the stick under a record naming the new one, and the next sync would keep the old file as the drive's own for good. An image is made from nothing every time, so it gets the whole set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019tjgDHGCsZrZcZPVL4Dmon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Q-01 in the feature research doc: view and edit the players' and the mixer's My Settings in Booth, take the ones a player saved onto a stick, put a chosen set on any stick, and never write over a player's saved settings unless asked (PP-32).
What changed
The four files, as bytes.
booth-cli's newexport::settingshandlesMYSETTING.DAT,MYSETTING2.DAT,DJMMYSETTING.DATandDEVSETTING.DAT. Each file is a header, one byte per setting, and a CRC16-XMODEM checksum. Booth knows 46 settings and changes only their bytes, recomputing the checksum. Every other byte of a file is kept exactly as it was.My Settings sheet. A My Settings button sits beside Settings in the dock. It opens all 46 settings, grouped the way rekordbox's preferences group them, each with a menu of its values; hovering shows rekordbox's own value. It also has:
On sync, only where the drive has none of its own.
booth-cli settings <drive>. Prints what a drive's settings files set, setting by setting, with rekordbox's value beside each one that differs. It also names any byte that differs where no setting is known. That is how a file a CDJ-3000 saved can be looked at.Why it's right
What each byte means was measured, not taken on trust. The map comes from rekordcrate (MPL-2.0). rekordcrate keeps 74 files from rekordbox 6.6.1, each with one setting changed. Every one of them differs from rekordbox's default file in exactly one body byte, plus the checksum. That byte and its value are rekordcrate's in all 74.
pyrekordbox's documentation disagrees in two places, and the files side with rekordcrate:
All 82 of rekordcrate's settings files check out with the checksum rule: CRC16-XMODEM over the body, or over everything before the checksum in the mixer's file.
The defaults are rekordbox's bytes, not rekordcrate's. rekordbox writes the header version as 0.001 in both player files and 1.000 in the mixer's. rekordcrate's default constructors write 6.6.1 in all four. Booth starts from rekordbox's own empty-export files, byte for byte, and a test holds them.
Checked by a reader that shares no code with the writer. The tests write every value of every setting and read the file back with rekordcrate. Each one comes back byte for byte when rekordcrate writes it out again, and it changes only the setting rekordcrate names the same way. An ignored test reads the 74 fixtures, in the same style as the audit's.
Whose a file is depends on what Booth put there, not on the header. PP-32's note suggested going by a non-rekordbox header. Nobody here has seen the header a player writes when it saves, so a rule built on it would be a guess. A byte-for-byte match against Booth's own last write is a fact.
Decided before writing, as the rest of the sync is. The plan works from the drive's record alone, so it stays a function a test can build. The sheet and the write read the stick itself, which is the only thing that knows whether a player has saved since. The export writes whatever files it is given and reads each one back.
The record changes when the write reports back, not before. I found this by reading my own diff. If the record were written first, a failed write would leave Booth's old file on the stick under a record naming the new one. The next sync would then keep the old file as the drive's own, forever.
The other ways, and why they lost
Worth a second opinion
booth-cli settingson a stick a CDJ-3000 has saved to would also show whether it writes bytes nobody has named.Gates pass:
cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings, andenv -u BOOTH_WHISPER_MODEL -u BOOTH_WHISPER_BIN -u BOOTH_GENRE_MODEL cargo test --workspace(31 test binaries, including the newmy_settings). The ignored fixture test passes against rekordcrate's 74 files.Generated by Claude Code