ObsSceneRef

Struct ObsSceneRef 

Source
pub struct ObsSceneRef { /* private fields */ }

Implementations§

Source§

impl ObsSceneRef

Source

pub fn name(&self) -> &ObsString

Source

pub fn sources(&self) -> &Arc<RwLock<HashSet<ObsSourceRef>>>

Source

pub fn signals(&self) -> &Arc<ObsSceneSignals>

Source

pub fn sources_mut(&mut self) -> &mut Arc<RwLock<HashSet<ObsSourceRef>>>

Source§

impl ObsSceneRef

Source

pub fn add_and_set(&self, channel: u32) -> Result<(), ObsError>

👎Deprecated: Use ObsSceneRef::set_to_channel instead
Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn add_scene_filter( &self, source: &ObsSourceRef, filter_ref: &ObsFilterRef, ) -> Result<(), ObsError>

Adds a filter to the given source in this scene.

Source

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).

Source

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.

Source

pub fn get_transform_info( &self, source: &ObsSourceRef, ) -> Result<ObsTransformInfo, ObsError>

Gets the transform info of the given source in this scene.

Source

pub fn get_source_position( &self, source: &ObsSourceRef, ) -> Result<Vec2, ObsError>

Gets the position of the given source in this scene.

Source

pub fn get_source_scale(&self, source: &ObsSourceRef) -> Result<Vec2, ObsError>

Gets the scale of the given source in this scene.

Source

pub fn set_source_position( &self, source: &ObsSourceRef, position: Vec2, ) -> Result<(), ObsError>

Sets the position of the given source in this scene.

Source

pub fn set_source_scale( &self, source: &ObsSourceRef, scale: Vec2, ) -> Result<(), ObsError>

Sets the scale of the given source in this scene.

Source

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.

Source

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.

Source

pub fn as_ptr(&self) -> Sendable<*mut obs_scene_t>

Trait Implementations§

Source§

impl Clone for ObsSceneRef

Source§

fn clone(&self) -> ObsSceneRef

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObsSceneRef

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for ObsSceneRef

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ObsSceneRef

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for ObsSceneRef

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.