cd_da_reader/data_reader/read_speed.rs
1/// A platform-independent read-speed request for an optical drive.
2///
3/// The requested speed is a preference, not a guarantee. Under MMC, a drive may
4/// select the requested rate or a higher supported rate; the OS and drive
5/// firmware may further adjust or reject the request.
6///
7/// A successful speed change may remain active for subsequent reads. This crate
8/// does not restore the previous setting, although the OS, firmware, or other
9/// software may change it later.
10#[derive(Debug, Clone, Copy)]
11pub enum ReadSpeed {
12 /// Do not issue a speed-change request.
13 ///
14 /// This is the default in [`ReadOptions`](crate::ReadOptions). The drive
15 /// retains whatever speed was previously selected by the OS, firmware, or
16 /// another application.
17 Unchanged,
18
19 /// Ask the platform and drive to select an automatic or optimal read speed.
20 ///
21 /// On macOS and Windows, this uses the `0xFFFF` drive-selected/maximum-speed
22 /// sentinel associated with `SET CD SPEED` (`0xBB`). On Linux,
23 /// `CDROM_SELECT_SPEED` is called with a speed of zero to request automatic
24 /// selection.
25 Optimal,
26
27 /// Request a multiple of the nominal CD-DA 1× rate.
28 ///
29 /// One unit represents 176.4 kB/s, so `CustomMultiplier(1)` requests 1× and
30 /// `CustomMultiplier(10)` requests 10×. macOS and Windows convert the
31 /// multiplier to kB/s, while Linux passes it as a speed multiplier.
32 ///
33 /// `CustomMultiplier(0)` is equivalent to [`Optimal`](Self::Optimal).
34 CustomMultiplier(u8),
35}