Skip to content

Commit 2256eaf

Browse files
Made display show dB values instead of actual sample value and removed release steps for now from actions
1 parent 5def212 commit 2256eaf

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,3 @@ jobs:
3131
name: aGain-${{matrix.os}}
3232
path: build/aGain_artefacts/${{env.BUILD_TYPE}}/VST3/*.vst3
3333

34-
release:
35-
needs: build
36-
runs-on: ubuntu-latest
37-
if: startsWith(github.ref, 'refs/tags/v')
38-
39-
steps:
40-
- name: Download all artifacts
41-
uses: actions/download-artifact@v4
42-
with:
43-
path: artifacts
44-
45-
- name: Create Release
46-
uses: softprops/action-gh-release@v1
47-
with:
48-
files: |
49-
artifacts/*.zip
50-
draft: false
51-
prerelease: false
52-
generate_release_notes: true
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/PluginProcessor.cc

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "PluginProcessor.h"
2+
#include <cmath>
23

34
//==============================================================================
45
AudioPluginAudioProcessor::AudioPluginAudioProcessor()
@@ -11,7 +12,29 @@ AudioPluginAudioProcessor::AudioPluginAudioProcessor()
1112
#endif
1213
)
1314
{
14-
addParameter(gain = new juce::AudioParameterFloat({"gain", 1}, "Gain", 0.0f, 1.0f, 0.5f));
15+
addParameter(gain = new juce::AudioParameterFloat(
16+
{"gain", 1},
17+
"Gain",
18+
juce::NormalisableRange<float>(0.0f, 1.0f),
19+
1.0f,
20+
"",
21+
juce::AudioProcessorParameter::genericParameter,
22+
[](float value, int) {
23+
if(value <= 0.0f) {
24+
return juce::String("-inf dB");
25+
}
26+
27+
float dbValue = 20.0f * std::log10(value);
28+
return juce::String(dbValue, 1) + " dB";
29+
},
30+
[](const juce::String& text){
31+
float dbValue = text.getFloatValue();
32+
if(dbValue <= 60.0f) {
33+
return 0.0f;
34+
}
35+
36+
return std::pow(10.0f, dbValue / 20.0f);
37+
}));
1538
}
1639

1740
AudioPluginAudioProcessor::~AudioPluginAudioProcessor()

0 commit comments

Comments
 (0)