Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions examples/save_data_track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use std::fs::File;
use std::io::{BufWriter, Write};
use std::path::Path;

use cd_da_reader::{CdReader, SectorReadFormat, Toc, TrackStreamOptions};
use cd_da_reader::{CdReader, ReadOptions, SectorReadFormat, Toc};

fn main() -> Result<(), Box<dyn std::error::Error>> {
let output_dir = common::fresh_output_dir("save_data_track")?;
Expand Down Expand Up @@ -96,8 +96,8 @@ fn stream_track_to_file(
format: SectorReadFormat,
path: &Path,
) -> Result<u64, Box<dyn std::error::Error>> {
let options = TrackStreamOptions::default().with_format(format);
let mut stream = reader.open_track_stream_with_options(toc, track_no, options)?;
let options = ReadOptions::default().with_format(format);
let mut stream = reader.open_track_stream_with_options(toc, track_no, &options)?;

let total_sectors = stream.total_sectors();
let mut writer = BufWriter::new(File::create(path)?);
Expand Down
6 changes: 3 additions & 3 deletions src/data_reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ pub use sector_read_format::SectorReadFormat;
use crate::retry::RetryConfig;
use crate::{CdReaderError, Track};

/// Sector format, retry policy, and read speed options for track and
/// sector-range reads.
/// Sector format, retry policy, and read speed options for track, streaming,
/// and sector-range reads.
///
/// The defaults read audio sectors using the default retry policy and leave the
/// drive's current read speed unchanged. Use the builder methods to override
Expand All @@ -37,7 +37,7 @@ impl ReadOptions {
}

/// Set the read speed to request from the drive. See [`ReadSpeed`] for
/// details.
/// details. Streaming reads apply this request once when the stream is opened.
///
/// # Note
/// For simplicity, this crate doesn't restore the previous speed setting.
Expand Down
9 changes: 5 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@
//!
//! ## Read options
//!
//! [`CdReader::read_track`] uses sensible defaults for audio CDs and should be enough to get
//! started. For more control, build [`ReadOptions`] from its defaults and pass it to
//! [`CdReader::read_track_with_options`]. The configurable options are:
//! [`CdReader::read_track`] and [`CdReader::open_track_stream`] use sensible defaults for audio
//! CDs and should be enough to get started. For more control, build [`ReadOptions`] from its
//! defaults and pass it to [`CdReader::read_track_with_options`] or
//! [`CdReader::open_track_stream_with_options`]. The configurable options are:
//!
//! - **Sector format:** [`SectorReadFormat::Audio`] returns 2,352 bytes of PCM per sector and is
//! the default. Data tracks can be read as the 2,048-byte [`SectorReadFormat::Mode1Cooked`]
Expand Down Expand Up @@ -189,7 +190,7 @@ pub use data_reader::{ReadOptions, ReadSpeed, SectorReadFormat};
pub use discovery::DriveInfo;
pub use errors::{CdReaderError, ScsiError, ScsiOp};
pub use retry::RetryConfig;
pub use stream::{TrackStream, TrackStreamOptions};
pub use stream::TrackStream;

mod parse_toc;
pub use parse_toc::lba_to_msf;
Expand Down
Loading
Loading