Fix sound overlapping and keystore path in pipeline
All checks were successful
Build Android APK / build (push) Successful in 2m54s
All checks were successful
Build Android APK / build (push) Successful in 2m54s
This commit is contained in:
@@ -23,9 +23,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Keystore
|
- name: Setup Keystore
|
||||||
run: |
|
run: |
|
||||||
echo "${{ secrets.ANDROIDKEYSTOREBASE64 }}" | base64 -d > helldivers.keystore
|
echo "${{ secrets.ANDROIDKEYSTOREBASE64 }}" | base64 -d > app/helldivers.keystore
|
||||||
env:
|
env:
|
||||||
ANDROIDKEYSTOREPATH: helldivers.keystore
|
ANDROIDKEYSTOREPATH: app/helldivers.keystore
|
||||||
ANDROIDKEYSTOREPASS: ${{ secrets.ANDROIDKEYSTOREPASS }}
|
ANDROIDKEYSTOREPASS: ${{ secrets.ANDROIDKEYSTOREPASS }}
|
||||||
ANDROIDKEYALIAS: ${{ secrets.ANDROIDKEYALIAS }}
|
ANDROIDKEYALIAS: ${{ secrets.ANDROIDKEYALIAS }}
|
||||||
ANDROIDKEYPASS: ${{ secrets.ANDROIDKEYPASS }}
|
ANDROIDKEYPASS: ${{ secrets.ANDROIDKEYPASS }}
|
||||||
|
|||||||
@@ -17,38 +17,44 @@ public class SoundManager {
|
|||||||
private ToneGenerator toneGenerator;
|
private ToneGenerator toneGenerator;
|
||||||
private Handler handler;
|
private Handler handler;
|
||||||
private boolean enabled = true;
|
private boolean enabled = true;
|
||||||
|
private boolean isPlaying = false;
|
||||||
|
private Runnable stopToneRunnable;
|
||||||
|
|
||||||
public SoundManager(Context context) {
|
public SoundManager(Context context) {
|
||||||
// ToneGenerator.STREAM_MUSIC para compatibilidad API 18+
|
// ToneGenerator.STREAM_MUSIC para compatibilidad API 18+
|
||||||
toneGenerator = new ToneGenerator(AudioManager.STREAM_MUSIC, VOLUME);
|
toneGenerator = new ToneGenerator(AudioManager.STREAM_MUSIC, VOLUME);
|
||||||
handler = new Handler(Looper.getMainLooper());
|
handler = new Handler(Looper.getMainLooper());
|
||||||
|
stopToneRunnable = () -> isPlaying = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sonido de click de boton - tono corto y agudo
|
* Sonido de click de boton - tono corto y agudo
|
||||||
*/
|
*/
|
||||||
public void playButtonClick() {
|
public void playButtonClick() {
|
||||||
if (!enabled || toneGenerator == null) return;
|
if (!enabled || toneGenerator == null || isPlaying) return;
|
||||||
// Tono DTMF 6 - sonido tipo boton tactil
|
isPlaying = true;
|
||||||
toneGenerator.startTone(ToneGenerator.TONE_DTMF_6, 80);
|
toneGenerator.startTone(ToneGenerator.TONE_DTMF_6, 80);
|
||||||
|
handler.postDelayed(stopToneRunnable, 80);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sonido de exito - secuencia ascendente
|
* Sonido de exito - secuencia ascendente
|
||||||
*/
|
*/
|
||||||
public void playSuccess() {
|
public void playSuccess() {
|
||||||
if (!enabled || toneGenerator == null) return;
|
if (!enabled || toneGenerator == null || isPlaying) return;
|
||||||
// Tono de confirmacion propositivo
|
isPlaying = true;
|
||||||
toneGenerator.startTone(ToneGenerator.TONE_PROP_ACK, 150);
|
toneGenerator.startTone(ToneGenerator.TONE_PROP_ACK, 150);
|
||||||
|
handler.postDelayed(stopToneRunnable, 150);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sonido de fallo - tono bajo grave
|
* Sonido de fallo - tono bajo grave
|
||||||
*/
|
*/
|
||||||
public void playFailure() {
|
public void playFailure() {
|
||||||
if (!enabled || toneGenerator == null) return;
|
if (!enabled || toneGenerator == null || isPlaying) return;
|
||||||
// Tono de error
|
isPlaying = true;
|
||||||
toneGenerator.startTone(ToneGenerator.TONE_PROP_NACK, 200);
|
toneGenerator.startTone(ToneGenerator.TONE_PROP_NACK, 200);
|
||||||
|
handler.postDelayed(stopToneRunnable, 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,7 +62,8 @@ public class SoundManager {
|
|||||||
* Usa diferentes tonos DTMF para cada direccion
|
* Usa diferentes tonos DTMF para cada direccion
|
||||||
*/
|
*/
|
||||||
public void playTone(int direction) {
|
public void playTone(int direction) {
|
||||||
if (!enabled || toneGenerator == null) return;
|
if (!enabled || toneGenerator == null || isPlaying) return;
|
||||||
|
isPlaying = true;
|
||||||
|
|
||||||
int tone;
|
int tone;
|
||||||
switch (direction) {
|
switch (direction) {
|
||||||
@@ -76,22 +83,27 @@ public class SoundManager {
|
|||||||
tone = ToneGenerator.TONE_DTMF_0;
|
tone = ToneGenerator.TONE_DTMF_0;
|
||||||
}
|
}
|
||||||
toneGenerator.startTone(tone, 100);
|
toneGenerator.startTone(tone, 100);
|
||||||
|
handler.postDelayed(stopToneRunnable, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tono de inicio de secuencia
|
* Tono de inicio de secuencia
|
||||||
*/
|
*/
|
||||||
public void playSequenceStart() {
|
public void playSequenceStart() {
|
||||||
if (!enabled || toneGenerator == null) return;
|
if (!enabled || toneGenerator == null || isPlaying) return;
|
||||||
|
isPlaying = true;
|
||||||
toneGenerator.startTone(ToneGenerator.TONE_SUP_DIAL, 100);
|
toneGenerator.startTone(ToneGenerator.TONE_SUP_DIAL, 100);
|
||||||
|
handler.postDelayed(stopToneRunnable, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tono de alerta/peligro
|
* Tono de alerta/peligro
|
||||||
*/
|
*/
|
||||||
public void playAlert() {
|
public void playAlert() {
|
||||||
if (!enabled || toneGenerator == null) return;
|
if (!enabled || toneGenerator == null || isPlaying) return;
|
||||||
|
isPlaying = true;
|
||||||
toneGenerator.startTone(ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD, 150);
|
toneGenerator.startTone(ToneGenerator.TONE_CDMA_ALERT_CALL_GUARD, 150);
|
||||||
|
handler.postDelayed(stopToneRunnable, 150);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnabled(boolean enabled) {
|
public void setEnabled(boolean enabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user