Skip to main content

Inputs

Struct Inputs 

Source
pub struct Inputs<'a> { /* private fields */ }
Expand description

API functions related to inputs.

Implementations§

Source§

impl Inputs<'_>

Source

pub async fn list(&self, kind: Option<&str>) -> Result<Vec<Input>>

Gets an array of all inputs in OBS.

Source

pub async fn list_kinds(&self, unversioned: bool) -> Result<Vec<String>>

Gets an array of all available input kinds in OBS.

Source

pub async fn specials(&self) -> Result<SpecialInputs>

Gets the names of all special inputs.

Source

pub async fn default_settings<T>(&self, kind: &str) -> Result<T>

Gets the default settings for an input kind.

Source

pub async fn settings<T>(&self, input: InputId<'_>) -> Result<InputSettings<T>>

Gets the settings of an input.

Note: Does not include defaults. To create the entire settings object, overlay input settings over the default input settings provided by Inputs::default_settings.

Source

pub async fn set_settings<T>(&self, settings: SetSettings<'_, T>) -> Result<()>
where T: Serialize,

Sets the settings of an input.

Source

pub async fn muted(&self, input: InputId<'_>) -> Result<bool>

Gets the audio mute state of an input.

Source

pub async fn set_muted(&self, input: InputId<'_>, muted: bool) -> Result<()>

Sets the audio mute state of an input.

Source

pub async fn toggle_mute(&self, input: InputId<'_>) -> Result<bool>

Toggles the audio mute state of an input.

Source

pub async fn volume(&self, input: InputId<'_>) -> Result<InputVolume>

Gets the current volume setting of an input.

Source

pub async fn set_volume(&self, input: InputId<'_>, volume: Volume) -> Result<()>

Sets the volume setting of an input.

Source

pub async fn set_name(&self, input: InputId<'_>, new: &str) -> Result<()>

Sets the name of an input (rename).

Source

pub async fn create<T>(&self, input: Create<'_, T>) -> Result<SceneItemId>
where T: Serialize,

Creates a new input, adding it as a scene item to the specified scene.

Source

pub async fn remove(&self, input: InputId<'_>) -> Result<()>

Removes an existing input.

Note: Will immediately remove all associated scene items.

Source

pub async fn audio_balance(&self, input: InputId<'_>) -> Result<f32>

Gets the audio balance of an input.

Source

pub async fn set_audio_balance( &self, input: InputId<'_>, balance: f32, ) -> Result<()>

Sets the audio balance of an input.

Source

pub async fn audio_sync_offset(&self, input: InputId<'_>) -> Result<Duration>

Gets the audio sync offset of an input.

Note: The audio sync offset can be negative too!

Source

pub async fn set_audio_sync_offset( &self, input: InputId<'_>, offset: Duration, ) -> Result<()>

Sets the audio sync offset of an input.

Source

pub async fn audio_monitor_type( &self, input: InputId<'_>, ) -> Result<MonitorType>

Gets the audio monitor type of input.

Source

pub async fn set_audio_monitor_type( &self, input: InputId<'_>, monitor_type: MonitorType, ) -> Result<()>

Sets the audio monitor type of input.

Source

pub async fn audio_tracks(&self, input: InputId<'_>) -> Result<[bool; 6]>

Gets the enable state of all audio tracks of an input.

Source

pub async fn set_audio_tracks( &self, input: InputId<'_>, tracks: [Option<bool>; 6], ) -> Result<()>

Sets the enable state of audio tracks of an input.

Source

pub async fn deinterlace_mode( &self, input: InputId<'_>, ) -> Result<DeinterlaceMode>

Gets the deinterlace mode of an input.

Note: Deinterlacing functionality is restricted to async inputs only.

Source

pub async fn set_deinterlace_mode( &self, input: InputId<'_>, mode: DeinterlaceMode, ) -> Result<()>

Sets the deinterlace mode of an input.

Note: Deinterlacing functionality is restricted to async inputs only.

Source

pub async fn deinterlace_field_order( &self, input: InputId<'_>, ) -> Result<DeinterlaceFieldOrder>

Gets the deinterlace field order of an input.

Note: Deinterlacing functionality is restricted to async inputs only.

Source

pub async fn set_deinterlace_field_order( &self, input: InputId<'_>, field_order: DeinterlaceFieldOrder, ) -> Result<()>

Sets the deinterlace field order of an input.

Note: Deinterlacing functionality is restricted to async inputs only.

Source

pub async fn properties_list_property_items( &self, input: InputId<'_>, property: &str, ) -> Result<Vec<ListPropertyItem>>

Gets the items of a list property from an input’s properties.

Note: Use this in cases where an input provides a dynamic, selectable list of items. For example, display capture, where it provides a list of available displays.

Source

pub async fn press_properties_button( &self, input: InputId<'_>, property: &str, ) -> Result<()>

Presses a button in the properties of an input.

Note: Use this in cases where there is a button in the properties of an input that cannot be accessed in any other way. For example, browser sources, where there is a refresh button.

Auto Trait Implementations§

§

impl<'a> Freeze for Inputs<'a>

§

impl<'a> !RefUnwindSafe for Inputs<'a>

§

impl<'a> Send for Inputs<'a>

§

impl<'a> Sync for Inputs<'a>

§

impl<'a> Unpin for Inputs<'a>

§

impl<'a> UnsafeUnpin for Inputs<'a>

§

impl<'a> !UnwindSafe for Inputs<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more