|
gavl
|
Simple volume control. More...
Typedefs | |
| typedef struct gavl_volume_control_s | gavl_volume_control_t |
| Opaque structure for a volume control. | |
Functions | |
| GAVL_PUBLIC gavl_volume_control_t * | gavl_volume_control_create (void) |
| Create volume control. | |
| GAVL_PUBLIC void | gavl_volume_control_destroy (gavl_volume_control_t *ctrl) |
| Destroys a volume control and frees all associated memory. | |
| GAVL_PUBLIC void | gavl_volume_control_set_format (gavl_volume_control_t *ctrl, const gavl_audio_format_t *format) |
| Set format for a volume control. | |
| GAVL_PUBLIC void | gavl_volume_control_set_volume (gavl_volume_control_t *ctrl, float volume) |
| Set volume for a volume control. | |
| GAVL_PUBLIC void | gavl_volume_control_apply (gavl_volume_control_t *ctrl, gavl_audio_frame_t *frame) |
| Apply a volume control for an audio frame. | |
| GAVL_PUBLIC int | gavl_volume_to_int (float volume, float one, int steps) |
| Convert an audio volume (in dB) to an integer. | |
| GAVL_PUBLIC float | gavl_volume_to_float (int volume, float one, int steps) |
| Convert an integer audio volume to a float (in dB). | |
Simple volume control.
This is a very simple software volume control.
| typedef struct gavl_volume_control_s gavl_volume_control_t |
Opaque structure for a volume control.
You don't want to know what's inside.
| GAVL_PUBLIC gavl_volume_control_t * gavl_volume_control_create | ( | void | ) |
Create volume control.
| GAVL_PUBLIC void gavl_volume_control_destroy | ( | gavl_volume_control_t * | ctrl | ) |
Destroys a volume control and frees all associated memory.
| ctrl | A volume control |
| GAVL_PUBLIC void gavl_volume_control_set_format | ( | gavl_volume_control_t * | ctrl, |
| const gavl_audio_format_t * | format ) |
Set format for a volume control.
| ctrl | A volume control |
| format | The format subsequent frames will be passed with This function can be called multiple times with one instance |
| GAVL_PUBLIC void gavl_volume_control_set_volume | ( | gavl_volume_control_t * | ctrl, |
| float | volume ) |
Set volume for a volume control.
| ctrl | A volume control |
| volume | Volume in dB (must be <= 0.0 to prevent overflows) |
| GAVL_PUBLIC void gavl_volume_control_apply | ( | gavl_volume_control_t * | ctrl, |
| gavl_audio_frame_t * | frame ) |
Apply a volume control for an audio frame.
| ctrl | A volume control |
| frame | An audio frame |
| GAVL_PUBLIC int gavl_volume_to_int | ( | float | volume, |
| float | one, | ||
| int | steps ) |
Convert an audio volume (in dB) to an integer.
| volume | dB value |
| one | The dB value corresponding to an integer value of 1 |
| steps | The number of steps |
| GAVL_PUBLIC float gavl_volume_to_float | ( | int | volume, |
| float | one, | ||
| int | steps ) |
Convert an integer audio volume to a float (in dB).
| volume | Integer value |
| one | The dB value corresponding to an integer value of 1 |
| steps | The number of steps |