![]() |
Open Broadcaster Software
Free, open source software for live streaming and recording
|
header for audio controls More...
Go to the source code of this file.
Typedefs | |
typedef void(* | obs_fader_changed_t )(void *param, float db) |
typedef void(* | obs_volmeter_updated_t )(void *param, const float magnitude[MAX_AUDIO_CHANNELS], const float peak[MAX_AUDIO_CHANNELS], const float input_peak[MAX_AUDIO_CHANNELS]) |
Enumerations | |
enum | obs_fader_type { OBS_FADER_CUBIC, OBS_FADER_IEC, OBS_FADER_LOG } |
Fader types. More... | |
Functions | |
EXPORT obs_fader_t * | obs_fader_create (enum obs_fader_type type) |
Create a fader. More... | |
EXPORT void | obs_fader_destroy (obs_fader_t *fader) |
Destroy a fader. More... | |
EXPORT bool | obs_fader_set_db (obs_fader_t *fader, const float db) |
Set the fader dB value. More... | |
EXPORT float | obs_fader_get_db (obs_fader_t *fader) |
Get the current fader dB value. More... | |
EXPORT bool | obs_fader_set_deflection (obs_fader_t *fader, const float def) |
Set the fader value from deflection. More... | |
EXPORT float | obs_fader_get_deflection (obs_fader_t *fader) |
Get the current fader deflection. More... | |
EXPORT bool | obs_fader_set_mul (obs_fader_t *fader, const float mul) |
Set the fader value from multiplier. More... | |
EXPORT float | obs_fader_get_mul (obs_fader_t *fader) |
Get the current fader multiplier value. More... | |
EXPORT bool | obs_fader_attach_source (obs_fader_t *fader, obs_source_t *source) |
Attach the fader to a source. More... | |
EXPORT void | obs_fader_detach_source (obs_fader_t *fader) |
Detach the fader from the currently attached source. More... | |
EXPORT void | obs_fader_add_callback (obs_fader_t *fader, obs_fader_changed_t callback, void *param) |
EXPORT void | obs_fader_remove_callback (obs_fader_t *fader, obs_fader_changed_t callback, void *param) |
EXPORT obs_volmeter_t * | obs_volmeter_create (enum obs_fader_type type) |
Create a volume meter. More... | |
EXPORT void | obs_volmeter_destroy (obs_volmeter_t *volmeter) |
Destroy a volume meter. More... | |
EXPORT bool | obs_volmeter_attach_source (obs_volmeter_t *volmeter, obs_source_t *source) |
Attach the volume meter to a source. More... | |
EXPORT void | obs_volmeter_detach_source (obs_volmeter_t *volmeter) |
Detach the volume meter from the currently attached source. More... | |
EXPORT void | obs_volmeter_set_update_interval (obs_volmeter_t *volmeter, const unsigned int ms) |
Set the update interval for the volume meter. More... | |
EXPORT unsigned int | obs_volmeter_get_update_interval (obs_volmeter_t *volmeter) |
Get the update interval currently used for the volume meter. More... | |
EXPORT int | obs_volmeter_get_nr_channels (obs_volmeter_t *volmeter) |
Get the number of channels which are configured for this source. More... | |
EXPORT void | obs_volmeter_add_callback (obs_volmeter_t *volmeter, obs_volmeter_updated_t callback, void *param) |
EXPORT void | obs_volmeter_remove_callback (obs_volmeter_t *volmeter, obs_volmeter_updated_t callback, void *param) |
header for audio controls
Audio controls for use in GUIs
typedef void(* obs_fader_changed_t)(void *param, float db) |
typedef void(* obs_volmeter_updated_t)(void *param, const float magnitude[MAX_AUDIO_CHANNELS], const float peak[MAX_AUDIO_CHANNELS], const float input_peak[MAX_AUDIO_CHANNELS]) |
enum obs_fader_type |
Fader types.
EXPORT void obs_fader_add_callback | ( | obs_fader_t * | fader, |
obs_fader_changed_t | callback, | ||
void * | param | ||
) |
EXPORT bool obs_fader_attach_source | ( | obs_fader_t * | fader, |
obs_source_t * | source | ||
) |
Attach the fader to a source.
fader | pointer to the fader object |
source | pointer to the source object |
When the fader is attached to a source it will automatically sync it's state to the volume of the source.
EXPORT obs_fader_t* obs_fader_create | ( | enum obs_fader_type | type | ) |
Create a fader.
type | the type of the fader |
A fader object is used to map input values from a gui element to dB and subsequently multiplier values used by libobs to mix audio. The current "position" of the fader is internally stored as dB value.
EXPORT void obs_fader_destroy | ( | obs_fader_t * | fader | ) |
Destroy a fader.
fader | pointer to the fader object |
Destroy the fader and free all related data
EXPORT void obs_fader_detach_source | ( | obs_fader_t * | fader | ) |
Detach the fader from the currently attached source.
fader | pointer to the fader object |
EXPORT float obs_fader_get_db | ( | obs_fader_t * | fader | ) |
Get the current fader dB value.
fader | pointer to the fader object |
EXPORT float obs_fader_get_deflection | ( | obs_fader_t * | fader | ) |
Get the current fader deflection.
fader | pointer to the fader object |
EXPORT float obs_fader_get_mul | ( | obs_fader_t * | fader | ) |
Get the current fader multiplier value.
fader | pointer to the fader object |
EXPORT void obs_fader_remove_callback | ( | obs_fader_t * | fader, |
obs_fader_changed_t | callback, | ||
void * | param | ||
) |
EXPORT bool obs_fader_set_db | ( | obs_fader_t * | fader, |
const float | db | ||
) |
Set the fader dB value.
fader | pointer to the fader object |
db | new dB value |
EXPORT bool obs_fader_set_deflection | ( | obs_fader_t * | fader, |
const float | def | ||
) |
Set the fader value from deflection.
fader | pointer to the fader object |
def | new deflection |
This sets the new fader value from the supplied deflection, in case the resulting value was clamped due to limits this function will return false. The deflection is typically in the range [0.0, 1.0] but may be higher in order to provide some amplification. In order for this to work the high dB limit has to be set.
EXPORT bool obs_fader_set_mul | ( | obs_fader_t * | fader, |
const float | mul | ||
) |
Set the fader value from multiplier.
fader | pointer to the fader object |
EXPORT void obs_volmeter_add_callback | ( | obs_volmeter_t * | volmeter, |
obs_volmeter_updated_t | callback, | ||
void * | param | ||
) |
EXPORT bool obs_volmeter_attach_source | ( | obs_volmeter_t * | volmeter, |
obs_source_t * | source | ||
) |
Attach the volume meter to a source.
volmeter | pointer to the volume meter object |
source | pointer to the source object |
When the volume meter is attached to a source it will start to listen to volume updates on the source and after preparing the data emit its own signal.
EXPORT obs_volmeter_t* obs_volmeter_create | ( | enum obs_fader_type | type | ) |
Create a volume meter.
type | the mapping type to use for the volume meter |
A volume meter object is used to prepare the sound levels reported by audio sources for display in a GUI. It will automatically take source volume into account and map the levels to a range [0.0f, 1.0f].
EXPORT void obs_volmeter_destroy | ( | obs_volmeter_t * | volmeter | ) |
Destroy a volume meter.
volmeter | pointer to the volmeter object |
Destroy the volume meter and free all related data
EXPORT void obs_volmeter_detach_source | ( | obs_volmeter_t * | volmeter | ) |
Detach the volume meter from the currently attached source.
volmeter | pointer to the volume meter object |
EXPORT int obs_volmeter_get_nr_channels | ( | obs_volmeter_t * | volmeter | ) |
Get the number of channels which are configured for this source.
volmeter | pointer to the volume meter object |
EXPORT unsigned int obs_volmeter_get_update_interval | ( | obs_volmeter_t * | volmeter | ) |
Get the update interval currently used for the volume meter.
volmeter | pointer to the volume meter object |
EXPORT void obs_volmeter_remove_callback | ( | obs_volmeter_t * | volmeter, |
obs_volmeter_updated_t | callback, | ||
void * | param | ||
) |
EXPORT void obs_volmeter_set_update_interval | ( | obs_volmeter_t * | volmeter, |
const unsigned int | ms | ||
) |
Set the update interval for the volume meter.
volmeter | pointer to the volume meter object |
ms | update interval in ms |
This sets the update interval in milliseconds that should be processed before the resulting values are emitted by the levels_updated signal. The resulting number of audio samples is rounded to an integer.
Please note that due to way obs does receive audio data from the sources this is no hard guarantee for the timing of the signal itself. When the volume meter receives a chunk of data that is multiple the size of the sample interval, all data will be sampled and the values updated accordingly, but only the signal for the last segment is actually emitted. On the other hand data might be received in a way that will cause the signal to be emitted in shorter intervals than specified here under some circumstances.