cue_lib
Simple cue sheet parsing library with no_std by default.
cue_lib is mainly based on original CDRWIN document with some relaxed requirements:
- The limit for
TRACKandINDEXnumbers has been increased to 255 instead of 99 (wasting bits? in this economy!?) POSTGAPandPREGAPcommands can appear in any order within aTRACK.ISRCcommand can appear before, after, in betweenINDEXcommands.- The
FILEcommand must appear appear before anyTRACKcommand but can appear anywhere else. - The
CATALOGcommand is not limited to 13-digit UPC/EAN format, any validCueStris accepted. - When
metadatafeature is enabled,REMwith Vorbis comments can be read as additional metadata for both album and tracks. - FLAC is allowed in the
FILEcommand as a file type.
cue_lib does not support EAC's cue sheet with multiple
FILEcommands.
Feature flags
| Feature Name | Description |
|---|---|
| default | Does not enable any additional feature (no_std) |
| alloc | Enables modules/types that uses dynamic memory allocation (e.g. parse) |
| metadata | Enables reading remarks as Vorbis comment, and provides helper types for ID3, Vorbis, and libav. |
| serde | Enables serde only for type serialization. |
| ean | Provides Ean13 utility type to parse 13 digits EAN-13 catalog codes. |
| upc | Provides UpcA utility type to parse 12 digits UPC-A catalog codes. |
Example - CuesheetParser
Requires
allocfeature
use CueLibError;
use CuesheetParser;
let cuesheet = r#"
PERFORMER "Rick Astley"
TITLE "Whenever You Need Somebody"
FILE "rick_astley_whenever_you_need_somebody.flac" WAVE
TRACK 01 AUDIO
TITLE "Never Gonna Give You Up"
PERFORMER "Rick Astley"
INDEX 00 00:00:00
INDEX 01 00:03:32
ISRC GBAYE0100001
TRACK 02 AUDIO
TITLE "Never Gonna Let You Down"
PERFORMER "Rick Astley"
INDEX 01 03:32:00
INDEX 02 04:32:00
ISRC GBAYE0100002
TRACK 03 AUDIO
TITLE "Never Gonna Run Around and Desert You"
PERFORMER "Rick Astley"
INDEX 01 07:04:00
ISRC GBAYE0100003
"#;
print_cue;
Example - CuesheetProbe
Low level API without any dynamic memory allocation. It basically attaches to cuesheet and allows progressively reading its content.
For more detailed explanation see probe module.
use CuesheetProbe;
use CueLibError;
let cuesheet = r#"
PERFORMER "Rick Astley"
TITLE "Whenever You Need Somebody"
FILE "rick_astley_whenever_you_need_somebody.flac" WAVE
TRACK 01 AUDIO
TITLE "Never Gonna Give You Up"
PERFORMER "Rick Astley"
INDEX 00 00:00:00
INDEX 01 00:03:32
ISRC GBAYE0100001
TRACK 02 AUDIO
TITLE "Never Gonna Let You Down"
PERFORMER "Rick Astley"
INDEX 01 03:32:00
INDEX 02 04:32:00
ISRC GBAYE0100002
TRACK 03 AUDIO
TITLE "Never Gonna Run Around and Desert You"
PERFORMER "Rick Astley"
INDEX 01 07:04:00
ISRC GBAYE0100003
"#;
print_cue;