dart_cue 0.0.6
dart_cue: ^0.0.6 copied to clipboard
A pure Dart CUE sheet parser and serialiser for album, track, and index metadata with lossless round-trip support and no runtime dependencies.
Changelog #
0.0.6 #
copyWithonCueSheet,CueFileandCueTrack. Returns a new instance with any named argument replaced; omitted fields keep their current value.CueTrack.copyWithcarriesendTimethrough and accepts a replacement for it.- JSON serialisation:
toJson()and staticfromJson(Map<String, Object?>)on all three model classes. MSF durations are written asmm:ss:ffstrings; enums as CUE labels; optional fields omitted when null. Round-trips losslessly —CueSheet.fromJson(sheet.toJson())equalssheet. Closes #7.
0.0.5 #
- Web platform support.
parseCueSheet,parseCueBytes,toCueStringand every model class now compile to JS and run in the browser. Filesystem access viaparseCueFileis behind conditional imports — available on the Dart VM and Flutter (mobile, desktop) as before; on the web it throwsUnsupportedErrorwith a clear message pointing callers atparseCueBytes. Closes #6. parseCueSheetWithDiagnostics(String)returns aParseResult { sheet, issues }with line-numbered warnings for unknown FILE/TRACK/FLAGS tokens, malformed INDEX/PREGAP/POSTGAP timestamps, out-of-place commands and non-numeric TRACK numbers. The defaultparseCueSheetstays permissive and silent. Structural checks (missingINDEX 01, non-monotonic track numbers, malformedCATALOG/ISRC, …) are also exposed asvalidateCueSheet(CueSheet)for hand-built sheets. New exported types:CueIssue,CueIssueSeverity,ParseResult. Thecueinfo validatesubcommand now uses the library implementation. Closes #4.
0.0.4 #
- Fix pub.dev scoring: escape angle brackets in
bin/cueinfo.dartdoc comments, wrap single-statementifbodies in blocks to satisfycurly_braces_in_flow_control_structures, and re-rundart formatacross the tree. No behavioural changes.
0.0.3 #
CueSheet.replayGainAlbumGain/replayGainAlbumPeakandCueTrack.replayGainTrackGain/replayGainTrackPeakconvenience getters. Strip an optionaldBsuffix (case-insensitive) from the gain values and returndouble?. Closes #5.
0.0.2 #
CueSheet,CueFileandCueTracknow have structural==,hashCodeandtoStringimplementations, so parsed sheets can be compared, put inSets, or keyed inMaps by their content. Equality covers every constructor field plus the mutableCueTrack.endTime. Closes #3.
0.0.1 #
Initial release.
Features #
- Parse CUE sheets from a
String(parseCueSheet), raw bytes (parseCueBytes) or a file path (parseCueFile). - Serialise a
CueSheetback to CUE-format text withtoCueString; lossless round-trip for all supported constructs. - Album-level metadata:
CATALOG,CDTEXTFILE,PERFORMER,SONGWRITER,TITLE, arbitrary and well-knownREMfields (GENRE,DATE/YEAR,DISCNUMBER,DISCID,COMMENT, …). CueSheet.barcodeconvenience getter that falls back throughCATALOG→REM UPC→REM BARCODEfor callers that just want the disc barcode regardless of which command the ripper used (#2).- File types:
WAVE,MP3,AIFF,AIFC,BINARY,MOTOROLA. - Track types:
AUDIO,CDG,MODE1/2048,MODE1/2352,MODE2/2336,MODE2/2352,CDI/2336,CDI/2352,DATA. - Track-level
TITLE,PERFORMER,SONGWRITER,ISRC,PREGAP,POSTGAP, multipleINDEXentries, track-scopedREMcomments (includingREPLAYGAIN_TRACK_*). FLAGS:DCP,4CH,PRE,SCMS,DATA.- MSF (
mm:ss:ff, 75 fps) parse/format with frame-accurate round-trip. - Automatic derivation of each track's
endTimeanddurationfrom the next track'sINDEX 01. - Encoding handling: UTF-8 / UTF-16 LE / UTF-16 BE byte-order marks detected and stripped; Latin-1 fallback for legacy Windows-ripper sheets.
- Permissive parser: malformed MSF values, unknown tokens, out-of-place commands and mixed-case keywords are tolerated without throwing.
cueinfoCLI (installable viadart pub global activate dart_cue) withinfo,validate,reformatandtrackssubcommands.- Parsed
CueSheetcollections (files,remComments,tracks,indices,flags) are unmodifiable, so the model is safe to share across isolates without defensive copies.