pub struct HapticAudioProcessor { /* private fields */ }Expand description
Main haptic integration processor
Implementations§
Source§impl HapticAudioProcessor
impl HapticAudioProcessor
Sourcepub fn new(config: HapticAudioConfig) -> Self
pub fn new(config: HapticAudioConfig) -> Self
Create new haptic audio processor
Sourcepub fn add_device(&mut self, device: Box<dyn HapticDevice>) -> Result<()>
pub fn add_device(&mut self, device: Box<dyn HapticDevice>) -> Result<()>
Add haptic device
Sourcepub fn remove_device(&mut self, device_id: &str) -> Result<()>
pub fn remove_device(&mut self, device_id: &str) -> Result<()>
Remove haptic device
Sourcepub fn process_audio_frame(
&mut self,
audio_samples: &[f32],
audio_channel_type: AudioChannel,
spatial_positions: &[(String, Position3D)],
listener_position: Position3D,
) -> Result<()>
pub fn process_audio_frame( &mut self, audio_samples: &[f32], audio_channel_type: AudioChannel, spatial_positions: &[(String, Position3D)], listener_position: Position3D, ) -> Result<()>
Process audio frame and generate haptic feedback
Sourcepub fn trigger_pattern(
&mut self,
pattern_id: &str,
position: Option<Position3D>,
intensity_scale: f32,
) -> Result<()>
pub fn trigger_pattern( &mut self, pattern_id: &str, position: Option<Position3D>, intensity_scale: f32, ) -> Result<()>
Manually trigger haptic pattern
Sourcepub fn metrics(&self) -> &HapticMetrics
pub fn metrics(&self) -> &HapticMetrics
Get current metrics
Sourcepub fn update_config(&mut self, config: HapticAudioConfig)
pub fn update_config(&mut self, config: HapticAudioConfig)
Update configuration
Auto Trait Implementations§
impl Freeze for HapticAudioProcessor
impl RefUnwindSafe for HapticAudioProcessor
impl Send for HapticAudioProcessor
impl Sync for HapticAudioProcessor
impl Unpin for HapticAudioProcessor
impl UnsafeUnpin for HapticAudioProcessor
impl UnwindSafe for HapticAudioProcessor
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more