pub enum Op<'a> {
Call {
object: u8,
inputs: &'a [u8],
outputs: u8,
},
Gain {
input: u8,
level: u8,
},
Mix {
left: u8,
right: u8,
},
}Expand description
A block-level signal graph instruction. Object IDs refer to stateful native instances installed by the application. A decoded call borrows its input bus indices directly from the bytecode.
Variants§
Call
Run a patch object once on the current audio block.
Fields
Gain
Scale one input bus and append the saturated result.
Mix
Append the saturating sum of two input buses.
Implementations§
Source§impl<'a> Op<'a>
impl<'a> Op<'a>
Sourcepub fn decode(bytes: &'a [u8]) -> Result<(Self, &'a [u8]), DecodeError>
pub fn decode(bytes: &'a [u8]) -> Result<(Self, &'a [u8]), DecodeError>
Decode the first instruction and return the unconsumed suffix.
§Errors
Returns DecodeError for an incomplete or unrecognized instruction.
Sourcepub fn encode(self, output: &mut [u8]) -> Result<usize, EncodeError>
pub fn encode(self, output: &mut [u8]) -> Result<usize, EncodeError>
Write one complete instruction and return the number of bytes written. The program’s leading version byte is supplied by the caller.
§Errors
Returns EncodeError before writing anything if the instruction
cannot be represented or the output buffer is too short.
Trait Implementations§
impl<'a> Copy for Op<'a>
impl<'a> Eq for Op<'a>
impl<'a> StructuralPartialEq for Op<'a>
Auto Trait Implementations§
impl<'a> Forget for Op<'a>
impl<'a> Freeze for Op<'a>
impl<'a> Move for Op<'a>
impl<'a> RefUnwindSafe for Op<'a>
impl<'a> Send for Op<'a>
impl<'a> Sync for Op<'a>
impl<'a> Unpin for Op<'a>
impl<'a> UnsafeUnpin for Op<'a>where
&'a [u8]: UnsafeUnpin,
impl<'a> UnwindSafe for Op<'a>where
&'a [u8]: UnwindSafe,
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