sacd-rs 0.1.2

SACD ripper client. Designed to be used with a jailbroken SACD player, such as specific models of PS3s or some Sony Bluray players, which can support running a server to stream raw SACD image data over the network to a client.
Documentation
pub mod sacd_reader;
pub mod scarletbook;

pub mod sacd_ripper {
    include!(concat!(env!("OUT_DIR"), "/libsacd.sacd_ripper.rs"));
}

#[cfg(test)]
mod tests {
    use indicatif::{ProgressBar, ProgressStyle};
    use std::net::{IpAddr, Ipv4Addr};
    use std::path::Path;

    use super::*;

    fn init() {
        let _ = env_logger::builder().is_test(true).try_init();
    }

    #[test]
    fn test_dump_iso() {
        init();
        let mut handle = sacd_reader::NetReader::open_network_reader(
            IpAddr::V4(Ipv4Addr::new(192, 168, 1, 130)),
            2002,
        )
        .expect("should init");

        let pb = ProgressBar::new(0);
        pb.set_style(
            ProgressStyle::default_bar()
                .template("{spinner:.green} [{bar:40.cyan/blue}] {pos}/{len} sectors ({percent}%)")
                .unwrap()
                .progress_chars("#>-"),
        );

        handle
            .dump_iso(
                Path::new("/var/home/bleggett/TEST.iso"),
                scarletbook::consts::SACD_LSN_SIZE,
                Some(|current, total| {
                    if pb.length().unwrap_or(0) == 0 {
                        pb.set_length(total as u64);
                    }
                    pb.set_position(current as u64);
                }),
            )
            .expect("write success");
        pb.finish_with_message("Complete!");
    }
}