Kevin Ferrare | 93b2f9f | 2007-08-04 03:01:46 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id: jackpot.c 14034 2007-07-28 05:42:55Z kevin $ |
| 9 | * |
Nicolas Pennequin | 357ffb3 | 2008-05-05 10:32:46 +0000 | [diff] [blame] | 10 | * Copyright (C) 2007 Copyright Kévin Ferrare based on Zakk Roberts's work |
Kevin Ferrare | 93b2f9f | 2007-08-04 03:01:46 +0000 | [diff] [blame] | 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame^] | 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
Kevin Ferrare | 93b2f9f | 2007-08-04 03:01:46 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #ifndef _CLOCK_SETTINGS_ |
| 23 | #define _CLOCK_SETTINGS_ |
| 24 | #include "plugin.h" |
| 25 | |
| 26 | enum date_format{ |
| 27 | NONE, |
| 28 | ENGLISH, |
| 29 | EUROPEAN, |
| 30 | JAPANESE, |
| 31 | }; |
| 32 | |
| 33 | enum hour_format{ |
| 34 | H24, |
| 35 | H12 |
| 36 | }; |
| 37 | |
| 38 | enum clock_modes{ |
| 39 | ANALOG, |
| 40 | DIGITAL, |
| 41 | BINARY, |
| 42 | NB_CLOCK_MODES |
| 43 | }; |
| 44 | |
| 45 | enum backlight_handling{ |
| 46 | ALWAS_OFF, |
| 47 | ROCKBOX_SETTING, |
| 48 | ALWAYS_ON |
| 49 | }; |
| 50 | |
| 51 | |
| 52 | struct general_settings{ |
| 53 | int hour_format;/* 0:24h, 1:12h*/ |
| 54 | int date_format; |
| 55 | bool show_counter; |
| 56 | bool save_settings; |
| 57 | bool idle_poweroff; |
| 58 | int backlight; |
| 59 | }; |
| 60 | |
| 61 | struct analog_settings{ |
| 62 | bool show_date; |
| 63 | bool show_seconds; |
| 64 | bool show_border; |
| 65 | }; |
| 66 | |
| 67 | struct digital_settings{ |
| 68 | int show_seconds; |
| 69 | int blinkcolon; |
| 70 | }; |
| 71 | |
| 72 | struct clock_settings{ |
| 73 | int mode; /* clock mode */ |
| 74 | int skin[NB_CLOCK_MODES];/* how does each mode looks like */ |
| 75 | struct general_settings general; |
| 76 | struct analog_settings analog; |
| 77 | struct digital_settings digital; |
| 78 | }; |
| 79 | |
| 80 | extern struct clock_settings clock_settings; |
| 81 | |
| 82 | /* settings are saved to this location */ |
Robert Kukla | 4071826 | 2008-03-17 22:27:25 +0000 | [diff] [blame] | 83 | #define settings_filename PLUGIN_APPS_DIR "/.clock_settings" |
Kevin Ferrare | 93b2f9f | 2007-08-04 03:01:46 +0000 | [diff] [blame] | 84 | |
| 85 | void clock_settings_skin_next(struct clock_settings* settings); |
| 86 | void clock_settings_skin_previous(struct clock_settings* settings); |
| 87 | void apply_backlight_setting(int backlight_setting); |
| 88 | void clock_settings_reset(struct clock_settings* settings); |
| 89 | void load_settings(void); |
| 90 | void save_settings(void); |
| 91 | void save_settings_wo_gui(void); |
| 92 | |
| 93 | #endif /* _CLOCK_SETTINGS_ */ |