Skip to content

Commit

Permalink
finally got mixer meter to work on all devices ... i think
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaji Khan committed Mar 15, 2023
1 parent 08171f7 commit 271ce44
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.shajikhan.ladspa.amprack"
minSdk 23
targetSdk 31
versionCode 47
versionName '3.01'
versionCode 48
versionName '3.02'

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/cpp/Meter.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ class Meter {

for (int i = 0; i < bufferUsedOutput; i++) {
for (int j = 0; j < sbuffer[i].pos; j++) {
if (sbuffer[i].data[j] > max)
if (sbuffer[i].data[j] > max && sbuffer[i].data[j] > 0.01 && sbuffer[i].data[j] < 1.01)
max = sbuffer[i].data[j];
}
}

// max = sbuffer[0].data[0];

// LOGD ("%f", max);
envOutput->CallStaticVoidMethod(mainActivityOutput, setMixerMeterOutput, (jfloat) max, false);
bufferUsedOutput = 0;
Expand Down Expand Up @@ -158,7 +160,7 @@ class Meter {

for (int i = 0; i < bufferUsed; i++) {
for (int j = 0; j < sbuffer[i].pos; j++) {
if (sbuffer[i].data[j] > max)
if (sbuffer[i].data[j] > max && sbuffer[i].data[j] > 0.01 && sbuffer[i].data[j] < 1.01)
max = sbuffer[i].data[j];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2345,16 +2345,19 @@ static void setMixerMeter (float inputValue, float outputValue) {
outputMeter.setProgress((int) (outputValue * 100));
}
static void setMixerMeterSwitch (float inputValue, boolean isInput) {
// Log.d(TAG, "setMixerMeterSwitch() called with: inputValue = [" + inputValue + "], isInput = [" + isInput + "]");
if (isInput)
inputMeter.setProgress((int) (inputValue * 100));
else
outputMeter.setProgress((int) (inputValue * 100));
}

static void setMixerMeterInput (float inputValue) {
// Log.d(TAG, "setMixerMeterInput() called with: inputValue = [" + inputValue + "]");
inputMeter.setProgress((int) (inputValue * 100));
}
static void setMixerMeterOutput (float outputValue) {
// Log.d(TAG, "setMixerMeterOutput() called with: outputValue = [" + outputValue + "]");
outputMeter.setProgress((int) (outputValue * 100));
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<resources>
<string name="app_name">Amp Rack</string>
<string name="app_version">Version 3 Nighthawk</string>
<string name="build_id">328</string>
<string name="build_id">333</string>
<string name="onboard_theme_chooser">
Choose a theme for the UI. Choose Material Theme for Native
Android Material Design, or Tube Amp theme based on the new
Expand Down

0 comments on commit 271ce44

Please sign in to comment.