1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Jonathan Gordon
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.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
27 #include "skin_engine/skin_engine.h"
32 #include "appevents.h"
33 #include "statusbar-skinned.h"
34 #include "option_select.h"
35 #ifdef HAVE_TOUCHSCREEN
41 char* default_radio_skin(enum screen_type screen
)
44 static char default_fms
[] =
45 "%s%?Ti<%Ti. |>%?Tn<%Tn|%Tf>\n"
46 "%Sx(Station:) %tf MHz\n"
47 "%?St(force fm mono)<%Sx(Force Mono)|%?ts<%Sx(Stereo)|%Sx(Mono)>>\n"
48 "%Sx(Mode:) %?tm<%Sx(Scan)|%Sx(Preset)>\n"
49 #ifdef HAVE_RADIO_RSSI
50 "%Sx(Signal strength:) %tr dBuV\n"
52 #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
53 "%?Rr<%Sx(Time:) %Rh:%Rn:%Rs|%?St(prerecording time)<%pm|%Sx(Prerecord Time) %Rs>>\n"
64 void fms_fix_displays(enum fms_exiting toggle_state
)
68 struct wps_data
*data
= skin_get_gwps(FM_SCREEN
, i
)->data
;
69 if (toggle_state
== FMS_ENTER
)
71 viewportmanager_theme_enable(i
, skin_has_sbs(i
, data
), NULL
);
72 #ifdef HAVE_BACKDROP_IMAGE
73 skin_backdrop_show(data
->backdrop_id
);
75 screens
[i
].clear_display();
76 /* force statusbar/skin update since we just cleared the whole screen */
77 send_event(GUI_EVENT_ACTIONUPDATE
, (void*)1);
81 screens
[i
].stop_scroll();
82 #ifdef HAVE_BACKDROP_IMAGE
83 skin_backdrop_show(sb_get_backdrop(i
));
85 viewportmanager_theme_undo(i
, skin_has_sbs(i
, data
));
87 #ifdef HAVE_TOUCHSCREEN
88 if (i
==SCREEN_MAIN
&& !data
->touchregions
)
89 touchscreen_set_mode(toggle_state
== FMS_ENTER
?
90 TOUCHSCREEN_BUTTON
: global_settings
.touch_mode
);
96 int fms_do_button_loop(bool update_screen
)
98 int button
= skin_wait_for_action(FM_SCREEN
, CONTEXT_FM
,
99 update_screen
? TIMEOUT_NOBLOCK
: HZ
/5);
100 #ifdef HAVE_TOUCHSCREEN
101 struct touchregion
*region
;
103 if (button
== ACTION_TOUCHSCREEN
)
104 button
= skin_get_touchaction(skin_get_gwps(FM_SCREEN
, SCREEN_MAIN
)->data
,
108 case ACTION_WPS_STOP
:
109 return ACTION_FM_STOP
;
110 case ACTION_STD_CANCEL
:
111 return ACTION_FM_EXIT
;
112 case ACTION_WPS_VOLUP
:
113 return ACTION_SETTINGS_INC
;
114 case ACTION_WPS_VOLDOWN
:
115 return ACTION_SETTINGS_DEC
;
116 case ACTION_WPS_PLAY
:
117 return ACTION_FM_PLAY
;
118 case ACTION_STD_MENU
:
119 return ACTION_FM_MENU
;
120 case ACTION_TOUCH_SCROLLBAR
: