Skip to main content

Routing

Struct Routing 

Source
pub struct Routing { /* private fields */ }
Expand description

One of the ten ways the four engines can be wired.

The FX Routing byte picks one. enums names them the way the manual does, Parallel 1/2, parallel 3/4, which is for a person to read. This is the same ten topologies as edge lists, which is what a host draws a chain from.

use deepmind_midi::effect::{Engine, Routing, Source};

// M-1 is the four in series, and only the fourth reaches the output.
let serial = Routing::for_value(0).expect("ten topologies");
assert_eq!(serial.label(), "M-1");
assert_eq!(serial.feeds(Engine::One), &[Source::Input]);
assert_eq!(serial.feeds(Engine::Two), &[Source::Engine(Engine::One)]);
assert_eq!(serial.output(), &[Engine::Four]);
assert!(!serial.is_feedback());

Implementations§

Source§

impl Routing

Source

pub const fn parameter() -> ParamId

Returns the parameter holding which topology is selected.

Source

pub fn all() -> &'static [Self; 10]

Returns every topology, in the order the FX Routing byte numbers them.

Source

pub fn for_value(value: u8) -> Option<&'static Self>

Returns the topology the FX Routing byte selects.

None for a value the parameter does not accept. A lookup rather than an index, so a firmware that renumbers these has somewhere to say so, the way the value tables already do.

Source

pub const fn value(&self) -> u8

Returns the FX Routing value that selects this topology.

Source

pub const fn label(&self) -> &'static str

Returns the manual’s label for it, M-1 through M-10.

Source

pub const fn name(&self) -> &'static str

Returns the name the FX Routing value table gives it.

Source

pub fn feeds(&self, engine: Engine) -> &'static [Source]

Returns what reaches this engine: the block’s own input, or other engines.

Source

pub const fn output(&self) -> &'static [Engine]

Returns the engines whose outputs are summed to leave the block.

What decides whether an engine’s FX n Output Gain reaches the output: the manual defines a slot’s level as the level of an effect configured in parallel, or last before the output stage.

Source

pub const fn is_feedback(&self) -> bool

Returns whether any engine is in a loop around the main path.

Two of the ten are. A host drawing one of those without knowing it draws a wrong picture confidently.

Source

pub const fn note(&self) -> Option<&'static str>

Returns what the specification records about this topology beyond its graph, which is where the loop taps on the two that have one.

Trait Implementations§

Source§

impl Clone for Routing

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Routing

Source§

impl Debug for Routing

Source§

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

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

impl Display for Routing

Source§

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

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

impl Eq for Routing

Source§

impl Hash for Routing

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Routing

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Routing

Available on crate feature serde only.
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 StructuralPartialEq for Routing

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.