pub struct Inputs<'a> { /* private fields */ }Expand description
API functions related to inputs.
Implementations§
Source§impl Inputs<'_>
impl Inputs<'_>
Sourcepub async fn list(&self, kind: Option<&str>) -> Result<Vec<Input>>
pub async fn list(&self, kind: Option<&str>) -> Result<Vec<Input>>
Gets an array of all inputs in OBS.
Sourcepub async fn list_kinds(&self, unversioned: bool) -> Result<Vec<String>>
pub async fn list_kinds(&self, unversioned: bool) -> Result<Vec<String>>
Gets an array of all available input kinds in OBS.
Sourcepub async fn specials(&self) -> Result<SpecialInputs>
pub async fn specials(&self) -> Result<SpecialInputs>
Gets the names of all special inputs.
Sourcepub async fn default_settings<T>(&self, kind: &str) -> Result<T>where
T: DeserializeOwned,
pub async fn default_settings<T>(&self, kind: &str) -> Result<T>where
T: DeserializeOwned,
Gets the default settings for an input kind.
Sourcepub async fn settings<T>(&self, input: InputId<'_>) -> Result<InputSettings<T>>where
T: DeserializeOwned,
pub async fn settings<T>(&self, input: InputId<'_>) -> Result<InputSettings<T>>where
T: DeserializeOwned,
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.
Sourcepub async fn set_settings<T>(&self, settings: SetSettings<'_, T>) -> Result<()>where
T: Serialize,
pub async fn set_settings<T>(&self, settings: SetSettings<'_, T>) -> Result<()>where
T: Serialize,
Sets the settings of an input.
Sourcepub async fn muted(&self, input: InputId<'_>) -> Result<bool>
pub async fn muted(&self, input: InputId<'_>) -> Result<bool>
Gets the audio mute state of an input.
Sourcepub async fn set_muted(&self, input: InputId<'_>, muted: bool) -> Result<()>
pub async fn set_muted(&self, input: InputId<'_>, muted: bool) -> Result<()>
Sets the audio mute state of an input.
Sourcepub async fn toggle_mute(&self, input: InputId<'_>) -> Result<bool>
pub async fn toggle_mute(&self, input: InputId<'_>) -> Result<bool>
Toggles the audio mute state of an input.
Sourcepub async fn volume(&self, input: InputId<'_>) -> Result<InputVolume>
pub async fn volume(&self, input: InputId<'_>) -> Result<InputVolume>
Gets the current volume setting of an input.
Sourcepub async fn set_volume(&self, input: InputId<'_>, volume: Volume) -> Result<()>
pub async fn set_volume(&self, input: InputId<'_>, volume: Volume) -> Result<()>
Sets the volume setting of an input.
Sourcepub async fn set_name(&self, input: InputId<'_>, new: &str) -> Result<()>
pub async fn set_name(&self, input: InputId<'_>, new: &str) -> Result<()>
Sets the name of an input (rename).
Sourcepub async fn create<T>(&self, input: Create<'_, T>) -> Result<SceneItemId>where
T: Serialize,
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.
Sourcepub async fn remove(&self, input: InputId<'_>) -> Result<()>
pub async fn remove(&self, input: InputId<'_>) -> Result<()>
Removes an existing input.
Note: Will immediately remove all associated scene items.
Sourcepub async fn audio_balance(&self, input: InputId<'_>) -> Result<f32>
pub async fn audio_balance(&self, input: InputId<'_>) -> Result<f32>
Gets the audio balance of an input.
Sourcepub async fn set_audio_balance(
&self,
input: InputId<'_>,
balance: f32,
) -> Result<()>
pub async fn set_audio_balance( &self, input: InputId<'_>, balance: f32, ) -> Result<()>
Sets the audio balance of an input.
Sourcepub async fn audio_sync_offset(&self, input: InputId<'_>) -> Result<Duration>
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!
Sourcepub async fn set_audio_sync_offset(
&self,
input: InputId<'_>,
offset: Duration,
) -> Result<()>
pub async fn set_audio_sync_offset( &self, input: InputId<'_>, offset: Duration, ) -> Result<()>
Sets the audio sync offset of an input.
Sourcepub async fn audio_monitor_type(
&self,
input: InputId<'_>,
) -> Result<MonitorType>
pub async fn audio_monitor_type( &self, input: InputId<'_>, ) -> Result<MonitorType>
Gets the audio monitor type of input.
Sourcepub async fn set_audio_monitor_type(
&self,
input: InputId<'_>,
monitor_type: MonitorType,
) -> Result<()>
pub async fn set_audio_monitor_type( &self, input: InputId<'_>, monitor_type: MonitorType, ) -> Result<()>
Sets the audio monitor type of input.
Sourcepub async fn audio_tracks(&self, input: InputId<'_>) -> Result<[bool; 6]>
pub async fn audio_tracks(&self, input: InputId<'_>) -> Result<[bool; 6]>
Gets the enable state of all audio tracks of an input.
Sourcepub async fn set_audio_tracks(
&self,
input: InputId<'_>,
tracks: [Option<bool>; 6],
) -> Result<()>
pub async fn set_audio_tracks( &self, input: InputId<'_>, tracks: [Option<bool>; 6], ) -> Result<()>
Sets the enable state of audio tracks of an input.
Sourcepub async fn deinterlace_mode(
&self,
input: InputId<'_>,
) -> Result<DeinterlaceMode>
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.
Sourcepub async fn set_deinterlace_mode(
&self,
input: InputId<'_>,
mode: DeinterlaceMode,
) -> Result<()>
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.
Sourcepub async fn deinterlace_field_order(
&self,
input: InputId<'_>,
) -> Result<DeinterlaceFieldOrder>
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.
Sourcepub async fn set_deinterlace_field_order(
&self,
input: InputId<'_>,
field_order: DeinterlaceFieldOrder,
) -> Result<()>
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.
Sourcepub async fn properties_list_property_items(
&self,
input: InputId<'_>,
property: &str,
) -> Result<Vec<ListPropertyItem>>
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.
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.