summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2002-06-27 00:54:45 +0000
committerBjörn Stenberg <bjorn@haxx.se>2002-06-27 00:54:45 +0000
commit61ab8080d8b81d8bae3f0b23dadfb2aff9edd0eb (patch)
tree0e80e6e87241b74e71a1d3a66548409da068af26
parent706d6ee882125ab3a274509ade5e5db78d42f1f3 (diff)
downloadrockbox-61ab8080d8b81d8bae3f0b23dadfb2aff9edd0eb.tar.gz
rockbox-61ab8080d8b81d8bae3f0b23dadfb2aff9edd0eb.zip
Moved settings.c/h to apps/
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1217 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/settings.c103
-rw-r--r--firmware/settings.h87
2 files changed, 0 insertions, 190 deletions
diff --git a/firmware/settings.c b/firmware/settings.c
deleted file mode 100644
index 6d22419dfe..0000000000
--- a/firmware/settings.c
+++ /dev/null
@@ -1,103 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by wavey@wavey.org
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#include <stdio.h>
21#include "config.h"
22#include "settings.h"
23#include "disk.h"
24#include "panic.h"
25#include "debug.h"
26
27user_settings_t global_settings;
28
29/*
30 * persist all runtime user settings to disk
31 */
32int persist_all_settings( void )
33{
34 return 1;
35}
36
37/*
38 * persist all the playlist information to disk
39 */
40int persist_all_playlist_info( void )
41{
42 return 1;
43}
44
45/*
46 * load settings from disk
47 */
48void reload_all_settings( user_settings_t *settings )
49{
50 DEBUGF( "reload_all_settings()\n" );
51
52 /* this is a TEMP stub version */
53
54 /* populate settings with default values */
55
56 reset_settings( settings );
57}
58
59/*
60 * reset all settings to their default value
61 */
62void reset_settings( user_settings_t *settings ) {
63
64 DEBUGF( "reset_settings()\n" );
65
66 settings->volume = DEFAULT_VOLUME_SETTING;
67 settings->balance = DEFAULT_BALANCE_SETTING;
68 settings->bass = DEFAULT_BASS_SETTING;
69 settings->treble = DEFAULT_TREBLE_SETTING;
70 settings->loudness = DEFAULT_LOUDNESS_SETTING;
71 settings->bass_boost = DEFAULT_BASS_BOOST_SETTING;
72 settings->contrast = DEFAULT_CONTRAST_SETTING;
73 settings->poweroff = DEFAULT_POWEROFF_SETTING;
74 settings->backlight = DEFAULT_BACKLIGHT_SETTING;
75 settings->wps_display = DEFAULT_WPS_DISPLAY;
76}
77
78
79/*
80 * dump the list of current settings
81 */
82void display_current_settings( user_settings_t *settings )
83{
84#ifdef DEBUG
85 DEBUGF( "\ndisplay_current_settings()\n" );
86
87 DEBUGF( "\nvolume:\t\t%d\nbalance:\t%d\nbass:\t\t%d\ntreble:\t\t%d\nloudness:\t%d\nbass boost:\t%d\n",
88 settings->volume,
89 settings->balance,
90 settings->bass,
91 settings->treble,
92 settings->loudness,
93 settings->bass_boost );
94
95 DEBUGF( "contrast:\t%d\npoweroff:\t%d\nbacklight:\t%d\n",
96 settings->contrast,
97 settings->poweroff,
98 settings->backlight );
99#else
100 /* Get rid of warning */
101 settings = settings;
102#endif
103}
diff --git a/firmware/settings.h b/firmware/settings.h
deleted file mode 100644
index 723c694699..0000000000
--- a/firmware/settings.h
+++ /dev/null
@@ -1,87 +0,0 @@
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2002 by wavey@wavey.org
11 *
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
20#ifndef __SETTINGS_H__
21#define __SETTINGS_H__
22
23/* data structures */
24
25typedef enum
26{
27 RESUME_NONE, /* do not resume */
28 RESUME_SONG, /* resume song at startup */
29 RESUME_PLAYLIST /* resume playlist at startup */
30} resume_t;
31
32typedef struct
33{
34 /* audio settings */
35
36 int volume; /* audio output volume: 0-100 0=off 100=max */
37 int balance; /* stereo balance: 0-100 0=left 50=bal 100=right */
38 int bass; /* bass eq: 0-100 0=off 100=max */
39 int treble; /* treble eq: 0-100 0=low 100=high */
40 int loudness; /* loudness eq: 0-100 0=off 100=max */
41 int bass_boost; /* bass boost eq: 0-100 0=off 100=max */
42
43 /* device settings */
44
45 int contrast; /* lcd contrast: 0-100 0=low 100=high */
46 int poweroff; /* power off timer: 0-100 0=never:each 1% = 60 secs */
47 int backlight; /* backlight off timer: 0-100 0=never:each 1% = 10 secs */
48
49 /* resume settings */
50
51 resume_t resume; /* power-on song resume: 0=no. 1=yes song. 2=yes pl */
52 int track_time; /* number of seconds into the track to resume */
53
54 /* misc options */
55
56 int loop_playlist; /* do we return to top of playlist at end? */
57
58
59 /* while playing screen settings */
60 int wps_display;
61
62} user_settings_t;
63
64/* prototypes */
65
66int persist_all_settings( void );
67void reload_all_settings( user_settings_t *settings );
68void reset_settings( user_settings_t *settings );
69void display_current_settings( user_settings_t *settings );
70
71/* global settings */
72extern user_settings_t global_settings;
73
74/* system defines */
75
76#define DEFAULT_VOLUME_SETTING 70
77#define DEFAULT_BALANCE_SETTING 50
78#define DEFAULT_BASS_SETTING 50
79#define DEFAULT_TREBLE_SETTING 50
80#define DEFAULT_LOUDNESS_SETTING 0
81#define DEFAULT_BASS_BOOST_SETTING 0
82#define DEFAULT_CONTRAST_SETTING 0
83#define DEFAULT_POWEROFF_SETTING 0
84#define DEFAULT_BACKLIGHT_SETTING 5
85#define DEFAULT_WPS_DISPLAY 0
86
87#endif /* __SETTINGS_H__ */