pub struct ObsSceneRef { /* private fields */ }Expand description
This struct holds every ObsSourceRef that is attached to the scene by using add_source.
Implementations§
Source§impl ObsSceneRef
impl ObsSceneRef
Sourcepub fn add_discovered_source(
&mut self,
source_type: &SourceTypeInfo,
name: impl Into<ObsString>,
settings: Option<ObsData>,
) -> Result<ObsSceneItemRef<ObsSourceRef>, ObsError>
pub fn add_discovered_source( &mut self, source_type: &SourceTypeInfo, name: impl Into<ObsString>, settings: Option<ObsData>, ) -> Result<ObsSceneItemRef<ObsSourceRef>, ObsError>
Creates a source from a discovered descriptor and adds it directly to this scene.
Source§impl ObsSceneRef
impl ObsSceneRef
Sourcepub fn create_group(
&mut self,
name: impl Into<ObsString>,
) -> Result<ObsSceneGroupRef, ObsError>
pub fn create_group( &mut self, name: impl Into<ObsString>, ) -> Result<ObsSceneGroupRef, ObsError>
Creates an empty managed group at the top of this scene.
Sourcepub fn groups(&self) -> Result<Vec<ObsSceneGroupRef>, ObsError>
pub fn groups(&self) -> Result<Vec<ObsSceneGroupRef>, ObsError>
Returns all currently managed groups owned by this scene.
Sourcepub fn items_in_order(&self) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>
pub fn items_in_order(&self) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>
Returns top-level scene items in libobs’s actual bottom-to-top native order. Items inside a
group are enumerated by ObsSceneGroupRef::items_in_order instead.
Source§impl ObsSceneRef
impl ObsSceneRef
pub fn add_and_set(&self, channel: u32) -> Result<(), ObsError>
Use ObsSceneRef::set_to_channel instead
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.
pub fn object_id(&self) -> NativeObjectId
pub fn name(&self) -> ObsString
pub fn runtime(&self) -> &ObsRuntime
pub fn signals(&self) -> Arc<ObsSceneSignals> ⓘ
Sourcepub fn add<T>(&mut self, source: T) -> Result<ObsSceneItemRef<T>, ObsError>where
T: ObsSourceTrait + Clone + 'static,
pub fn add<T>(&mut self, source: T) -> Result<ObsSceneItemRef<T>, ObsError>where
T: ObsSourceTrait + Clone + 'static,
Adds an existing typed source and returns its managed scene-item handle.
Sourcepub fn add_new_source(
&mut self,
info: SourceInfo,
) -> Result<ObsSceneItemRef<ObsSourceRef>, ObsError>
pub fn add_new_source( &mut self, info: SourceInfo, ) -> Result<ObsSceneItemRef<ObsSourceRef>, ObsError>
Creates a source from SourceInfo, adds it, and returns the typed scene-item handle.
Sourcepub fn remove_item<T: SceneItemTrait + ?Sized>(
&mut self,
item: &T,
) -> Result<(), ObsError>
pub fn remove_item<T: SceneItemTrait + ?Sized>( &mut self, item: &T, ) -> Result<(), ObsError>
Removes a managed item immediately without consuming handles held by the caller.
Sourcepub fn items_for_source<T>(
&self,
source: &T,
) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>where
T: ObsSourceTrait + Clone,
pub fn items_for_source<T>(
&self,
source: &T,
) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>where
T: ObsSourceTrait + Clone,
Returns all managed scene items for a source.
Trait Implementations§
Source§impl Clone for ObsSceneRef
impl Clone for ObsSceneRef
Source§fn clone(&self) -> ObsSceneRef
fn clone(&self) -> ObsSceneRef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ObsSceneRef
impl Debug for ObsSceneRef
impl Eq for ObsSceneRef
Source§impl Hash for ObsSceneRef
impl Hash for ObsSceneRef
Source§impl ObsSceneExtFilter for ObsSceneRef
impl ObsSceneExtFilter for ObsSceneRef
Source§fn add_scene_filter(&self, filter_ref: &ObsFilterRef) -> Result<(), ObsError>
fn add_scene_filter(&self, filter_ref: &ObsFilterRef) -> Result<(), ObsError>
Source§fn remove_scene_filter(&self, filter_ref: &ObsFilterRef) -> Result<(), ObsError>
fn remove_scene_filter(&self, filter_ref: &ObsFilterRef) -> Result<(), ObsError>
Source§impl PartialEq for ObsSceneRef
impl PartialEq for ObsSceneRef
Source§impl SceneItemExtSceneTrait for ObsSceneRef
impl SceneItemExtSceneTrait for ObsSceneRef
Source§fn 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>
Source§fn 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>
SourceInfo.
Returns a reference to the created scene item, which internally holds the created source.Source§fn get_source(
&self,
name: &str,
) -> Result<Option<Arc<dyn ObsSourceTrait>>, ObsError>
fn get_source( &self, name: &str, ) -> Result<Option<Arc<dyn ObsSourceTrait>>, ObsError>
Source§fn 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>
Source§fn remove_item<K: SceneItemTrait + ?Sized>(
&mut self,
scene_item: &K,
) -> Result<(), ObsError>
fn remove_item<K: SceneItemTrait + ?Sized>( &mut self, scene_item: &K, ) -> Result<(), ObsError>
Source§fn items_for_source<T: ObsSourceTrait + Clone>(
&self,
source: &T,
) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>
fn items_for_source<T: ObsSourceTrait + Clone>( &self, source: &T, ) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>
Source§fn get_source_mut(
&self,
name: &str,
) -> Result<Option<Arc<dyn ObsSourceTrait>>, ObsError>
fn get_source_mut( &self, name: &str, ) -> Result<Option<Arc<dyn ObsSourceTrait>>, ObsError>
Use get_source; the returned shared handle was never a mutable reference
Source§fn 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>
Use remove_item; it removes the native scene item immediately without consuming the handle
Source§fn get_scene_item_ptr<T: ObsSourceTrait + Clone>(
&self,
source: &T,
) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>
fn get_scene_item_ptr<T: ObsSourceTrait + Clone>( &self, source: &T, ) -> Result<Vec<Arc<dyn SceneItemTrait>>, ObsError>
Use items_for_source; scene item handles are managed objects, not raw pointers