Giter VIP home page Giter VIP logo

cdtoc's Introduction

CDTOC

docs.rs changelog
crates.io ci deps.rs
license contributions welcome

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.

Examples

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");

De/Serialization

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

Installation

Add cdtoc to your dependencies in Cargo.toml, like:

[dependencies]
cdtoc = "0.3.*"

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.3.*"
default-features = false

License

Copyright © 2024 Blobfolio, LLC <[email protected]>

This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <[email protected]>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

0. You just DO WHAT THE FUCK YOU WANT TO.

cdtoc's People

Contributors

joshstoik1 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.