docs: Add missing obs_source_t functions + organize

Adds some notable obs_source_t functions which are missing from the
current docs. Moves some of the audio-related functions together.
master
tt2468 2021-11-19 09:16:05 -08:00 committed by Jim
parent 74a1aeb593
commit 0038b50776
1 changed files with 62 additions and 43 deletions

View File

@ -179,7 +179,7 @@ Source Definition Structure (obs_source_info)
from destroy.
.. member:: uint32_t (*obs_source_info.get_width)(void *data)
uint32_t (*obs_source_info.get_height)(void *data);
uint32_t (*obs_source_info.get_height)(void *data)
Returns the width/height of the source. These callbacks are required
if this is a video source and is synchronous.
@ -753,16 +753,11 @@ General Source Functions
---------------------
.. function:: void obs_source_set_hidden(obs_source_t *source, bool hidden)
Sets the hidden flag that determines whether it should be hidden from the user.
Used when the source is still alive but should not be referenced.
---------------------
.. function:: bool obs_source_is_hidden(obs_source_t *source)
void obs_source_set_hidden(obs_source_t *source, bool hidden)
:return: *true* if source's 'hidden' is set true
Gets/sets the hidden property that determines whether it should be hidden from the user.
Used when the source is still alive but should not be referenced.
---------------------
@ -927,6 +922,64 @@ General Source Functions
---------------------
.. function:: enum speaker_layout obs_source_get_speaker_layout(obs_source_t *source)
Gets the current speaker layout.
---------------------
.. function:: void obs_source_set_balance_value(obs_source_t *source, float balance)
float obs_source_get_balance_value(const obs_source_t *source)
Sets/gets the audio balance value.
---------------------
.. function:: void obs_source_set_sync_offset(obs_source_t *source, int64_t offset)
int64_t obs_source_get_sync_offset(const obs_source_t *source)
Sets/gets the audio sync offset (in nanoseconds) for a source.
---------------------
.. function:: void obs_source_set_audio_mixers(obs_source_t *source, uint32_t mixers)
uint32_t obs_source_get_audio_mixers(const obs_source_t *source)
Sets/gets the audio mixer channels that a source outputs to,
depending on what bits are set. Audio mixers allow filtering
specific using multiple audio encoders to mix different sources
together depending on what mixer channel they're set to.
For example, to output to mixer 1 and 3, you would perform a bitwise
OR on bits 0 and 2: (1<<0) | (1<<2), or 0x5.
---------------------
.. function:: void obs_source_set_monitoring_type(obs_source_t *source, enum obs_monitoring_type type)
enum obs_monitoring_type obs_source_get_monitoring_type(obs_source_t *source)
Sets/gets the desktop audio monitoring type.
:param order: | OBS_MONITORING_TYPE_NONE - Do not monitor
| OBS_MONITORING_TYPE_MONITOR_ONLY - Send to monitor device, no outputs
| OBS_MONITORING_TYPE_MONITOR_AND_OUTPUT - Send to monitor device and outputs
---------------------
.. function:: void obs_source_enum_active_sources(obs_source_t *source, obs_source_enum_proc_t enum_callback, void *param)
void obs_source_enum_active_tree(obs_source_t *source, obs_source_enum_proc_t enum_callback, void *param)
Enumerates active child sources or source tree used by this source.
Relevant data types used with this function:
.. code:: cpp
typedef void (*obs_source_enum_proc_t)(obs_source_t *parent,
obs_source_t *child, void *param);
---------------------
.. function:: bool obs_source_push_to_mute_enabled(const obs_source_t *source)
void obs_source_enable_push_to_mute(obs_source_t *source, bool enabled)
@ -955,27 +1008,6 @@ General Source Functions
---------------------
.. function:: void obs_source_set_sync_offset(obs_source_t *source, int64_t offset)
int64_t obs_source_get_sync_offset(const obs_source_t *source)
Sets/gets the audio sync offset (in nanoseconds) for a source.
---------------------
.. function:: void obs_source_enum_active_sources(obs_source_t *source, obs_source_enum_proc_t enum_callback, void *param)
void obs_source_enum_active_tree(obs_source_t *source, obs_source_enum_proc_t enum_callback, void *param)
Enumerates active child sources or source tree used by this source.
Relevant data types used with this function:
.. code:: cpp
typedef void (*obs_source_enum_proc_t)(obs_source_t *parent,
obs_source_t *child, void *param);
---------------------
.. function:: bool obs_source_active(const obs_source_t *source)
:return: *true* if active, *false* if not. A source is only
@ -1006,19 +1038,6 @@ General Source Functions
---------------------
.. function:: void obs_source_set_audio_mixers(obs_source_t *source, uint32_t mixers)
uint32_t obs_source_get_audio_mixers(const obs_source_t *source)
Sets/gets the audio mixer channels that a source outputs to
(depending on what bits are set). Audio mixers allow filtering
specific using multiple audio encoders to mix different sources
together depending on what mixer channel they're set to.
For example, to output to mixer 1 and 3, you would perform a bitwise
OR on bits 0 and 2: (1<<0) | (1<<2), or 0x5.
---------------------
.. function:: void obs_source_enum_filters(obs_source_t *source, obs_source_enum_proc_t callback, void *param)
Enumerates active filters on a source.