Skip to main content
← PSoXide SDK guides and examples · SDK 80d1c329e977 · All Cargo features enabled; check feature gates before use.

NullHw

Struct NullHw 

Source
pub struct NullHw;
Expand description

An Hw that ignores everything. Useful when only the bookkeeping is being measured.

§Example

use psx_sfx::hw::{Hw, NullHw};

NullHw.key_on(1);

Trait Implementations§

Source§

impl Clone for NullHw

Source§

fn clone(&self) -> NullHw

Returns a duplicate of the value. Read more
1.0.0§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NullHw

Source§

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

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

impl Default for NullHw

Source§

fn default() -> NullHw

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

impl Hw for NullHw

Source§

fn configure( &mut self, _voice: u8, _sample: &Sample, _looped: bool, _pitch_q12: u16, )

Point voice at sample without starting it. looped selects the hardware-loop setup; a one-shot also gets its repeat address written so it parks on silence. pitch_q12 is a multiplier of the cooked rate (4096 plays it as recorded).
Source§

fn set_volume(&mut self, _voice: u8, _left: i16, _right: i16)

Write a voice’s left and right volume (signed SPU levels, already scaled by the master volume).
Source§

fn set_pitch(&mut self, _voice: u8, _pitch_q12: u16)

Change a playing voice’s pitch multiplier (4096 = as cooked).
Source§

fn key_on(&mut self, _mask: u32)

Key on every voice in mask.
Source§

fn key_off(&mut self, _mask: u32)

Key off (release) every voice in mask.
Source§

impl Copy for NullHw

Auto Trait Implementations§

§

impl Freeze for NullHw

§

impl RefUnwindSafe for NullHw

§

impl Send for NullHw

§

impl Sync for NullHw

§

impl Unpin for NullHw

§

impl UnsafeUnpin for NullHw

§

impl UnwindSafe for NullHw

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

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

§

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
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.