Skip to content

Commit

Permalink
AudioBoardStream: volume inc value
Browse files Browse the repository at this point in the history
  • Loading branch information
pschatzmann committed Oct 4, 2024
1 parent 5d2d684 commit 899d367
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=audio-tools
version=0.9.8
version=0.9.9
author=Phil Schatzmann
maintainer=Phil Schatzmann
sentence=Some useful audio processing classes
Expand Down
15 changes: 13 additions & 2 deletions src/AudioLibs/AudioBoardStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class AudioBoardStream : public I2SCodecStream {
*/
static void actionVolumeUp(bool, int, void *) {
TRACEI();
selfAudioBoard->incrementVolume(+0.02);
selfAudioBoard->incrementVolume(+selfAudioBoard->actionVolumeIncrementValue());
}

/**
Expand All @@ -109,9 +109,10 @@ class AudioBoardStream : public I2SCodecStream {
*/
static void actionVolumeDown(bool, int, void *) {
TRACEI();
selfAudioBoard->incrementVolume(-0.02);
selfAudioBoard->incrementVolume(-selfAudioBoard->actionVolumeIncrementValue());
}


/**
* @brief Toggle start stop
*
Expand Down Expand Up @@ -323,10 +324,20 @@ class AudioBoardStream : public I2SCodecStream {
addVolumeActions();
}

/// Defines the increment value used by actionVolumeDown/actionVolumeUp
void setActionVolumeIncrementValue(float value){
action_increment_value = value;
}

float actionVolumeIncrementValue() {
return action_increment_value;
}

protected:
AudioActions actions;
bool headphoneIsConnected = false;
bool active = true;
float action_increment_value = 0.02;

int getSdCsPin() {
static GpioPin sd_cs = -2;
Expand Down

0 comments on commit 899d367

Please sign in to comment.