Skip to content

Commit

Permalink
Added volume AVRC volume control functions (#645)
Browse files Browse the repository at this point in the history
  • Loading branch information
codster17 authored Dec 31, 2024
1 parent c5dc5d2 commit 9c7cae4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/BluetoothA2DPSink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,14 @@ void BluetoothA2DPSink::rewind() {
execute_avrc_command(ESP_AVRC_PT_CMD_REWIND);
}

void BluetoothA2DPSink::volume_up() {
execute_avrc_command(ESP_AVRC_PT_CMD_VOL_UP);
}

void BluetoothA2DPSink::volume_down() {
execute_avrc_command(ESP_AVRC_PT_CMD_VOL_DOWN);
}

void BluetoothA2DPSink::set_volume(uint8_t volume) {
// limit the volume to 127
s_volume = std::min((int)volume, 0x7f);
Expand Down
4 changes: 4 additions & 0 deletions src/BluetoothA2DPSink.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,10 @@ class BluetoothA2DPSink : public BluetoothA2DPCommon {
/// AVRC rewind
virtual void rewind();

virtual void volume_up();

virtual void volume_down();

/// mix stereo into single mono signal
virtual void set_mono_downmix(bool enabled) {
volume_control()->set_mono_downmix(enabled);
Expand Down

0 comments on commit 9c7cae4

Please sign in to comment.