Skip to content

Commit f952ecf

Browse files
committed
Doxygen
1 parent 8867b72 commit f952ecf

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

src/A2DPVolumeControl.h

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,17 @@ class A2DPVolumeControl {
124124
virtual void set_volume(uint8_t volume) = 0;
125125

126126
protected:
127-
bool is_volume_used = false;
128-
bool mono_downmix = false;
129-
int32_t volumeFactor = 1;
130-
int32_t volumeFactorMax = 0x1000; // 4096
131-
int32_t volumeFactorClippingLimit = 0xfff; // 4095
127+
bool is_volume_used = false; ///< Flag indicating if volume control is enabled
128+
bool mono_downmix = false; ///< Flag indicating if mono downmix is enabled
129+
int32_t volumeFactor = 1; ///< Current volume factor
130+
int32_t volumeFactorMax = 0x1000; ///< Maximum volume factor (4096)
131+
int32_t volumeFactorClippingLimit = 0xfff; ///< Volume factor clipping limit (4095)
132132

133+
/**
134+
* @brief Clips audio sample value to prevent overflow
135+
* @param value Input audio sample value
136+
* @return Clipped value within valid 16-bit range (-32768 to 32767)
137+
*/
133138
int32_t clip(int32_t value) {
134139
int32_t result = value;
135140
if (value < -32768) result = -32768;
@@ -244,12 +249,23 @@ class A2DPLinearVolumeControl : public A2DPVolumeControl {
244249
*/
245250
class A2DPNoVolumeControl : public A2DPVolumeControl {
246251
public:
252+
/**
253+
* @brief Constructor with optional fixed volume setting
254+
* @param fixedVolume Fixed volume factor (default: 0x1000/4096 for no change)
255+
* If different from 0x1000, volume control will be enabled with this fixed value
256+
*/
247257
A2DPNoVolumeControl(int32_t fixedVolume = 0x1000) {
248258
is_volume_used = fixedVolume != 0x1000;
249259
mono_downmix = false;
250260
volumeFactor = fixedVolume; // fixed volume
251261
volumeFactorMax = 0x1000; // no change
252262
}
263+
264+
/**
265+
* @brief Override that does nothing - no audio data modification
266+
* @param data Pointer to audio frame data (unused)
267+
* @param frameCount Number of frames (unused)
268+
*/
253269
void update_audio_data(Frame* data, uint16_t frameCount) override {}
254270

255271
/**

0 commit comments

Comments
 (0)