pub struct Settings { /* private fields */ }
Expand description

Represents settings in the analog rytm.

It does not map identically to the relevant structure in the firmware.

Settings may not be a familiar structure for all, to understand what kind of settings are available, please check the methods of this struct.

Implementations§

source§

impl Settings

source

pub fn set_bpm(&mut self, bpm: f32) -> Result<(), RytmError>

Sets the BPM for the entire project.

Range 30.0..=300.0

This is only effective when project level bpm is enabled.

source

pub fn set_selected_track( &mut self, track_index: usize ) -> Result<(), RytmError>

Sets the selected track.

Range 0..=11

source

pub fn set_selected_parameter_menu_item( &mut self, parameter_menu_item: ParameterMenuItem )

Sets the selected parameter menu item.

The six sequential square buttons on the right side of the Analog Rytm MKII.

source

pub fn set_selected_fx_menu_item(&mut self, fx_menu_item: FxParameterMenuItem)

Sets the selected fx menu item.

The six sequential square buttons on the right side of the Analog Rytm MKII.

The fx menu is only available when the FX button is pressed.

source

pub fn set_selected_page(&mut self, page_index: usize) -> Result<(), RytmError>

Sets the selected page.

The [PAGE] button on the Analog Rytm MKII.

Range 0..=3

source

pub fn set_selected_mode(&mut self, sequencer_mode: SequencerMode)

Sets the selected sequencer mode.

source

pub fn set_selected_pattern_mode(&mut self, pattern_mode: PatternMode)

Sets the selected pattern mode.

source

pub fn set_mute_flags(&mut self, mute_flags: u16) -> Result<(), RytmError>

Sets the mute flags for sounds.

Range 0..=0b1111_1111_1111

source

pub fn mute_sound(&mut self, sound_index: usize) -> Result<(), RytmError>

Mutes a sound by sound index.

Range 0..=11

source

pub fn unmute_sound(&mut self, sound_index: usize) -> Result<(), RytmError>

Unmute a sound by sound index.

Range 0..=11

source

pub fn toggle_mute_sound(&mut self, sound_index: usize) -> Result<(), RytmError>

Toggles the mute state of a sound by sound index.

Range 0..=11

source

pub fn mute_range_of_sounds( &mut self, range: Range<usize> ) -> Result<(), RytmError>

Mutes a range of sounds.

Maximum range 0..=11

Errors

Returns an error if the range is out of bounds.

source

pub fn unmute_range_of_sounds( &mut self, range: Range<usize> ) -> Result<(), RytmError>

Unmute a range of sounds.

Maximum range 0..=11

Errors

Returns an error if the range is out of bounds.

source

pub fn toggle_mute_range_of_sounds( &mut self, range: Range<usize> ) -> Result<(), RytmError>

Toggles the mute state of a range of sounds.

Maximum range 0..=11

Errors

Returns an error if the range is out of bounds.

source

pub fn set_fixed_velocity_enable(&mut self, fixed_velocity_enable: bool)

Sets the fixed velocity enable state.

source

pub fn set_fixed_velocity_amount( &mut self, fixed_velocity_amount: usize ) -> Result<(), RytmError>

Sets the fixed velocity amount.

Range 0..=127

source

pub fn set_sample_recorder_source( &mut self, sample_recorder_source: SampleRecorderSource )

Sets the sample recorder source.

source

pub fn set_sample_recorder_threshold( &mut self, sample_recorder_threshold: usize ) -> Result<(), RytmError>

Sets the sample recorder threshold.

Range 0..=127

source

pub fn set_sample_recorder_monitor_enable( &mut self, set_sample_recorder_monitor_enable: bool )

Sets the sample recorder monitor state.

source

pub fn set_sample_recorder_recording_length( &mut self, sample_recorder_recording_length: SampleRecorderRecordingLength )

Sets the sample recorder recording length.

source

pub const fn bpm(&self) -> f32

Returns the BPM for the entire project.

Range 30.0..=300.0

This is only effective when project level bpm is enabled.

source

pub const fn selected_track(&self) -> usize

Returns the selected track.

Range 0..=11

source

pub const fn selected_parameter_menu_item(&self) -> ParameterMenuItem

Returns the selected parameter menu item.

source

pub const fn selected_fx_menu_item(&self) -> FxParameterMenuItem

Returns the selected fx menu item.

source

pub const fn selected_page(&self) -> usize

Returns the selected page.

Range 0..=3

source

pub const fn selected_mode(&self) -> SequencerMode

Returns the selected sequencer mode.

source

pub const fn selected_pattern_mode(&self) -> PatternMode

Returns the selected pattern mode.

source

pub const fn raw_mute_flags(&self) -> u16

Returns the raw mute flags for sounds.

source

pub fn muted_sound_indexes(&self) -> Vec<usize>

Returns the collection of muted sound indexes.

source

pub fn unmuted_sound_indexes(&self) -> Vec<usize>

Returns the collection of unmuted sound indexes.

source

pub fn is_sound_muted(&self, sound_index: usize) -> Result<bool, RytmError>

Returns if a sound is muted by sound index.

source

pub const fn fixed_velocity_enabled(&self) -> bool

Returns the fixed velocity enable state.

source

pub const fn fixed_velocity_amount(&self) -> usize

Returns the fixed velocity amount.

Range 0..=127

source

pub const fn sample_recorder_source(&self) -> SampleRecorderSource

Returns the sample recorder source.

source

pub const fn sample_recorder_threshold(&self) -> usize

Returns the sample recorder threshold.

Range 0..=127

source

pub const fn sample_recorder_monitor_enabled(&self) -> bool

Returns the sample recorder monitor state.

source

pub const fn sample_recorder_recording_length( &self ) -> SampleRecorderRecordingLength

Returns the sample recorder recording length.

source

pub const fn structure_version(&self) -> u32

Returns the version of the settings structure.

Trait Implementations§

source§

impl Clone for Settings

source§

fn clone(&self) -> Settings

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Settings

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Settings

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Settings

source§

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 From<&Settings> for ar_settings_t

source§

fn from(settings: &Settings) -> Self

Converts to this type from the input type.
source§

impl Serialize for Settings

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl SysexCompatible for Settings

source§

fn as_sysex(&self) -> Result<Vec<u8>, RytmError>

Serializes the object to a sysex message. Read more
source§

fn sysex_type(&self) -> AnySysexType

Returns the sysex type of the object.
source§

impl Copy for Settings

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,