forked from len0rd/rockbox
Fix FS#11469 - make the fms update as it should
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27828 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
0be2426528
commit
b5412c9440
2 changed files with 34 additions and 36 deletions
|
@ -394,7 +394,7 @@ int radio_screen(void)
|
||||||
int button;
|
int button;
|
||||||
int i;
|
int i;
|
||||||
bool stereo = false, last_stereo = false;
|
bool stereo = false, last_stereo = false;
|
||||||
bool update_screen = true, restore = true;
|
int update_type = 0;
|
||||||
bool screen_freeze = false;
|
bool screen_freeze = false;
|
||||||
bool keep_playing = false;
|
bool keep_playing = false;
|
||||||
bool talk = false;
|
bool talk = false;
|
||||||
|
@ -467,8 +467,11 @@ int radio_screen(void)
|
||||||
if (radio_status == FMRADIO_OFF)
|
if (radio_status == FMRADIO_OFF)
|
||||||
radio_start();
|
radio_start();
|
||||||
#endif
|
#endif
|
||||||
|
fms_fix_displays(FMS_ENTER);
|
||||||
|
FOR_NB_SCREENS(i)
|
||||||
|
skin_update(fms_get(i), SKIN_REFRESH_ALL);
|
||||||
|
|
||||||
if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
|
if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
|
||||||
presets_scan(NULL);
|
presets_scan(NULL);
|
||||||
|
|
||||||
preset_set_current(preset_find(curr_freq));
|
preset_set_current(preset_find(curr_freq));
|
||||||
|
@ -484,7 +487,7 @@ int radio_screen(void)
|
||||||
if(search_dir != 0)
|
if(search_dir != 0)
|
||||||
{
|
{
|
||||||
curr_freq = step_freq(curr_freq, search_dir);
|
curr_freq = step_freq(curr_freq, search_dir);
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
|
|
||||||
if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq))
|
if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq))
|
||||||
{
|
{
|
||||||
|
@ -496,12 +499,12 @@ int radio_screen(void)
|
||||||
trigger_cpu_boost();
|
trigger_cpu_boost();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!update_screen)
|
if (!update_type)
|
||||||
{
|
{
|
||||||
cancel_cpu_boost();
|
cancel_cpu_boost();
|
||||||
}
|
}
|
||||||
|
|
||||||
button = fms_do_button_loop(update_screen);
|
button = fms_do_button_loop(update_type>0);
|
||||||
|
|
||||||
#ifndef HAVE_NOISY_IDLE_MODE
|
#ifndef HAVE_NOISY_IDLE_MODE
|
||||||
if (button != ACTION_NONE)
|
if (button != ACTION_NONE)
|
||||||
|
@ -530,7 +533,7 @@ int radio_screen(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_NON_STATIC;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef FM_RECORD
|
#ifdef FM_RECORD
|
||||||
|
@ -551,13 +554,13 @@ int radio_screen(void)
|
||||||
if(audio_status() == AUDIO_STATUS_RECORD)
|
if(audio_status() == AUDIO_STATUS_RECORD)
|
||||||
{
|
{
|
||||||
rec_command(RECORDING_CMD_START_NEWFILE);
|
rec_command(RECORDING_CMD_START_NEWFILE);
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
have_recorded = true;
|
have_recorded = true;
|
||||||
rec_command(RECORDING_CMD_START);
|
rec_command(RECORDING_CMD_START);
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
}
|
}
|
||||||
#endif /* SIMULATOR */
|
#endif /* SIMULATOR */
|
||||||
last_seconds = 0;
|
last_seconds = 0;
|
||||||
|
@ -586,7 +589,7 @@ int radio_screen(void)
|
||||||
case ACTION_STD_NEXT:
|
case ACTION_STD_NEXT:
|
||||||
next_station(button == ACTION_STD_PREV ? -1 : 1);
|
next_station(button == ACTION_STD_PREV ? -1 : 1);
|
||||||
end_search();
|
end_search();
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
talk = true;
|
talk = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -599,30 +602,29 @@ int radio_screen(void)
|
||||||
{
|
{
|
||||||
preset_next(search_dir);
|
preset_next(search_dir);
|
||||||
end_search();
|
end_search();
|
||||||
update_screen = true;
|
|
||||||
talk = true;
|
talk = true;
|
||||||
}
|
}
|
||||||
else if (dir == 0)
|
else if (dir == 0)
|
||||||
{
|
{
|
||||||
/* Starting auto scan */
|
/* Starting auto scan */
|
||||||
tuner_set(RADIO_MUTE, 1);
|
tuner_set(RADIO_MUTE, 1);
|
||||||
update_screen = true;
|
|
||||||
}
|
}
|
||||||
|
update_type = SKIN_REFRESH_ALL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ACTION_SETTINGS_INC:
|
case ACTION_SETTINGS_INC:
|
||||||
case ACTION_SETTINGS_INCREPEAT:
|
case ACTION_SETTINGS_INCREPEAT:
|
||||||
global_settings.volume++;
|
global_settings.volume++;
|
||||||
setvol();
|
setvol();
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_NON_STATIC;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTION_SETTINGS_DEC:
|
case ACTION_SETTINGS_DEC:
|
||||||
case ACTION_SETTINGS_DECREPEAT:
|
case ACTION_SETTINGS_DECREPEAT:
|
||||||
global_settings.volume--;
|
global_settings.volume--;
|
||||||
setvol();
|
setvol();
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_NON_STATIC;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTION_FM_PLAY:
|
case ACTION_FM_PLAY:
|
||||||
|
@ -631,7 +633,7 @@ int radio_screen(void)
|
||||||
else
|
else
|
||||||
radio_start();
|
radio_start();
|
||||||
|
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_NON_STATIC;
|
||||||
talk = false;
|
talk = false;
|
||||||
talk_shutup();
|
talk_shutup();
|
||||||
break;
|
break;
|
||||||
|
@ -640,8 +642,8 @@ int radio_screen(void)
|
||||||
fms_fix_displays(FMS_EXIT);
|
fms_fix_displays(FMS_EXIT);
|
||||||
radio_menu();
|
radio_menu();
|
||||||
preset_set_current(preset_find(curr_freq));
|
preset_set_current(preset_find(curr_freq));
|
||||||
update_screen = true;
|
fms_fix_displays(FMS_ENTER);
|
||||||
restore = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#ifdef FM_PRESET
|
#ifdef FM_PRESET
|
||||||
|
@ -649,13 +651,13 @@ int radio_screen(void)
|
||||||
if(radio_preset_count() < 1)
|
if(radio_preset_count() < 1)
|
||||||
{
|
{
|
||||||
splash(HZ, ID2P(LANG_FM_NO_PRESETS));
|
splash(HZ, ID2P(LANG_FM_NO_PRESETS));
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
fms_fix_displays(FMS_EXIT);
|
fms_fix_displays(FMS_EXIT);
|
||||||
handle_radio_presets();
|
handle_radio_presets();
|
||||||
update_screen = true;
|
fms_fix_displays(FMS_ENTER);
|
||||||
restore = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
break;
|
break;
|
||||||
#endif /* FM_PRESET */
|
#endif /* FM_PRESET */
|
||||||
|
|
||||||
|
@ -668,7 +670,7 @@ int radio_screen(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
screen_freeze = false;
|
screen_freeze = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -697,7 +699,7 @@ int radio_screen(void)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
radio_mode = RADIO_SCAN_MODE;
|
radio_mode = RADIO_SCAN_MODE;
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
cond_talk_ids_fq(radio_mode ?
|
cond_talk_ids_fq(radio_mode ?
|
||||||
LANG_PRESET : LANG_RADIO_SCAN_MODE);
|
LANG_PRESET : LANG_RADIO_SCAN_MODE);
|
||||||
talk = true;
|
talk = true;
|
||||||
|
@ -708,7 +710,7 @@ int radio_screen(void)
|
||||||
case ACTION_FM_NEXT_PRESET:
|
case ACTION_FM_NEXT_PRESET:
|
||||||
preset_next(1);
|
preset_next(1);
|
||||||
end_search();
|
end_search();
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
talk = true;
|
talk = true;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
@ -717,19 +719,19 @@ int radio_screen(void)
|
||||||
case ACTION_FM_PREV_PRESET:
|
case ACTION_FM_PREV_PRESET:
|
||||||
preset_next(-1);
|
preset_next(-1);
|
||||||
end_search();
|
end_search();
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
talk = true;
|
talk = true;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case ACTION_NONE:
|
case ACTION_NONE:
|
||||||
update_screen = true; /* so the fms updates */
|
update_type = SKIN_REFRESH_NON_STATIC;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
default_event_handler(button);
|
default_event_handler(button);
|
||||||
#ifdef HAVE_RDS_CAP
|
#ifdef HAVE_RDS_CAP
|
||||||
if (tuner_get(RADIO_EVENT))
|
if (tuner_get(RADIO_EVENT))
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
#endif
|
#endif
|
||||||
if (!tuner_get(RADIO_PRESENT))
|
if (!tuner_get(RADIO_PRESENT))
|
||||||
{
|
{
|
||||||
|
@ -782,7 +784,7 @@ int radio_screen(void)
|
||||||
|
|
||||||
if(stereo != last_stereo)
|
if(stereo != last_stereo)
|
||||||
{
|
{
|
||||||
update_screen = true;
|
update_type = SKIN_REFRESH_ALL;
|
||||||
last_stereo = stereo;
|
last_stereo = stereo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -790,22 +792,18 @@ int radio_screen(void)
|
||||||
|
|
||||||
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
#if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
|
||||||
seconds = audio_recorded_time() / HZ;
|
seconds = audio_recorded_time() / HZ;
|
||||||
if (update_screen || seconds > last_seconds || restore)
|
if (update_type || seconds > last_seconds)
|
||||||
{
|
{
|
||||||
last_seconds = seconds;
|
last_seconds = seconds;
|
||||||
#else
|
#else
|
||||||
if (update_screen || restore)
|
if (update_type)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
if (restore)
|
|
||||||
fms_fix_displays(FMS_ENTER);
|
|
||||||
FOR_NB_SCREENS(i)
|
FOR_NB_SCREENS(i)
|
||||||
skin_update(fms_get(i), restore ? SKIN_REFRESH_ALL :
|
skin_update(fms_get(i), update_type);
|
||||||
SKIN_REFRESH_NON_STATIC);
|
|
||||||
restore = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update_screen = false;
|
update_type = 0;
|
||||||
|
|
||||||
if (global_settings.talk_file && talk
|
if (global_settings.talk_file && talk
|
||||||
&& radio_status == FMRADIO_PAUSED)
|
&& radio_status == FMRADIO_PAUSED)
|
||||||
|
|
|
@ -114,7 +114,7 @@ void fms_skin_init(void)
|
||||||
int fms_do_button_loop(bool update_screen)
|
int fms_do_button_loop(bool update_screen)
|
||||||
{
|
{
|
||||||
int button = skin_wait_for_action(fms_skin, CONTEXT_FM,
|
int button = skin_wait_for_action(fms_skin, CONTEXT_FM,
|
||||||
update_screen ? TIMEOUT_NOBLOCK : HZ);
|
update_screen ? TIMEOUT_NOBLOCK : HZ/5);
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
int offset;
|
int offset;
|
||||||
if (button == ACTION_TOUCHSCREEN)
|
if (button == ACTION_TOUCHSCREEN)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue