Open Broadcaster Software
Free, open source software for live streaming and recording
obs-audio-controls.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2014 by Leonhard Oelke <leonhard@in-verted.de>
3 
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 2 of the License, or
7 (at your option) any later version.
8 
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13 
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17 
18 #pragma once
19 
20 #include "obs.h"
21 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
69 };
70 
82 
90 };
91 
102 
110 
117 EXPORT bool obs_fader_set_db(obs_fader_t *fader, const float db);
118 
124 EXPORT float obs_fader_get_db(obs_fader_t *fader);
125 
138 EXPORT bool obs_fader_set_deflection(obs_fader_t *fader, const float def);
139 
146 
152 EXPORT bool obs_fader_set_mul(obs_fader_t *fader, const float mul);
153 
159 EXPORT float obs_fader_get_mul(obs_fader_t *fader);
160 
171 
177 
178 typedef void (*obs_fader_changed_t)(void *param, float db);
179 
181  obs_fader_changed_t callback, void *param);
183  obs_fader_changed_t callback,
184  void *param);
185 
197 
205 
217  obs_source_t *source);
218 
224 
230 EXPORT void
232  enum obs_peak_meter_type peak_meter_type);
233 
253  const unsigned int ms);
254 
261 
267 
268 typedef void (*obs_volmeter_updated_t)(
269  void *param, const float magnitude[MAX_AUDIO_CHANNELS],
270  const float peak[MAX_AUDIO_CHANNELS],
271  const float input_peak[MAX_AUDIO_CHANNELS]);
272 
274  obs_volmeter_updated_t callback,
275  void *param);
277  obs_volmeter_updated_t callback,
278  void *param);
279 
280 EXPORT float obs_mul_to_db(float mul);
281 EXPORT float obs_db_to_mul(float db);
282 
283 #ifdef __cplusplus
284 }
285 #endif
obs_source
Definition: obs-internal.h:568
TRUE_PEAK_METER
@ TRUE_PEAK_METER
An accurate peak meter measure the maximum of inter-samples.
Definition: obs-audio-controls.h:89
obs_volmeter_t
struct obs_volmeter obs_volmeter_t
Definition: obs.h:64
obs_fader_get_deflection
EXPORT float obs_fader_get_deflection(obs_fader_t *fader)
Get the current fader deflection.
OBS_FADER_IEC
@ OBS_FADER_IEC
A fader compliant to IEC 60-268-18.
Definition: obs-audio-controls.h:64
obs_fader_set_deflection
EXPORT bool obs_fader_set_deflection(obs_fader_t *fader, const float def)
Set the fader value from deflection.
obs_volmeter_set_peak_meter_type
EXPORT void obs_volmeter_set_peak_meter_type(obs_volmeter_t *volmeter, enum obs_peak_meter_type peak_meter_type)
Set the peak meter type for the volume meter.
obs_fader_get_mul
EXPORT float obs_fader_get_mul(obs_fader_t *fader)
Get the current fader multiplier value.
obs_db_to_mul
EXPORT float obs_db_to_mul(float db)
obs_fader_add_callback
EXPORT void obs_fader_add_callback(obs_fader_t *fader, obs_fader_changed_t callback, void *param)
EXPORT
#define EXPORT
Definition: c99defs.h:37
obs_volmeter_updated_t
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])
Definition: obs-audio-controls.h:268
OBS_FADER_CUBIC
@ OBS_FADER_CUBIC
A simple cubic fader for controlling audio levels.
Definition: obs-audio-controls.h:44
obs_volmeter_detach_source
EXPORT void obs_volmeter_detach_source(obs_volmeter_t *volmeter)
Detach the volume meter from the currently attached source.
obs_fader_remove_callback
EXPORT void obs_fader_remove_callback(obs_fader_t *fader, obs_fader_changed_t callback, void *param)
obs_volmeter_get_update_interval
EXPORT unsigned int obs_volmeter_get_update_interval(obs_volmeter_t *volmeter)
Get the update interval currently used for the volume meter.
obs_volmeter_get_nr_channels
EXPORT int obs_volmeter_get_nr_channels(obs_volmeter_t *volmeter)
Get the number of channels which are configured for this source.
obs_peak_meter_type
obs_peak_meter_type
Peak meter types.
Definition: obs-audio-controls.h:74
obs_fader_set_db
EXPORT bool obs_fader_set_db(obs_fader_t *fader, const float db)
Set the fader dB value.
SAMPLE_PEAK_METER
@ SAMPLE_PEAK_METER
A simple peak meter measuring the maximum of all samples.
Definition: obs-audio-controls.h:81
obs_fader_attach_source
EXPORT bool obs_fader_attach_source(obs_fader_t *fader, obs_source_t *source)
Attach the fader to a source.
obs_fader_set_mul
EXPORT bool obs_fader_set_mul(obs_fader_t *fader, const float mul)
Set the fader value from multiplier.
obs_volmeter_create
EXPORT obs_volmeter_t * obs_volmeter_create(enum obs_fader_type type)
Create a volume meter.
obs_volmeter_attach_source
EXPORT bool obs_volmeter_attach_source(obs_volmeter_t *volmeter, obs_source_t *source)
Attach the volume meter to a source.
obs_fader_t
struct obs_fader obs_fader_t
Definition: obs.h:63
obs.h
obs_fader_create
EXPORT obs_fader_t * obs_fader_create(enum obs_fader_type type)
Create a fader.
obs_fader_type
obs_fader_type
Fader types.
Definition: obs-audio-controls.h:36
obs_volmeter_remove_callback
EXPORT void obs_volmeter_remove_callback(obs_volmeter_t *volmeter, obs_volmeter_updated_t callback, void *param)
obs_fader_get_db
EXPORT float obs_fader_get_db(obs_fader_t *fader)
Get the current fader dB value.
obs_mul_to_db
EXPORT float obs_mul_to_db(float mul)
obs_volmeter_add_callback
EXPORT void obs_volmeter_add_callback(obs_volmeter_t *volmeter, obs_volmeter_updated_t callback, void *param)
obs_fader_destroy
EXPORT void obs_fader_destroy(obs_fader_t *fader)
Destroy a fader.
MAX_AUDIO_CHANNELS
#define MAX_AUDIO_CHANNELS
Definition: audio-io.h:29
obs_volmeter_set_update_interval
EXPORT void obs_volmeter_set_update_interval(obs_volmeter_t *volmeter, const unsigned int ms)
Set the update interval for the volume meter.
obs_volmeter_destroy
EXPORT void obs_volmeter_destroy(obs_volmeter_t *volmeter)
Destroy a volume meter.
obs_fader_changed_t
void(* obs_fader_changed_t)(void *param, float db)
Definition: obs-audio-controls.h:178
obs_fader_detach_source
EXPORT void obs_fader_detach_source(obs_fader_t *fader)
Detach the fader from the currently attached source.
OBS_FADER_LOG
@ OBS_FADER_LOG
Logarithmic fader.
Definition: obs-audio-controls.h:68