gbmusic: only auto-start from clock apps
parent
3201e363b0
commit
94fe988b08
|
|
@ -1,2 +1,3 @@
|
||||||
0.01: Initial version
|
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
|
||||||
|
|
@ -538,7 +538,7 @@ function startLCDWatch() {
|
||||||
/////////////////////
|
/////////////////////
|
||||||
// check for saved music stat (by widget) to load
|
// check for saved music stat (by widget) to load
|
||||||
g.clear();
|
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.loadWidgets();
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
delete (global.gbmusic_active);
|
delete (global.gbmusic_active);
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,12 @@
|
||||||
if (global.gbmusic_active || !(require("Storage").readJSON("gbmusic.json", 1) || {}).autoStart) {
|
if (global.gbmusic_active || !(require("Storage").readJSON("gbmusic.json", 1) || {}).autoStart) {
|
||||||
return
|
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
|
let state, info
|
||||||
function checkMusic() {
|
function checkMusic() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue