Skip to content

Commit

Permalink
spotrem: use new slider library to change volume
Browse files Browse the repository at this point in the history
  • Loading branch information
thyttan committed Aug 8, 2023
1 parent b9416ff commit ecdc15e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/spotrem/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ when fastloading.
0.08: Issue newline before GB commands (solves issue with console.log and ignored commands)
0.09: Don't send the gadgetbridge wake command twice. Once should do since we
issue newline before GB commands.
0.10: Use new slider library for changing the volume.
11 changes: 10 additions & 1 deletion apps/spotrem/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,16 @@ let setUI = function() {
}
},
ud => {
if (ud) Bangle.musicControl(ud>0 ? "volumedown" : "volumeup");
//if (ud) Bangle.musicControl(ud>0 ? "volumedown" : "volumeup");

if (ud) {

let callback = (mode, fb)=>{
if (mode == "map") Bangle.musicControl({cmd:"volumesetlevel", extra:Math.round(100*fb/30)});
if (mode == "incr") Bangle.musicControl(fb>0 ? "volumedown" : "volumeup");
};
require("SliderInput").interface(callback, true, true);
}
}
);
Bangle.on("touch", touchHandler);
Expand Down
2 changes: 1 addition & 1 deletion apps/spotrem/metadata.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "spotrem",
"name": "Remote for Spotify",
"version": "0.09",
"version": "0.10",
"description": "Control spotify on your android device.",
"readme": "README.md",
"type": "app",
Expand Down

0 comments on commit ecdc15e

Please sign in to comment.