#[repr(u32)]pub enum TimeUnit {
MS = 1,
PCM = 2,
PCMBytes = 4,
RawBytes = 8,
PCMFraction = 16,
ModOrder = 256,
ModRow = 512,
ModPattern = 1_024,
}
Expand description
Time types used for position or length.
Variants§
MS = 1
Milliseconds.
PCM = 2
PCM samples, related to milliseconds * samplerate / 1000.
PCMBytes = 4
Bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes).
RawBytes = 8
Raw file bytes of (compressed) sound data (does not include headers).
Only used by Sound::get_length
and Channel::get_position
.
PCMFraction = 16
Fractions of 1 PCM sample. Unsigned int range 0 to 0xFFFFFFFF
.
Used for sub-sample granularity for DSP purposes.
ModOrder = 256
MOD/S3M/XM/IT. Order in a sequenced module format.
Use Sound::get_format
to determine the PCM format being decoded to.
ModRow = 512
MOD/S3M/XM/IT. Current row in a sequenced module format.
Cannot use with Channel::set_position
.
Sound::get_length
will return the number of rows in the currently playing or seeked to pattern.
ModPattern = 1_024
MOD/S3M/XM/IT. Current pattern in a sequenced module format.
Cannot use with Channel::set_position
.
Sound::get_length
will return the number of patterns in the song and Channel::get_position
will return the currently playing pattern.
Trait Implementations§
Source§impl TryFromPrimitive for TimeUnit
impl TryFromPrimitive for TimeUnit
Source§impl UnsafeFromPrimitive for TimeUnit
impl UnsafeFromPrimitive for TimeUnit
type Primitive = u32
Source§unsafe fn unchecked_transmute_from(number: Self::Primitive) -> Self
unsafe fn unchecked_transmute_from(number: Self::Primitive) -> Self
Source§unsafe fn from_unchecked(number: Self::Primitive) -> Self
unsafe fn from_unchecked(number: Self::Primitive) -> Self
unchecked_transmute_from
, from_unchecked
will be removed in a future release.