1
0
Fork 0

gbmusic: only auto-start from clock apps

master
Richard de Boer 2021-04-25 15:11:26 +02:00
parent 3201e363b0
commit 94fe988b08
3 changed files with 9 additions and 2 deletions

View File

@ -1,2 +1,3 @@
0.01: Initial version
0.02: Increase text brightness, improve controls, (try to) reduce memory usage
0.02: Increase text brightness, improve controls, (try to) reduce memory usage
0.03: Only auto-start if active app is a clock

View File

@ -538,7 +538,7 @@ function startLCDWatch() {
/////////////////////
// check for saved music stat (by widget) to load
g.clear();
global.gbmusic_active = true; // we don't need our widget
global.gbmusic_active = true; // we don't need our widget (needed for <2.09 devices)
Bangle.loadWidgets();
Bangle.drawWidgets();
delete (global.gbmusic_active);

View File

@ -2,6 +2,12 @@
if (global.gbmusic_active || !(require("Storage").readJSON("gbmusic.json", 1) || {}).autoStart) {
return
}
if (typeof __FILE__ === 'string') { // only exists since 2v09
const info = require("Storage").readJSON(__FILE__.split(".")[0]+".info", 1) || false;
if (info && info.type!=="clock") { // info can have no type (but then it isn't a clock)
return;
}
}
let state, info
function checkMusic() {