Add names for the buttons in the Quick Start tab.
[Rockbox.git] / uisimulator / common / fmradio.c
blob279e1b8d23440a1693fff1f1ec69ab9e1846cc28
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #include <stdbool.h>
20 #include "config.h"
21 #include "debug.h"
22 #include "tuner.h"
24 #if CONFIG_TUNER
26 static int frequency = 0;
27 static bool mono = false;
29 static bool powered = false;
31 void tuner_init(void)
35 int tuner_set(int setting, int value)
37 switch(setting)
39 case RADIO_SLEEP:
40 break;
42 case RADIO_FREQUENCY:
43 frequency = value;
44 break;
46 case RADIO_SCAN_FREQUENCY:
47 frequency = value;
48 break;
50 case RADIO_MUTE:
51 break;
53 case RADIO_FORCE_MONO:
54 mono = value?true:false;
55 break;
57 default:
58 return -1;
61 return 1;
64 int tuner_get(int setting)
66 int val = 0;
68 switch(setting)
70 case RADIO_PRESENT:
71 val = 1; /* true */
72 break;
74 case RADIO_TUNED:
75 if(frequency == 99500000)
76 val = 1;
77 break;
79 case RADIO_STEREO:
80 if(frequency == 99500000)
81 val = mono?0:1;
82 break;
84 case RADIO_ALL: /* debug query */
85 break;
87 return val;
90 bool tuner_power(bool status)
92 bool oldstatus = powered;
93 powered = status;
94 return oldstatus;
97 #endif