The simplest possible implementation of a VolumeControl.
More...
#include <A2DPVolumeControl.h>
|
int32_t | clip (int32_t value) |
| Clips audio sample value to prevent overflow. More...
|
|
void | set_volume (uint8_t volume) override |
| Sets the volume using direct linear mapping. More...
|
|
The simplest possible implementation of a VolumeControl.
- Author
- pschatzmann
- Copyright
- Apache License Version 2
◆ clip()
int32_t A2DPVolumeControl::clip |
( |
int32_t |
value | ) |
|
|
inlineprotectedinherited |
Clips audio sample value to prevent overflow.
- Parameters
-
value | Input audio sample value |
- Returns
- Clipped value within valid 16-bit range (-32768 to 32767)
◆ get_volume_factor()
int32_t A2DPVolumeControl::get_volume_factor |
( |
| ) |
|
|
inlineinherited |
Gets the current volume factor.
- Returns
- Volume factor in the range of 0 to 4096
◆ get_volume_factor_max()
int32_t A2DPVolumeControl::get_volume_factor_max |
( |
| ) |
|
|
inlineinherited |
Gets the maximum volume factor value.
- Returns
- Maximum factor value (4096)
◆ set_enabled()
void A2DPVolumeControl::set_enabled |
( |
bool |
enabled | ) |
|
|
inlineinherited |
Enables or disables volume control.
- Parameters
-
enabled | True to enable volume control, false to disable |
◆ set_mono_downmix()
void A2DPVolumeControl::set_mono_downmix |
( |
bool |
enabled | ) |
|
|
inlineinherited |
Enables or disables mono downmix.
- Parameters
-
enabled | True to enable mono downmix, false to disable |
◆ set_volume()
void A2DPLinearVolumeControl::set_volume |
( |
uint8_t |
volume | ) |
|
|
inlineoverrideprotectedvirtual |
Sets the volume using direct linear mapping.
- Parameters
-
volume | Volume level (0-127) - directly used as volume factor |
Implements A2DPVolumeControl.
◆ update_audio_data() [1/2]
virtual void A2DPVolumeControl::update_audio_data |
( |
Frame * |
data, |
|
|
uint16_t |
frameCount |
|
) |
| |
|
inlinevirtualinherited |
Updates audio data with volume control and optional mono downmix.
- Parameters
-
data | Pointer to audio frame data |
frameCount | Number of frames to process |
Reimplemented in A2DPNoVolumeControl.
◆ update_audio_data() [2/2]
virtual void A2DPVolumeControl::update_audio_data |
( |
uint8_t * |
data, |
|
|
uint16_t |
byteCount |
|
) |
| |
|
inlinevirtualinherited |
Updates audio data with volume control and optional mono downmix.
- Parameters
-
data | Pointer to raw audio data (uint8_t) |
byteCount | Number of bytes to process |
The documentation for this class was generated from the following file: