pub trait SceneItemExtSceneTrait {
// Required methods
fn add_source<T: ObsSourceTrait + Clone + 'static>(
&mut self,
source: T,
) -> Result<ObsSceneItemRef<T>, ObsError>;
fn add_and_create_source(
&mut self,
info: SourceInfo,
) -> Result<ObsSceneItemRef<ObsSourceRef>, ObsError>;
fn get_source_mut(
&self,
name: &str,
) -> Result<Option<Arc<Box<dyn ObsSourceTrait>>>, ObsError>;
fn remove_every_item_of_source<T: ObsSourceTrait>(
&mut self,
source: T,
) -> Result<(), ObsError>;
fn remove_scene_item<K: SceneItemTrait>(
&mut self,
scene_item: K,
) -> Result<(), ObsError>;
fn remove_all_sources(&mut self) -> Result<(), ObsError>;
fn get_scene_item_ptr<T: ObsSourceTrait + Clone>(
&self,
source: &T,
) -> Result<Vec<Arc<Box<dyn SceneItemTrait>>>, ObsError>;
}Required Methods§
Sourcefn add_source<T: ObsSourceTrait + Clone + 'static>(
&mut self,
source: T,
) -> Result<ObsSceneItemRef<T>, ObsError>
fn add_source<T: ObsSourceTrait + Clone + 'static>( &mut self, source: T, ) -> Result<ObsSceneItemRef<T>, ObsError>
Adds the specified source to this scene. Returns a reference to the created scene item. You can use that SceneItemPtr to manipulate the source within this scene (position, scale, rotation, etc).
Sourcefn add_and_create_source(
&mut self,
info: SourceInfo,
) -> Result<ObsSceneItemRef<ObsSourceRef>, ObsError>
fn add_and_create_source( &mut self, info: SourceInfo, ) -> Result<ObsSceneItemRef<ObsSourceRef>, ObsError>
Creates and adds a source to this scene based on the given SourceInfo.
Returns a reference to the created scene item, which internally holds the created source.
Sourcefn get_source_mut(
&self,
name: &str,
) -> Result<Option<Arc<Box<dyn ObsSourceTrait>>>, ObsError>
fn get_source_mut( &self, name: &str, ) -> Result<Option<Arc<Box<dyn ObsSourceTrait>>>, ObsError>
Gets a source by name from this scene. Returns None if no source with the given name exists in this scene.
Sourcefn remove_every_item_of_source<T: ObsSourceTrait>(
&mut self,
source: T,
) -> Result<(), ObsError>
fn remove_every_item_of_source<T: ObsSourceTrait>( &mut self, source: T, ) -> Result<(), ObsError>
Removes the given source from this scene. Removes the corresponding scene item as well. It may be possible that this source is still added to another scene.
Sourcefn remove_scene_item<K: SceneItemTrait>(
&mut self,
scene_item: K,
) -> Result<(), ObsError>
fn remove_scene_item<K: SceneItemTrait>( &mut self, scene_item: K, ) -> Result<(), ObsError>
Removes a specific scene item from this scene.
Sourcefn remove_all_sources(&mut self) -> Result<(), ObsError>
fn remove_all_sources(&mut self) -> Result<(), ObsError>
Removes all sources from this scene.
Sourcefn get_scene_item_ptr<T: ObsSourceTrait + Clone>(
&self,
source: &T,
) -> Result<Vec<Arc<Box<dyn SceneItemTrait>>>, ObsError>
fn get_scene_item_ptr<T: ObsSourceTrait + Clone>( &self, source: &T, ) -> Result<Vec<Arc<Box<dyn SceneItemTrait>>>, ObsError>
Gets the underlying scene item pointers for the given source in this scene.
A scene item is basically the representation of a source within this scene. It holds information about the position, scale, rotation, etc.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.