1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// Copyright (C) 2026 Dylan Jones
// SPDX-License-Identifier: GPL-3.0-only
//! [![github]](https://github.com/dylanljones/rbox) [![crates-io]](https://crates.io/crates/rbox) [![docs-rs]](https://docs.rs/rbox)
//!
//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github
//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
//!
//! <br>
//!
//! > rbox gives you full control of your Rekordbox data.
//!
//! <br>
//!
//! This crate provides a comprehensive set of tools to interact with Rekordbox data, including
//! - [`MasterDb`] for managing the local Rekordbox database.
//! - [`OneLibrary`] for managing One Library (Device Library Plus) SQLite databases.
//! - [`Anlz`] for reading and writing ANLZ files.
//! - [`RekordboxXml`] for parsing and manipulating Rekordbox XML files.
//! - [`Setting`] for managing Rekordbox settings.
//!
//! > **❗ Caution**:
//! > Please make sure to back up your Rekordbox collection before making changes to rekordbox data.
//! > The backup dialog can be found under "File" > "Library" > "Backup Library"
//!
//! ## Sub-crate documentation
//!
//! rbox re-exports the following crates. Their documentation covers the underlying APIs in detail.
//!
//! | Crate | Purpose |
//! | --- | --- |
//! | [`rbox-core`](rbox_core) | Shared track models, paths, library discovery, and options |
//! | [`rbox-db`](rbox_db) | Database connections, model traits, ordering, and relationships |
//! | [`rbox-masterdb`](rbox_masterdb) | Rekordbox `master.db`, playlists, and smart lists |
//! | [`rbox-onelib`](rbox_onelib) | One Library (Device Library Plus) export databases |
//! | [`rbox-anlz`](rbox_anlz) | Analysis files, waveforms, beat grids, and cues |
//! | [`rbox-xml`](rbox_xml) | Rekordbox XML libraries |
//! | [`rbox-setting`](rbox_setting) | Rekordbox and device settings files |
//!
//! ## Features
//!
//! By default, rbox enables all file and database components (`full`) and builds SQLCipher
//! with vendored OpenSSL (`bundled-vendored-openssl`). Core models, paths, and library
//! discovery are always available, including with `default-features = false`.
//!
//! | Feature | Effect | Enabled by default |
//! | --- | --- | --- |
//! | `full` | Enables `master-db`, `one-library`, `anlz`, `xml`, and `settings` | Yes |
//! | `master-db` | Enables `masterdb`, shared `db` APIs, and `anlz`; adds master database integration to `one_library` when it is also enabled | Yes, via `full` |
//! | `one-library` | Enables `one_library` and shared `db` APIs | Yes, via `full` |
//! | `anlz` | Enables analysis file APIs in `anlz` | Yes, via `full` |
//! | `xml` | Enables XML library APIs in `xml` | Yes, via `full` |
//! | `settings` | Enables settings file APIs in `settings` | Yes, via `full` |
//! | `bundled` | Builds SQLCipher from source without vendoring OpenSSL | No |
//! | `bundled-vendored-openssl` | Builds both SQLCipher and OpenSSL from source | Yes |
//! | `pyo3` | Enables Python binding support in core and enabled database components | No |
//! | `napi` | Enables JavaScript binding support in core and enabled database components | No |
//!
//! The SQLCipher build features require `master-db` or `one-library`; they do not enable
//! either component themselves. With database support enabled and neither build feature
//! selected, a system SQLCipher installation is required. Binding features also configure
//! only the components already enabled. `full` does not select a SQLCipher build strategy
//! or enable binding support.
//!
//! Disable the defaults to select only the components and build options you need:
//!
//! ```toml
//! [dependencies]
//! # Analysis and XML files only; no database dependencies.
//! rbox = { version = "0.2", default-features = false, features = ["anlz", "xml"] }
//! ```
//!
//! For example, use `features = ["master-db", "bundled-vendored-openssl"]` with defaults
//! disabled for master database support, its required analysis APIs, and bundled native
//! dependencies. Cargo features are additive: selecting `bundled` alone does not turn off
//! the default `bundled-vendored-openssl` feature.
//!
//! ## Rekordbox 6/7 database
//!
//! rbox can unlock the new Rekordbox `master.db` SQLite database and provides
//! an easy interface for accessing and updating the data stored in it.
//!
//! ```no_run
//! use rbox::prelude::*;
//!
//! fn main() -> anyhow::Result<()> {
//! let mut db = MasterDb::open()?;
//! let contents = db.get_contents()?;
//! for content in contents {
//! println!("{:?}", content);
//! }
//! Ok(())
//! }
//! ```
//!
//! ## Rekordbox XML
//!
//! rbox can read and write Rekordbox XML databases.
//!
//! ```no_run
//! use rbox::prelude::*;
//!
//! fn main() -> anyhow::Result<()> {
//! let mut xml = RekordboxXml::load("database.xml")?;
//! let tracks = xml.get_tracks();
//! for track in tracks {
//! println!("{:?}", track);
//! }
//! Ok(())
//! }
//! ```
//!
//! ## Rekordbox ANLZ files
//!
//! rbox lazily reads all three analysis formats. Opening indexes section headers;
//! getters decode sections on demand and can return I/O or parsing errors.
//! Shared `get_*` access leaves sections untouched; mutable `get_mut_*` access marks
//! them for serialization. Saves stream all other sections from the source file
//! in their original order. Do not edit that file externally while it is open.
//! Use `get_section(index)` / `get_mut_section(index)` for low-level access,
//! or `into_data()` to materialize the complete file.
//!
//! ```no_run
//! use rbox::prelude::*;
//!
//! fn main() -> anyhow::Result<()> {
//! let mut anlz = Anlz::load("ANLZ0000.DAT")?;
//! let grid = anlz.get_beat_grid()?.unwrap();
//! for beat in &grid.beats {
//! println!("Beat: {} Tempo: {} Time: {}", beat.beat_number, beat.tempo, beat.time);
//! }
//! Ok(())
//! }
//! ```
//!
//! ## Rekordbox Settings
//!
//! rbox supports both parsing and writing of Setting files
//!
//! ```no_run
//! use rbox::prelude::*;
//! use rbox::settings::Quantize;
//!
//! fn main() -> anyhow::Result<()> {
//! let mut sett = Setting::load("MYSETTING.DAT")?;
//! println!("Quantize: {}", sett.get_quantize()?);
//! sett.set_quantize(Quantize::Off)?;
//! sett.dump()?;
//! Ok(())
//! }
//! ```
//!
// Compile-time feature validation
compile_error!;
pub use ;
pub use rbox_anlz as anlz;
pub use rbox_core as core;
pub use rbox_db as db;
pub use rbox_masterdb as masterdb;
pub use rbox_onelib as one_library;
pub use rbox_setting as settings;
pub use rbox_xml as xml;
// Core exports
pub use *;
// anlz exports
pub use Anlz;
// shared db exports
pub use ;
// masterdb exports
pub use ;
// onelib exports
pub use OneLibrary;
// settings exports
pub use Setting;
// xml exports
pub use RekordboxXml;