pub struct ObsSceneRef { /* private fields */ }Implementations§
Source§impl ObsSceneRef
impl ObsSceneRef
pub fn name(&self) -> &ObsString
pub fn sources(&self) -> &Arc<RwLock<HashSet<ObsSourceRef>>>
pub fn signals(&self) -> &Arc<ObsSceneSignals>
pub fn sources_mut(&mut self) -> &mut Arc<RwLock<HashSet<ObsSourceRef>>>
Source§impl ObsSceneRef
impl ObsSceneRef
pub fn add_and_set(&self, channel: u32) -> Result<(), ObsError>
Sourcepub fn set_to_channel(&self, channel: u32) -> Result<(), ObsError>
pub fn set_to_channel(&self, channel: u32) -> Result<(), ObsError>
Sets this scene to a given output channel. There are 64 channels that you can assign scenes to, which will draw on top of each other in ascending index order.
Sourcepub fn remove_from_channel(&self, channel: u32) -> Result<(), ObsError>
pub fn remove_from_channel(&self, channel: u32) -> Result<(), ObsError>
Removes a scene from a given output channel, for more info about channels see set_to_channel.
Sourcepub fn get_scene_source_ptr(
&self,
) -> Result<Sendable<*mut obs_source_t>, ObsError>
pub fn get_scene_source_ptr( &self, ) -> Result<Sendable<*mut obs_source_t>, ObsError>
Gets the underlying source pointer of this scene, which is used internally when setting it to a channel.
Sourcepub fn add_source(&mut self, info: SourceInfo) -> Result<ObsSourceRef, ObsError>
pub fn add_source(&mut self, info: SourceInfo) -> Result<ObsSourceRef, ObsError>
Adds and creates the specified source to this scene. Returns a reference to the created source. The source is also stored internally in this scene.
If you need to remove the source later, use remove_source.
Sourcepub fn get_source_mut(
&self,
name: &str,
) -> Result<Option<ObsSourceRef>, ObsError>
pub fn get_source_mut( &self, name: &str, ) -> Result<Option<ObsSourceRef>, ObsError>
Gets a source by name from this scene. Returns None if no source with the given name exists in this scene.
Sourcepub fn remove_source(&mut self, source: &ObsSourceRef) -> Result<(), ObsError>
pub fn remove_source(&mut self, source: &ObsSourceRef) -> 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.
Sourcepub fn add_scene_filter(
&self,
source: &ObsSourceRef,
filter_ref: &ObsFilterRef,
) -> Result<(), ObsError>
pub fn add_scene_filter( &self, source: &ObsSourceRef, filter_ref: &ObsFilterRef, ) -> Result<(), ObsError>
Adds a filter to the given source in this scene.
Sourcepub fn remove_scene_filter(
&self,
source: &ObsSourceRef,
filter_ref: &ObsFilterRef,
) -> Result<(), ObsError>
pub fn remove_scene_filter( &self, source: &ObsSourceRef, filter_ref: &ObsFilterRef, ) -> Result<(), ObsError>
Removes a filter from the this scene (internally removes the filter to the scene’s source).
Sourcepub fn get_scene_item_ptr(
&self,
source: &ObsSourceRef,
) -> Result<Sendable<*mut obs_scene_item>, ObsError>
pub fn get_scene_item_ptr( &self, source: &ObsSourceRef, ) -> Result<Sendable<*mut obs_scene_item>, ObsError>
Gets the underlying scene item pointer 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.
Sourcepub fn get_transform_info(
&self,
source: &ObsSourceRef,
) -> Result<ObsTransformInfo, ObsError>
pub fn get_transform_info( &self, source: &ObsSourceRef, ) -> Result<ObsTransformInfo, ObsError>
Gets the transform info of the given source in this scene.
Sourcepub fn get_source_position(
&self,
source: &ObsSourceRef,
) -> Result<Vec2, ObsError>
pub fn get_source_position( &self, source: &ObsSourceRef, ) -> Result<Vec2, ObsError>
Gets the position of the given source in this scene.
Sourcepub fn get_source_scale(&self, source: &ObsSourceRef) -> Result<Vec2, ObsError>
pub fn get_source_scale(&self, source: &ObsSourceRef) -> Result<Vec2, ObsError>
Gets the scale of the given source in this scene.
Sourcepub fn set_source_position(
&self,
source: &ObsSourceRef,
position: Vec2,
) -> Result<(), ObsError>
pub fn set_source_position( &self, source: &ObsSourceRef, position: Vec2, ) -> Result<(), ObsError>
Sets the position of the given source in this scene.
Sourcepub fn set_source_scale(
&self,
source: &ObsSourceRef,
scale: Vec2,
) -> Result<(), ObsError>
pub fn set_source_scale( &self, source: &ObsSourceRef, scale: Vec2, ) -> Result<(), ObsError>
Sets the scale of the given source in this scene.
Sourcepub fn set_transform_info(
&self,
source: &ObsSourceRef,
info: &ObsTransformInfo,
) -> Result<(), ObsError>
pub fn set_transform_info( &self, source: &ObsSourceRef, info: &ObsTransformInfo, ) -> Result<(), ObsError>
Sets the transform info of the given source in this scene.
The ObsTransformInfo can be built by using the ObsTransformInfoBuilder.
Sourcepub fn fit_source_to_screen(
&self,
source: &ObsSourceRef,
) -> Result<bool, ObsError>
pub fn fit_source_to_screen( &self, source: &ObsSourceRef, ) -> Result<bool, ObsError>
Fits the given source to the screen size. If the source is locked, no action is taken.
Returns Ok(true) if the source was resized, Ok(false) if the source was locked and not resized.
pub fn as_ptr(&self) -> Sendable<*mut obs_scene_t>
Trait Implementations§
Source§impl Clone for ObsSceneRef
impl Clone for ObsSceneRef
Source§fn clone(&self) -> ObsSceneRef
fn clone(&self) -> ObsSceneRef
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more