Crates.io | cdtoc |
lib.rs | cdtoc |
version | |
source | src |
created_at | 2022-12-26 07:25:19.513798 |
updated_at | 2024-11-28 19:37:47.015959 |
description | Parser and tools for CDTOC metadata tags. |
homepage | |
repository | https://github.com/Blobfolio/cdtoc |
max_upload_size | |
id | 745670 |
Cargo.toml error: | TOML parse error at line 26, column 1 | 26 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
CDTOC is a simple Rust library for parsing and working with audio CD tables of contents, namely in the form of CDTOC-style metadata values.
By default it can also generate disc IDs for services like AccurateRip, CDDB, CUETools Database, and MusicBrainz, but you can disable the corresponding crate feature(s) — accuraterip
, cddb
, ctdb
, and musicbrainz
respectively — to shrink the dependency tree if you don't need that functionality.
use cdtoc::Toc;
// From a CDTOC string.
let toc1 = Toc::from_cdtoc("4+96+2D2B+6256+B327+D84A").unwrap();
// From the raw parts.
let toc2 = Toc::from_parts(
vec![150, 11563, 25174, 45863],
None,
55370,
).unwrap();
// Either way gets you to the same place.
assert_eq!(toc1, toc2);
// You can also get a CDTOC-style string back at any time:
assert_eq!(toc1.to_string(), "4+96+2D2B+6256+B327+D84A");
The optional serde
crate feature can be enabled to expose de/serialization implementations for this library's types:
Type | Format | Notes |
---|---|---|
AccurateRip |
String |
|
Cddb |
String |
|
Duration |
u64 |
|
ShaB64 |
String |
MusicBrainz and CTDB IDs. |
Toc |
String |
|
Track |
Map |
|
TrackPosition |
String |
Add cdtoc
to your dependencies
in Cargo.toml
, like:
[dependencies]
cdtoc = "0.5.*"
The disc ID helpers require additional dependencies, so if you aren't using them, be sure to disable the default features (adding back any you do want) to skip the overhead.
[dependencies.cdtoc]
version = "0.5.*"
default-features = false