pub struct MultiUserEnvironment { /* private fields */ }Expand description
Multi-user spatial audio environment manager
Implementations§
Source§impl MultiUserEnvironment
impl MultiUserEnvironment
Sourcepub fn new(config: MultiUserConfig) -> Result<Self>
pub fn new(config: MultiUserConfig) -> Result<Self>
Create a new multi-user environment
Sourcepub fn add_user(&self, user: MultiUserUser) -> Result<()>
pub fn add_user(&self, user: MultiUserUser) -> Result<()>
Add a user to the environment
Sourcepub fn remove_user(
&self,
user_id: &UserId,
reason: DisconnectReason,
) -> Result<()>
pub fn remove_user( &self, user_id: &UserId, reason: DisconnectReason, ) -> Result<()>
Remove a user from the environment
Sourcepub fn update_user_position(
&mut self,
user_id: &UserId,
position: Position3D,
orientation: [f32; 4],
) -> Result<()>
pub fn update_user_position( &mut self, user_id: &UserId, position: Position3D, orientation: [f32; 4], ) -> Result<()>
Update user position
Sourcepub fn add_friend(&self, user_id: &UserId, friend_id: &UserId) -> Result<()>
pub fn add_friend(&self, user_id: &UserId, friend_id: &UserId) -> Result<()>
Add a friend relationship between two users
Sourcepub fn remove_friend(&self, user_id: &UserId, friend_id: &UserId) -> Result<()>
pub fn remove_friend(&self, user_id: &UserId, friend_id: &UserId) -> Result<()>
Remove a friend relationship between two users
Sourcepub fn are_friends(&self, user_id: &UserId, friend_id: &UserId) -> Result<bool>
pub fn are_friends(&self, user_id: &UserId, friend_id: &UserId) -> Result<bool>
Check if two users are friends
Sourcepub fn get_friends(&self, user_id: &UserId) -> Result<Vec<UserId>>
pub fn get_friends(&self, user_id: &UserId) -> Result<Vec<UserId>>
Get list of friends for a user
Sourcepub fn add_audio_source(&self, source: MultiUserAudioSource) -> Result<()>
pub fn add_audio_source(&self, source: MultiUserAudioSource) -> Result<()>
Add an audio source
Sourcepub fn remove_audio_source(
&self,
source_id: &SourceId,
reason: &str,
) -> Result<()>
pub fn remove_audio_source( &self, source_id: &SourceId, reason: &str, ) -> Result<()>
Remove an audio source
Sourcepub fn process_audio(&mut self) -> Result<HashMap<UserId, Vec<f32>>>
pub fn process_audio(&mut self) -> Result<HashMap<UserId, Vec<f32>>>
Process spatial audio for all users
Sourcepub fn metrics(&self) -> MultiUserMetrics
pub fn metrics(&self) -> MultiUserMetrics
Get current performance metrics
Sourcepub fn create_zone(&self, zone: SpatialZone) -> Result<()>
pub fn create_zone(&self, zone: SpatialZone) -> Result<()>
Create a spatial zone
Sourcepub fn check_permission(
&self,
user_id: &UserId,
permission: Permission,
) -> Result<bool>
pub fn check_permission( &self, user_id: &UserId, permission: Permission, ) -> Result<bool>
Check if user has permission for an action
Auto Trait Implementations§
impl Freeze for MultiUserEnvironment
impl !RefUnwindSafe for MultiUserEnvironment
impl !Send for MultiUserEnvironment
impl !Sync for MultiUserEnvironment
impl Unpin for MultiUserEnvironment
impl UnsafeUnpin for MultiUserEnvironment
impl !UnwindSafe for MultiUserEnvironment
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