Revert "adding settings"

This reverts commit 3beaab82ce.
pull/423/head
Michael Bengfort 2020-05-15 13:52:25 +02:00
parent 2498881609
commit 4fa752397f
25 changed files with 14 additions and 62 deletions

0
apps/banglerun/ChangeLog Normal file → Executable file
View File

0
apps/buffgym/buffgym-scrn1.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

0
apps/buffgym/buffgym-scrn2.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

0
apps/buffgym/buffgym-scrn3.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

0
apps/buffgym/buffgym-scrn4.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

0
apps/buffgym/buffgym-scrn5.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

0
apps/buffgym/buffgym-scrn6.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

0
apps/buffgym/buffgym.app.js Normal file → Executable file
View File

0
apps/buffgym/buffgym.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

0
apps/marioclock/mario-clock-screen-shot.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -6,26 +6,8 @@ var tindex=0; //index to iterate through time_diffs
Bangle.setLCDTimeout(undefined); //do not deaktivate display while running this app
const storage = require("Storage");
const SETTINGS_FILE = 'metronome.settings.json';
//return setting
function setting(key) {
//define default settings
const DEFAULTS = {
'beatsperbar': 4,
};
if (!settings) { loadSettings(); }
return (key in settings) ? settings[key] : DEFAULTS[key];
}
//load settings
let settings;
function loadSettings() {
settings = storage.readJSON(SETTINGS_FILE, 1) || {};
function changecolor() {
const maxColors = 2;
const colors = {
0: { value: 0xF800, name: "Red" },
1: { value: 0xFFFF, name: "White" },
@ -35,10 +17,21 @@ function changecolor() {
5: { value: 0xFFFF, name: "White" },
6: { value: 0x03E0, name: "DarkGreen" },
7: { value: 0xFFFF, name: "White" },
8: { value: 0x03E0, name: "DarkGreen" },
8: { value: 0x7BEF, name: "DarkGrey" },
// 9: { value: 0x001F, name: "Blue" },
// 9: { value: 0x001F, name: "Blue" },
// 10: { value: 0x07E0, name: "Green" },
// 11: { value: 0x07FF, name: "Cyan" },
1: { value: 0xF800, name: "Red" },
// 13: { value: 0xF81F, name: "Magenta" },
// 14: { value: 0xFFE0, name: "Yellow" },
// 15: { value: 0xFFFF, name: "White" },
// 16: { value: 0xFD20, name: "Orange" },
// 17: { value: 0xAFE5, name: "GreenYellow" },
// 18: { value: 0xF81F, name: "Pink" },
};
g.setColor(colors[cindex].value);
if (cindex == setting('beatsperbar')-1) {
if (cindex == maxColors-1) {
cindex = 0;
}
else {
@ -59,7 +52,6 @@ function updateScreen() {
g.drawString(Math.floor(bpm)+"bpm", 5, 60);
}
Bangle.on('touch', function(button) {
// setting bpm by tapping the screen. Uses the mean time difference between several tappings.
if (tindex < time_diffs.length) {

View File

@ -1,40 +0,0 @@
// This file should contain exactly one function, which shows the app's settings
/**
* @param {function} back Use back() to return to settings menu
*/
(function(back) {
const SETTINGS_FILE = 'metronome.settings.json';
// initialize with default settings...
let s = {
'beatsperbar': 4,
};
// ...and overwrite them with any saved values
// This way saved values are preserved if a new version adds more settings
const storage = require('Storage');
const saved = storage.readJSON(SETTINGS_FILE, 1) || {};
for (const key in saved) {
s[key] = saved[key];
}
// creates a function to safe a specific setting, e.g. save('color')(1)
function save(key) {
return function(value) {
s[key] = value;
storage.write(SETTINGS_FILE, s);
};
}
const menu = {
'': { 'title': 'Metronome' },
'< Back': back,
'beats per bar': {
value: s.beatsperbar,
min: 1,
max: 8,
step: 1,
onchange: save('beatsperbar'),
},
};
E.showMenu(menu);
});

0
apps/miclock/clock-mixed.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 707 B

After

Width:  |  Height:  |  Size: 707 B

0
apps/minionclk/ChangeLog Normal file → Executable file
View File

0
apps/minionclk/app-icon.js Normal file → Executable file
View File

0
apps/minionclk/app.js Normal file → Executable file
View File

0
apps/minionclk/minionclk.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

0
apps/rpgdice/ChangeLog Normal file → Executable file
View File

0
apps/rpgdice/app-icon.js Normal file → Executable file
View File

0
apps/rpgdice/app.js Normal file → Executable file
View File

0
apps/rpgdice/rpgdice.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

0
apps/sclock/clock-simple.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 590 B

After

Width:  |  Height:  |  Size: 590 B

0
apps/scolor/show-color.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 237 B

After

Width:  |  Height:  |  Size: 237 B

0
bin/firmwaremaker.js Normal file → Executable file
View File

0
bin/sanitycheck.js Normal file → Executable file
View File