pub struct Sample { /* private fields */ }
Expand description
Represents parameters in the sample page of a sound.
Implementations§
source§impl Sample
impl Sample
sourcepub fn set_tune(&mut self, tune: isize) -> Result<(), RytmError>
pub fn set_tune(&mut self, tune: isize) -> Result<(), RytmError>
Sets the coarse tune of the sample.
Range: -24..=24
sourcepub fn set_fine_tune(&mut self, fine_tune: isize) -> Result<(), RytmError>
pub fn set_fine_tune(&mut self, fine_tune: isize) -> Result<(), RytmError>
Sets the fine tune of the sample.
Range: -64..=63
sourcepub fn set_slice_number(&mut self, number: usize) -> Result<(), RytmError>
pub fn set_slice_number(&mut self, number: usize) -> Result<(), RytmError>
Sets the slice number of the sample.
Range: 0..=127
sourcepub fn unset_slice(&mut self)
pub fn unset_slice(&mut self)
Unsets the sample slice.
Synonym with SMP OFF
.
sourcepub fn set_bit_reduction(
&mut self,
bit_reduction: usize
) -> Result<(), RytmError>
pub fn set_bit_reduction( &mut self, bit_reduction: usize ) -> Result<(), RytmError>
Sets the bit reduction of the sample.
Range: 0..=127
sourcepub fn set_start(&mut self, start: f32) -> Result<(), RytmError>
pub fn set_start(&mut self, start: f32) -> Result<(), RytmError>
Sets the start of the sample.
Range: 0.0..=120.0
sourcepub fn set_end(&mut self, end: f32) -> Result<(), RytmError>
pub fn set_end(&mut self, end: f32) -> Result<(), RytmError>
Sets the end of the sample.
Range: 0.0..=120.0
sourcepub fn set_loop_flag(&mut self, loop_flag: bool)
pub fn set_loop_flag(&mut self, loop_flag: bool)
Sets the loop flag of the sample.
sourcepub fn set_volume(&mut self, volume: usize) -> Result<(), RytmError>
pub fn set_volume(&mut self, volume: usize) -> Result<(), RytmError>
Sets the volume of the sample.
Range: 0..=127
sourcepub const fn slice_number(&self) -> usize
pub const fn slice_number(&self) -> usize
Returns the slice number of the sample.
Range: 0..=127
sourcepub const fn bit_reduction(&self) -> usize
pub const fn bit_reduction(&self) -> usize
Returns the bit reduction of the sample.
Range: 0..=127
Trait Implementations§
source§impl<'de> Deserialize<'de> for Sample
impl<'de> Deserialize<'de> for Sample
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Sample
impl PartialEq for Sample
source§impl PartialOrd for Sample
impl PartialOrd for Sample
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<&ar_sound_t> for Sample
impl TryFrom<&ar_sound_t> for Sample
§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
impl Copy for Sample
impl StructuralPartialEq for Sample
Auto Trait Implementations§
impl RefUnwindSafe for Sample
impl Send for Sample
impl Sync for Sample
impl Unpin for Sample
impl UnwindSafe for Sample
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more