Guest User

Untitled

a guest
Aug 16th, 2010
121
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff --git a/apps/radio/radio.c b/apps/radio/radio.c
  2. index 17f3d89..74bdb4b 100755
  3. --- a/apps/radio/radio.c
  4. +++ b/apps/radio/radio.c
  5. @@ -394,7 +394,7 @@ int radio_screen(void)
  6. int button;
  7. int i;
  8. bool stereo = false, last_stereo = false;
  9. - bool update_screen = true, restore = true;
  10. + int update_type = 0;
  11. bool screen_freeze = false;
  12. bool keep_playing = false;
  13. bool talk = false;
  14. @@ -467,8 +467,11 @@ int radio_screen(void)
  15. if (radio_status == FMRADIO_OFF)
  16. radio_start();
  17. #endif
  18. + fms_fix_displays(FMS_ENTER);
  19. + FOR_NB_SCREENS(i)
  20. + skin_update(fms_get(i), SKIN_REFRESH_ALL);
  21.  
  22. - if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
  23. + if(radio_preset_count() < 1 && yesno_pop(ID2P(LANG_FM_FIRST_AUTOSCAN)))
  24. presets_scan(NULL);
  25.  
  26. preset_set_current(preset_find(curr_freq));
  27. @@ -484,7 +487,7 @@ int radio_screen(void)
  28. if(search_dir != 0)
  29. {
  30. curr_freq = step_freq(curr_freq, search_dir);
  31. - update_screen = true;
  32. + update_type = SKIN_REFRESH_ALL;
  33.  
  34. if(tuner_set(RADIO_SCAN_FREQUENCY, curr_freq))
  35. {
  36. @@ -496,12 +499,12 @@ int radio_screen(void)
  37. trigger_cpu_boost();
  38. }
  39.  
  40. - if (!update_screen)
  41. + if (!update_type)
  42. {
  43. cancel_cpu_boost();
  44. }
  45.  
  46. - button = fms_do_button_loop(update_screen);
  47. + button = fms_do_button_loop(update_type>0);
  48.  
  49. #ifndef HAVE_NOISY_IDLE_MODE
  50. if (button != ACTION_NONE)
  51. @@ -530,7 +533,7 @@ int radio_screen(void)
  52. }
  53. }
  54. }
  55. - update_screen = true;
  56. + update_type = SKIN_REFRESH_NON_STATIC;
  57. break;
  58.  
  59. #ifdef FM_RECORD
  60. @@ -551,13 +554,13 @@ int radio_screen(void)
  61. if(audio_status() == AUDIO_STATUS_RECORD)
  62. {
  63. rec_command(RECORDING_CMD_START_NEWFILE);
  64. - update_screen = true;
  65. + update_type = SKIN_REFRESH_ALL;
  66. }
  67. else
  68. {
  69. have_recorded = true;
  70. rec_command(RECORDING_CMD_START);
  71. - update_screen = true;
  72. + update_type = SKIN_REFRESH_ALL;
  73. }
  74. #endif /* SIMULATOR */
  75. last_seconds = 0;
  76. @@ -586,7 +589,7 @@ int radio_screen(void)
  77. case ACTION_STD_NEXT:
  78. next_station(button == ACTION_STD_PREV ? -1 : 1);
  79. end_search();
  80. - update_screen = true;
  81. + update_type = SKIN_REFRESH_ALL;
  82. talk = true;
  83. break;
  84.  
  85. @@ -599,30 +602,29 @@ int radio_screen(void)
  86. {
  87. preset_next(search_dir);
  88. end_search();
  89. - update_screen = true;
  90. talk = true;
  91. }
  92. else if (dir == 0)
  93. {
  94. /* Starting auto scan */
  95. tuner_set(RADIO_MUTE, 1);
  96. - update_screen = true;
  97. }
  98. + update_type = SKIN_REFRESH_ALL;
  99. break;
  100. - }
  101. + }
  102.  
  103. case ACTION_SETTINGS_INC:
  104. case ACTION_SETTINGS_INCREPEAT:
  105. global_settings.volume++;
  106. setvol();
  107. - update_screen = true;
  108. + update_type = SKIN_REFRESH_NON_STATIC;
  109. break;
  110.  
  111. case ACTION_SETTINGS_DEC:
  112. case ACTION_SETTINGS_DECREPEAT:
  113. global_settings.volume--;
  114. setvol();
  115. - update_screen = true;
  116. + update_type = SKIN_REFRESH_NON_STATIC;
  117. break;
  118.  
  119. case ACTION_FM_PLAY:
  120. @@ -631,7 +633,7 @@ int radio_screen(void)
  121. else
  122. radio_start();
  123.  
  124. - update_screen = true;
  125. + update_type = SKIN_REFRESH_NON_STATIC;
  126. talk = false;
  127. talk_shutup();
  128. break;
  129. @@ -640,8 +642,8 @@ int radio_screen(void)
  130. fms_fix_displays(FMS_EXIT);
  131. radio_menu();
  132. preset_set_current(preset_find(curr_freq));
  133. - update_screen = true;
  134. - restore = true;
  135. + fms_fix_displays(FMS_ENTER);
  136. + update_type = SKIN_REFRESH_ALL;
  137. break;
  138.  
  139. #ifdef FM_PRESET
  140. @@ -649,13 +651,13 @@ int radio_screen(void)
  141. if(radio_preset_count() < 1)
  142. {
  143. splash(HZ, ID2P(LANG_FM_NO_PRESETS));
  144. - update_screen = true;
  145. + update_type = SKIN_REFRESH_ALL;
  146. break;
  147. }
  148. fms_fix_displays(FMS_EXIT);
  149. handle_radio_presets();
  150. - update_screen = true;
  151. - restore = true;
  152. + fms_fix_displays(FMS_ENTER);
  153. + update_type = SKIN_REFRESH_ALL;
  154. break;
  155. #endif /* FM_PRESET */
  156.  
  157. @@ -668,7 +670,7 @@ int radio_screen(void)
  158. }
  159. else
  160. {
  161. - update_screen = true;
  162. + update_type = SKIN_REFRESH_ALL;
  163. screen_freeze = false;
  164. }
  165. break;
  166. @@ -697,7 +699,7 @@ int radio_screen(void)
  167. }
  168. else
  169. radio_mode = RADIO_SCAN_MODE;
  170. - update_screen = true;
  171. + update_type = SKIN_REFRESH_ALL;
  172. cond_talk_ids_fq(radio_mode ?
  173. LANG_PRESET : LANG_RADIO_SCAN_MODE);
  174. talk = true;
  175. @@ -708,7 +710,7 @@ int radio_screen(void)
  176. case ACTION_FM_NEXT_PRESET:
  177. preset_next(1);
  178. end_search();
  179. - update_screen = true;
  180. + update_type = SKIN_REFRESH_ALL;
  181. talk = true;
  182. break;
  183. #endif
  184. @@ -717,19 +719,19 @@ int radio_screen(void)
  185. case ACTION_FM_PREV_PRESET:
  186. preset_next(-1);
  187. end_search();
  188. - update_screen = true;
  189. + update_type = SKIN_REFRESH_ALL;
  190. talk = true;
  191. break;
  192. #endif
  193. case ACTION_NONE:
  194. - update_screen = true; /* so the fms updates */
  195. + update_type = SKIN_REFRESH_NON_STATIC;
  196. break;
  197.  
  198. default:
  199. default_event_handler(button);
  200. #ifdef HAVE_RDS_CAP
  201. if (tuner_get(RADIO_EVENT))
  202. - update_screen = true;
  203. + update_type = SKIN_REFRESH_ALL;
  204. #endif
  205. if (!tuner_get(RADIO_PRESENT))
  206. {
  207. @@ -782,7 +784,7 @@ int radio_screen(void)
  208.  
  209. if(stereo != last_stereo)
  210. {
  211. - update_screen = true;
  212. + update_type = SKIN_REFRESH_ALL;
  213. last_stereo = stereo;
  214. }
  215. }
  216. @@ -790,22 +792,18 @@ int radio_screen(void)
  217.  
  218. #if CONFIG_CODEC != SWCODEC && !defined(SIMULATOR)
  219. seconds = audio_recorded_time() / HZ;
  220. - if (update_screen || seconds > last_seconds || restore)
  221. + if (update_type || seconds > last_seconds)
  222. {
  223. last_seconds = seconds;
  224. #else
  225. - if (update_screen || restore)
  226. + if (update_type)
  227. {
  228. #endif
  229. - if (restore)
  230. - fms_fix_displays(FMS_ENTER);
  231. FOR_NB_SCREENS(i)
  232. - skin_update(fms_get(i), restore ? SKIN_REFRESH_ALL :
  233. - SKIN_REFRESH_NON_STATIC);
  234. - restore = false;
  235. + skin_update(fms_get(i), update_type);
  236. }
  237. }
  238. - update_screen = false;
  239. + update_type = 0;
  240.  
  241. if (global_settings.talk_file && talk
  242. && radio_status == FMRADIO_PAUSED)
RAW Paste Data