Update several codec Makefiles so that the codec libs build again on Coldfire targets...
[Rockbox.git] / apps / status.c
blob2a57db0f893876d31fe2f3d899477d5dedd4613c
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 "string.h"
20 #include "lcd.h"
21 #include "debug.h"
22 #include "kernel.h"
23 #include "power.h"
24 #include "thread.h"
25 #include "settings.h"
26 #include "status.h"
27 #include "mp3_playback.h"
28 #include "audio.h"
29 #include "gwps.h"
30 #include "abrepeat.h"
31 #include "statusbar.h"
32 #ifdef CONFIG_RTC
33 #include "timefuncs.h"
34 #endif
35 #ifdef HAVE_LCD_BITMAP
36 #include "icons.h"
37 #include "font.h"
38 #endif
39 #include "powermgmt.h"
40 #include "led.h"
41 #include "sound.h"
42 #if CONFIG_KEYPAD == IRIVER_H100_PAD
43 #include "button.h"
44 #endif
45 #include "usb.h"
46 #ifdef CONFIG_TUNER
47 #include "radio.h"
48 #endif
49 #if CONFIG_CODEC == SWCODEC
50 #include "pcm_record.h"
51 #endif
53 enum playmode ff_mode;
55 void status_init(void)
57 ff_mode = 0;
60 void status_set_ffmode(enum playmode mode)
62 ff_mode = mode; /* Either STATUS_FASTFORWARD or STATUS_FASTBACKWARD */
65 enum playmode status_get_ffmode(void)
67 /* only use this function for STATUS_FASTFORWARD or STATUS_FASTBACKWARD */
68 /* use audio_status() for other modes */
69 return ff_mode;
72 int current_playmode(void)
74 int audio_stat = audio_status();
76 /* ff_mode can be either STATUS_FASTFORWARD or STATUS_FASTBACKWARD
77 and that supercedes the other modes */
78 if(ff_mode)
79 return ff_mode;
81 if(audio_stat & AUDIO_STATUS_PLAY)
83 if(audio_stat & AUDIO_STATUS_PAUSE)
84 return STATUS_PAUSE;
85 else
86 return STATUS_PLAY;
89 #ifdef HAVE_RECORDING
90 #if CONFIG_CODEC == SWCODEC
91 audio_stat = pcm_rec_status();
92 #endif
94 if(audio_stat & AUDIO_STATUS_RECORD)
96 if(audio_stat & AUDIO_STATUS_PAUSE)
97 return STATUS_RECORD_PAUSE;
98 else
99 return STATUS_RECORD;
101 #endif
103 #ifdef CONFIG_TUNER
104 audio_stat = get_radio_status();
106 if(audio_stat & FMRADIO_PLAYING)
107 return STATUS_RADIO;
109 if(audio_stat & FMRADIO_PAUSED)
110 return STATUS_RADIO_PAUSE;
111 #endif
113 return STATUS_STOP;
116 #if defined(HAVE_LCD_CHARCELLS)
117 bool record = false;
118 bool audio = false;
119 bool param = false;
120 bool usb = false;
122 void status_set_record(bool b)
124 record = b;
127 void status_set_audio(bool b)
129 audio = b;
132 void status_set_param(bool b)
134 param = b;
137 void status_set_usb(bool b)
139 usb = b;
142 #endif /* HAVE_LCD_CHARCELLS */