diff --git a/apps/gbmusic/ChangeLog b/apps/gbmusic/ChangeLog index 814e6d3ae..ecbca5fb6 100644 --- a/apps/gbmusic/ChangeLog +++ b/apps/gbmusic/ChangeLog @@ -2,4 +2,4 @@ 0.02: Increase text brightness, improve controls, (try to) reduce memory usage 0.03: Only auto-start if active app is a clock, auto close after 1 hour of inactivity 0.04: Setting to disable touch controls, minor bugfix -0.05: Remove touch controls setting, reduce fadeout flicker \ No newline at end of file +0.05: Setting to disable double/triple press control, remove touch controls setting, reduce fadeout flicker \ No newline at end of file diff --git a/apps/gbmusic/README.md b/apps/gbmusic/README.md index 52a74499c..4bad9b8c8 100644 --- a/apps/gbmusic/README.md +++ b/apps/gbmusic/README.md @@ -22,6 +22,9 @@ You can change these under `Settings`->`App/Widget Settings`->`Music Controls`. Automatically load the app when you play music and close when the music stops. (If the app opened automatically, it closes after music has been paused for 5 minutes.) +**Simple button**: +Disable double/triple pressing Button 2: always simply toggle play/pause. +(For music players which handle multiple button presses themselves.) ## Controls diff --git a/apps/gbmusic/app.js b/apps/gbmusic/app.js index 741c2b48b..5f95868bb 100644 --- a/apps/gbmusic/app.js +++ b/apps/gbmusic/app.js @@ -485,11 +485,19 @@ function startButtonWatches() { tPress = setTimeout(() => {Bangle.showLauncher();}, 3000); } }, BTN2, {repeat: true, edge: "rising"}); - setWatch(() => { - nPress++; - clearTimeout(tPress); - tPress = setTimeout(handleButton2Press, 500); - }, BTN2, {repeat: true, edge: "falling"}); + const s = require("Storage").readJSON("gbmusic.json", 1) || {}; + if (s.simpleButton) { + setWatch(() => { + clearTimeout(tPress); + togglePlay(); + }, BTN2, {repeat: true, edge: "falling"}); + } else { + setWatch(() => { + nPress++; + clearTimeout(tPress); + tPress = setTimeout(handleButton2Press, 500); + }, BTN2, {repeat: true, edge: "falling"}); + } } function handleButton2Press() { tPress = null; diff --git a/apps/gbmusic/settings.js b/apps/gbmusic/settings.js index e81a2c320..ae013fda5 100644 --- a/apps/gbmusic/settings.js +++ b/apps/gbmusic/settings.js @@ -9,6 +9,7 @@ // initialize with default settings... let s = { autoStart: true, + simpleButton: false, }; // ...and overwrite them with any saved values // This way saved values are preserved if a new version adds more settings @@ -34,6 +35,11 @@ format: yesNo, onchange: save("autoStart"), }; + menu[translate("Simple button")] = { + value: !!s.simpleButton, + format: yesNo, + onchange: save("simpleButton"), + }; E.showMenu(menu); });