dart_cue 0.1.1 copy "dart_cue: ^0.1.1" to clipboard
dart_cue: ^0.1.1 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.1.1 #

  • Parser normalisation: a quoted CATALOG value is unquoted, and ISRC values are unquoted and upper-cased, so sheets from rippers that quote or lower-case these no longer fail validation.
  • validateCueSheet also checks INDEX numbers are in range (0-99).
  • CueTrack.fromJson now throws a FormatException on a malformed indices timestamp instead of silently substituting 00:00:00.
  • cueinfo CLI: --format given without a value reports "missing value" instead of "unknown option"; an invalid --format is rejected before the file is read; bare cueinfo prints usage to stderr (exit 2) while -h/--help keeps printing to stdout (exit 0).
  • CueIssueSeverity.error documented as reserved — the permissive parser and validateCueSheet currently only emit warnings.

0.1.0 #

  • Breaking: CueSheet, CueFile and CueTrack constructors now defensively copy their collection arguments (files, remComments, tracks, flags, indices) into unmodifiable collections, and the defaults for omitted arguments are unmodifiable too. Previously only parsed sheets were unmodifiable; hand-built models exposed the caller's live mutable collections, so copyWith copies shared mutable state with their source. Code that built a model and mutated its collections afterwards (e.g. sheet.files.add(...)) will now throw UnsupportedError — build the full collection first and pass it to the constructor, or use copyWith with a replacement collection.

  • Writer: values that are empty or contain a double quote are now written quoted (FILE "" WAVE, TITLE "ab"cd"), so such sheets survive a write → parse round-trip instead of losing the FILE entry or emitting ambiguous output. CUE has no escape syntax for embedded quotes; the value is wrapped verbatim, which the parser reads back losslessly.

  • formatMsf no longer drops the sign of a negative duration: a corrupt sheet whose INDEX 01 times run backwards now formats its (negative) track duration as -mm:ss:ff instead of a plausible-looking positive value.

  • Diagnostics: parseCueSheetWithDiagnostics now reports lines that match no CUE command at all ("unrecognised line") and duplicate INDEX numbers within a track (later value still wins). A bare REM line is treated as an empty comment and not reported.

  • validateCueSheet additionally checks that INDEX 01 times increase monotonically across the tracks of each FILE.

  • Dev dependencies: lints 4 → 6; removed the now-flagged library name from lib/dart_cue.dart.

  • GitHub Actions CI (.github/workflows/ci.yml): format check, analyser with --fatal-warnings, test matrix (Ubuntu/macOS/Windows × Dart stable & beta), web-compile smoke test, dartdoc dry-run and pub publish --dry-run.

  • GitHub Actions release workflow (.github/workflows/release.yml): on v* tag push, compiles the cueinfo binary for linux-x64, macos-arm64 and windows-x64, packages it and attaches the artefacts to the GitHub release.

  • dart_test.yaml documents the cli tag used by the subprocess integration tests.

0.0.6 #

  • copyWith on CueSheet, CueFile and CueTrack. Returns a new instance with any named argument replaced; omitted fields keep their current value. CueTrack.copyWith carries endTime through and accepts a replacement for it.
  • JSON serialisation: toJson() and static fromJson(Map<String, Object?>) on all three model classes. MSF durations are written as mm:ss:ff strings; enums as CUE labels; optional fields omitted when null. Round-trips losslessly — CueSheet.fromJson(sheet.toJson()) equals sheet. Closes #7.

0.0.5 #

  • Web platform support. parseCueSheet, parseCueBytes, toCueString and every model class now compile to JS and run in the browser. Filesystem access via parseCueFile is behind conditional imports — available on the Dart VM and Flutter (mobile, desktop) as before; on the web it throws UnsupportedError with a clear message pointing callers at parseCueBytes. Closes #6.
  • parseCueSheetWithDiagnostics(String) returns a ParseResult { 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 default parseCueSheet stays permissive and silent. Structural checks (missing INDEX 01, non-monotonic track numbers, malformed CATALOG/ISRC, …) are also exposed as validateCueSheet(CueSheet) for hand-built sheets. New exported types: CueIssue, CueIssueSeverity, ParseResult. The cueinfo validate subcommand now uses the library implementation. Closes #4.

0.0.4 #

  • Fix pub.dev scoring: escape angle brackets in bin/cueinfo.dart doc comments, wrap single-statement if bodies in blocks to satisfy curly_braces_in_flow_control_structures, and re-run dart format across the tree. No behavioural changes.

0.0.3 #

  • CueSheet.replayGainAlbumGain / replayGainAlbumPeak and CueTrack.replayGainTrackGain / replayGainTrackPeak convenience getters. Strip an optional dB suffix (case-insensitive) from the gain values and return double?. Closes #5.

0.0.2 #

  • CueSheet, CueFile and CueTrack now have structural ==, hashCode and toString implementations, so parsed sheets can be compared, put in Sets, or keyed in Maps by their content. Equality covers every constructor field plus the mutable CueTrack.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 CueSheet back to CUE-format text with toCueString; lossless round-trip for all supported constructs.
  • Album-level metadata: CATALOG, CDTEXTFILE, PERFORMER, SONGWRITER, TITLE, arbitrary and well-known REM fields (GENRE, DATE/YEAR, DISCNUMBER, DISCID, COMMENT, …).
  • CueSheet.barcode convenience getter that falls back through CATALOGREM UPCREM BARCODE for 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, multiple INDEX entries, track-scoped REM comments (including REPLAYGAIN_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 endTime and duration from the next track's INDEX 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.
  • cueinfo CLI (installable via dart pub global activate dart_cue) with info, validate, reformat and tracks subcommands.
  • Parsed CueSheet collections (files, remComments, tracks, indices, flags) are unmodifiable, so the model is safe to share across isolates without defensive copies.
0
likes
160
points
65
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A pure Dart CUE sheet parser and serialiser for album, track, and index metadata with lossless round-trip support and no runtime dependencies.

Repository (GitHub)
View/report issues

Topics

#cue #audio #parser #cd #metadata

License

Apache-2.0 (license)

More

Packages that depend on dart_cue