Guest User

Untitled

a guest
Jun 22nd, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.02 KB | None | 0 0
  1. Index: apps/plugins/random_folder_advance_config.c
  2. ===================================================================
  3. --- apps/plugins/random_folder_advance_config.c (Revision 21603)
  4. +++ apps/plugins/random_folder_advance_config.c (Arbeitskopie)
  5. @@ -20,6 +20,7 @@
  6. ****************************************************************************/
  7. #include "plugin.h"
  8. #include "file.h"
  9. +#include "lib/pluginlib_exit.h"
  10.  
  11. PLUGIN_HEADER
  12.  
  13. @@ -287,7 +288,7 @@
  14. int edit_list(void)
  15. {
  16. struct gui_synclist lists;
  17. - bool exit = false;
  18. + bool quit = false;
  19. int button,i;
  20. int selection, ret = 0;
  21.  
  22. @@ -306,7 +307,7 @@
  23. rb->gui_synclist_limit_scroll(&lists,true);
  24. rb->gui_synclist_select_item(&lists, 0);
  25.  
  26. - while (!exit)
  27. + while (!quit)
  28. {
  29. rb->gui_synclist_draw(&lists);
  30. button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
  31. @@ -359,7 +360,7 @@
  32. case 0:
  33. save_list();
  34. case 1:
  35. - exit = true;
  36. + quit = true;
  37. ret = -2;
  38. }
  39. }
  40. @@ -537,7 +538,7 @@
  41.  
  42. int main_menu(void)
  43. {
  44. - bool exit = false;
  45. + bool quit = false;
  46.  
  47. MENUITEM_STRINGLIST(menu, "Main Menu", NULL,
  48. "Generate Folder List",
  49. @@ -567,7 +568,7 @@
  50. rb->cpu_boost(true);
  51. #endif
  52. if (edit_list() < 0)
  53. - exit = true;
  54. + quit = true;
  55. #ifdef HAVE_ADJUSTABLE_CPU_FREQ
  56. rb->cpu_boost(false);
  57. #endif
  58. @@ -603,21 +604,26 @@
  59. rb->backlight_on();
  60. break;
  61. case 4:
  62. - start_shuffled_play();
  63. - exit=true;
  64. + {
  65. + int ret = start_shuffled_play();
  66. + if (!ret)
  67. + exit(PLUGIN_ERROR);
  68. + else
  69. + exit(PLUGIN_GOTO_WPS);
  70. break;
  71. + }
  72. case 5:
  73. return 1;
  74. }
  75. - return exit?1:0;
  76. + return quit?1:0;
  77. }
  78.  
  79. enum plugin_status plugin_start(const void* parameter)
  80. {
  81. + PLUGINLIB_EXIT_INIT;
  82. (void)parameter;
  83.  
  84. abort = false;
  85. -
  86. while (!main_menu())
  87. ;
  88. return PLUGIN_OK;
  89. Index: apps/plugins/lib/pluginlib_exit.h
  90. ===================================================================
  91. --- apps/plugins/lib/pluginlib_exit.h (Revision 21603)
  92. +++ apps/plugins/lib/pluginlib_exit.h (Arbeitskopie)
  93. @@ -30,18 +30,21 @@
  94. #endif
  95.  
  96. /* PLUGINLIB_EXIT_INIT needs to be placed as the first line in plugin_start */
  97. -#define PLUGINLIB_EXIT_INIT switch(setjmp(__exit_env)) \
  98. - { \
  99. - case 1: \
  100. - return PLUGIN_OK; \
  101. - case 2: \
  102. - return PLUGIN_ERROR; \
  103. - case 0: \
  104. - default: \
  105. - break; \
  106. +#define PLUGINLIB_EXIT_INIT switch(setjmp(__exit_env)) \
  107. + { \
  108. + case -1: \
  109. + return PLUGIN_ERROR; \
  110. + case PLUGIN_OK+1: \
  111. + return PLUGIN_OK; \
  112. + case PLUGIN_GOTO_WPS+1: \
  113. + return PLUGIN_GOTO_WPS; \
  114. + case PLUGIN_USB_CONNECTED+1: \
  115. + return PLUGIN_USB_CONNECTED;\
  116. + default: \
  117. + break; \
  118. }
  119.  
  120. extern jmp_buf __exit_env;
  121. -#define exit(status) longjmp(__exit_env, status != 0 ? 2 : 1)
  122. +#define exit(status) longjmp(__exit_env, (status < 0 || status >= PLUGIN_MAX_RETURNS) ? -1:status+1)
  123.  
  124. #endif /* __PLUGINLIB_EXIT_H__ */
  125. Index: apps/plugins/properties.c
  126. ===================================================================
  127. --- apps/plugins/properties.c (Revision 21603)
  128. +++ apps/plugins/properties.c (Arbeitskopie)
  129. @@ -276,6 +276,7 @@
  130. int button;
  131. bool quit = false;
  132. char file[MAX_PATH];
  133. + int ret = PLUGIN_OK;
  134. rb->strcpy(file, (const char *) parameter);
  135.  
  136. /* determine if it's a file or a directory */
  137. @@ -332,11 +333,13 @@
  138.  
  139. while(!quit)
  140. {
  141. - button = rb->get_action(CONTEXT_LIST,TIMEOUT_BLOCK);
  142. + button = rb->get_action(CONTEXT_TREE,TIMEOUT_BLOCK);
  143. if (rb->gui_synclist_do_button(&properties_lists,&button,LIST_WRAP_ON))
  144. continue;
  145. switch(button)
  146. {
  147. + case ACTION_TREE_WPS:
  148. + return PLUGIN_GOTO_WPS;
  149. case ACTION_STD_CANCEL:
  150. quit = true;
  151. break;
  152. @@ -346,5 +349,5 @@
  153. }
  154. }
  155.  
  156. - return PLUGIN_OK;
  157. + return ret;
  158. }
  159. Index: apps/plugins/pictureflow/pictureflow.c
  160. ===================================================================
  161. --- apps/plugins/pictureflow/pictureflow.c (Revision 21603)
  162. +++ apps/plugins/pictureflow/pictureflow.c (Arbeitskopie)
  163. @@ -54,6 +54,12 @@
  164. #define PF_CONTEXT ACTION_STD_CONTEXT
  165. #define PF_BACK ACTION_STD_CANCEL
  166. #define PF_MENU ACTION_STD_MENU
  167. +#define PF_WPS ACTION_TREE_WPS
  168. +
  169. +#if PF_PLAYBACK_CAPABLE
  170. +#define PF_STOP ACTION_TREE_STOP
  171. +#endif
  172. +
  173. #define PF_QUIT (LAST_ACTION_PLACEHOLDER + 1)
  174.  
  175. #if !defined(HAVE_SCROLLWHEEL)
  176. @@ -122,8 +128,6 @@
  177. {PF_BACK, BUTTON_POWER|BUTTON_REL, BUTTON_POWER},
  178. {ACTION_NONE, BUTTON_POWER, BUTTON_NONE},
  179. #endif
  180. -#elif CONFIG_KEYPAD == SANSA_E200_PAD
  181. - {PF_QUIT, BUTTON_POWER, BUTTON_NONE},
  182. #elif CONFIG_KEYPAD == IRIVER_IFP7XX_PAD
  183. {PF_QUIT, BUTTON_EQ, BUTTON_NONE},
  184. #elif (CONFIG_KEYPAD == IPOD_1G2G_PAD) \
  185. @@ -2008,6 +2012,10 @@
  186. void cleanup(void *parameter)
  187. {
  188. (void) parameter;
  189. +#ifdef HAVE_ADJUSTABLE_CPU_FREQ
  190. + rb->cpu_boost(false);
  191. +#endif
  192. + end_pf_thread();
  193. /* Turn on backlight timeout (revert to settings) */
  194. backlight_use_settings(); /* backlight control in lib/helper.c */
  195.  
  196. @@ -2136,6 +2144,7 @@
  197. Show the main menu
  198. */
  199. enum {
  200. + PF_GOTO_WPS,
  201. #if PF_PLAYBACK_CAPABLE
  202. PF_MENU_PLAYBACK_CONTROL,
  203. #endif
  204. @@ -2154,12 +2163,15 @@
  205. #endif
  206.  
  207. MENUITEM_STRINGLIST(main_menu,"PictureFlow Main Menu",NULL,
  208. + "Go to WPS",
  209. #if PF_PLAYBACK_CAPABLE
  210. "Playback Control",
  211. #endif
  212. "Settings", "Return", "Quit");
  213. while (1) {
  214. switch (rb->do_menu(&main_menu,&selection, NULL, false)) {
  215. + case PF_GOTO_WPS: /* WPS */
  216. + return -2;
  217. #if PF_PLAYBACK_CAPABLE
  218. case PF_MENU_PLAYBACK_CONTROL: /* Playback Control */
  219. playback_control(NULL);
  220. @@ -2169,10 +2181,8 @@
  221. result = settings_menu();
  222. if ( result != 0 ) return result;
  223. break;
  224. -
  225. case PF_MENU_RETURN:
  226. return 0;
  227. -
  228. case PF_MENU_QUIT:
  229. return -1;
  230.  
  231. @@ -2400,6 +2410,16 @@
  232. old_shuffle = shuffle;
  233. }
  234. #endif
  235. +/*
  236. +int tracklist_context(void)
  237. +{
  238. + char* filename = get_track_filename(selected_track);
  239. + int attr = 0x300;
  240. + int context = CONTEXT_ID3DB;
  241. + return rb->onplay(filename, attr, context);
  242. +}
  243. +*/
  244. +
  245. /**
  246. Draw the current album name
  247. */
  248. @@ -2656,7 +2676,13 @@
  249. switch (button) {
  250. case PF_QUIT:
  251. return PLUGIN_OK;
  252. -
  253. + case PF_WPS:
  254. + return PLUGIN_GOTO_WPS;
  255. +#if PF_PLAYBACK_CAPABLE
  256. + case PF_STOP:
  257. + rb->audio_stop();
  258. + break;
  259. +#endif
  260. case PF_BACK:
  261. if ( pf_state == pf_show_tracks )
  262. {
  263. @@ -2668,12 +2694,12 @@
  264. if (pf_state == pf_idle || pf_state == pf_scrolling)
  265. return PLUGIN_OK;
  266. break;
  267. -
  268. case PF_MENU:
  269. #ifdef USEGSLIB
  270. grey_show(false);
  271. #endif
  272. ret = main_menu();
  273. + if ( ret == -2 ) return PLUGIN_GOTO_WPS;
  274. if ( ret == -1 ) return PLUGIN_OK;
  275. if ( ret != 0 ) return ret;
  276. #ifdef USEGSLIB
  277. @@ -2708,7 +2734,12 @@
  278. #endif
  279. }
  280. break;
  281. -
  282. + case PF_CONTEXT:
  283. +/*
  284. + if ( pf_state == pf_show_tracks)
  285. + tracklist_context();
  286. +*/
  287. + break;
  288. default:
  289. if (rb->default_event_handler_ex(button, cleanup, NULL)
  290. == SYS_USB_CONNECTED)
  291. @@ -2747,9 +2778,6 @@
  292. #endif
  293. #endif
  294. ret = main();
  295. -#ifdef HAVE_ADJUSTABLE_CPU_FREQ
  296. - rb->cpu_boost(false);
  297. -#endif
  298. if ( ret == PLUGIN_OK ) {
  299. if (configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
  300. CONFIG_VERSION))
  301. @@ -2759,7 +2787,6 @@
  302. }
  303. }
  304.  
  305. - end_pf_thread();
  306. cleanup(NULL);
  307. return ret;
  308. }
  309. Index: apps/onplay.c
  310. ===================================================================
  311. --- apps/onplay.c (Revision 21603)
  312. +++ apps/onplay.c (Arbeitskopie)
  313. @@ -79,6 +79,7 @@
  314. static const struct menu_callback_with_desc name##__ = {callback,str,icon};\
  315. static const struct menu_item_ex name = \
  316. {MT_MENU|MENU_HAS_DESC|MENU_EXITAFTERTHISMENU| \
  317. + MENU_ALLOW_AUDIO_ACTIONS| \
  318. MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \
  319. { (void*)name##_},{.callback_and_desc = & name##__}};
  320.  
  321. @@ -135,12 +136,18 @@
  322. return action;
  323. }
  324.  
  325. -static bool list_viewers(void)
  326. +static int list_viewers(void)
  327. {
  328. int ret = filetype_list_viewers(selected_file);
  329. - if (ret == PLUGIN_USB_CONNECTED)
  330. + if (ret == PLUGIN_USB_CONNECTED
  331. + ||ret == SYS_USB_CONNECTED)
  332. onplay_result = ONPLAY_RELOAD_DIR;
  333. - return false;
  334. + else if (ret == ACTION_TREE_WPS)
  335. + {
  336. + onplay_result = ONPLAY_START_PLAY;
  337. + return GO_TO_WPS;
  338. + }
  339. + return 0;
  340. }
  341.  
  342. static bool shuffle_playlist(void)
  343. @@ -1017,7 +1024,7 @@
  344. properties, NULL, clipboard_callback, Icon_NOICON);
  345. MENUITEM_FUNCTION(create_dir_item, 0, ID2P(LANG_CREATE_DIR),
  346. create_dir, NULL, clipboard_callback, Icon_NOICON);
  347. -MENUITEM_FUNCTION(list_viewers_item, 0, ID2P(LANG_ONPLAY_OPEN_WITH),
  348. +MENUITEM_FUNCTION(list_viewers_item, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_ONPLAY_OPEN_WITH),
  349. list_viewers, NULL, clipboard_callback, Icon_NOICON);
  350. #if LCD_DEPTH > 1
  351. MENUITEM_FUNCTION(set_backdrop_item, 0, ID2P(LANG_SET_AS_BACKDROP),
  352. @@ -1155,18 +1162,16 @@
  353. #endif
  354. &add_to_faves_item,
  355. );
  356. +
  357. static int onplaymenu_callback(int action,const struct menu_item_ex *this_item)
  358. {
  359. (void)this_item;
  360. switch (action)
  361. {
  362. case ACTION_TREE_STOP:
  363. + list_stop_handler();
  364. if (this_item == &wps_onplay_menu)
  365. - {
  366. - list_stop_handler();
  367. return ACTION_STD_CANCEL;
  368. - }
  369. - break;
  370. case ACTION_EXIT_MENUITEM:
  371. return ACTION_EXIT_AFTER_THIS_MENUITEM;
  372. break;
  373. @@ -1187,6 +1192,7 @@
  374. switch (do_menu(menu, NULL, NULL, false))
  375. {
  376. case GO_TO_WPS:
  377. + case GO_TO_PREVIOUS_MUSIC:
  378. return ONPLAY_START_PLAY;
  379. case GO_TO_ROOT:
  380. case GO_TO_MAINMENU:
  381. Index: apps/gui/list.c
  382. ===================================================================
  383. --- apps/gui/list.c (Revision 21603)
  384. +++ apps/gui/list.c (Arbeitskopie)
  385. @@ -838,8 +838,9 @@
  386. return simplelist_text[item];
  387. }
  388.  
  389. -bool simplelist_show_list(struct simplelist_info *info)
  390. +int simplelist_show_list(struct simplelist_info *info)
  391. {
  392. + int retval = 0;
  393. struct gui_synclist lists;
  394. int action, old_line_count = simplelist_line_count;
  395. int oldbars = viewportmanager_set_statusbar(VP_SB_ALLSCREENS);
  396. @@ -880,7 +881,7 @@
  397.  
  398. while(1)
  399. {
  400. - list_do_action(CONTEXT_STD, info->timeout,
  401. + list_do_action(CONTEXT_TREE, info->timeout,
  402. &lists, &action, wrap);
  403.  
  404. /* We must yield in this case or no other thread can run */
  405. @@ -897,7 +898,6 @@
  406. info->selection = gui_synclist_get_sel_pos(&lists);
  407. break;
  408. }
  409. -
  410. if (info->get_name == NULL)
  411. gui_synclist_set_nb_items(&lists,
  412. simplelist_line_count*info->selection_size);
  413. @@ -919,11 +919,14 @@
  414. old_line_count = simplelist_line_count;
  415. }
  416. else if(default_event_handler(action) == SYS_USB_CONNECTED)
  417. - return true;
  418. + return SYS_USB_CONNECTED;
  419. + else if(action == ACTION_TREE_WPS ||
  420. + action == ACTION_TREE_STOP)
  421. + return action;
  422. }
  423. talk_shutup();
  424. viewportmanager_set_statusbar(oldbars);
  425. - return false;
  426. + return retval;
  427. }
  428.  
  429. void simplelist_info_init(struct simplelist_info *info, char* title,
  430. Index: apps/gui/list.h
  431. ===================================================================
  432. --- apps/gui/list.h (Revision 21603)
  433. +++ apps/gui/list.h (Arbeitskopie)
  434. @@ -255,6 +255,6 @@
  435. /* show a list.
  436. if list->action_callback != NULL it is called with the action ACTION_REDRAW
  437. before the list is dislplayed for the first time */
  438. -bool simplelist_show_list(struct simplelist_info *info);
  439. +int simplelist_show_list(struct simplelist_info *info);
  440.  
  441. #endif /* _GUI_LIST_H_ */
  442. Index: apps/menu.c
  443. ===================================================================
  444. --- apps/menu.c (Revision 21603)
  445. +++ apps/menu.c (Arbeitskopie)
  446. @@ -428,12 +428,14 @@
  447. done = true;
  448. }
  449. #endif
  450. - else if (action == ACTION_TREE_WPS)
  451. + else if (menu->flags & MENU_ALLOW_AUDIO_ACTIONS
  452. + && action == ACTION_TREE_WPS)
  453. {
  454. ret = GO_TO_PREVIOUS_MUSIC;
  455. done = true;
  456. }
  457. - else if (action == ACTION_TREE_STOP)
  458. + else if (menu->flags & MENU_ALLOW_AUDIO_ACTIONS
  459. + && action == ACTION_TREE_STOP)
  460. {
  461. redraw_lists = list_stop_handler();
  462. }
  463. Index: apps/menus/main_menu.c
  464. ===================================================================
  465. --- apps/menus/main_menu.c (Revision 21603)
  466. +++ apps/menus/main_menu.c (Arbeitskopie)
  467. @@ -394,10 +394,12 @@
  468. }
  469. return action;
  470. }
  471. -static bool show_info(void)
  472. +
  473. +static int show_info(void* ignored)
  474. {
  475. struct info_data data = {.new_data = true };
  476. struct simplelist_info info;
  477. + (void)ignored;
  478. simplelist_info_init(&info, str(LANG_ROCKBOX_INFO), INFO_COUNT, (void*)&data);
  479. info.hide_selection = !global_settings.talk_menu;
  480. if (info.hide_selection)
  481. @@ -409,7 +411,7 @@
  482. return simplelist_show_list(&info);
  483. }
  484. MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_ROCKBOX_INFO),
  485. - (menu_function)show_info, NULL, NULL, Icon_NOICON);
  486. + show_info, NULL, NULL, Icon_NOICON);
  487.  
  488.  
  489. /* sleep Menu */
  490. @@ -441,6 +443,18 @@
  491. &sleep_timer_set, -5, 300, 0, sleep_timer_formatter);
  492. }
  493.  
  494. +static int debug_callback(int action, const struct menu_item_ex *this_item)
  495. +{
  496. + switch(action)
  497. + {
  498. + case ACTION_TREE_WPS:
  499. + panicf("LOL");
  500. + return GO_TO_WPS;
  501. + default:
  502. + break;
  503. + }
  504. + return action;
  505. +}
  506.  
  507. #if CONFIG_RTC
  508. int time_screen(void* ignored);
  509. @@ -456,10 +470,10 @@
  510. (menu_function)show_credits, NULL, NULL, Icon_NOICON);
  511. MENUITEM_FUNCTION(show_runtime_item, 0, ID2P(LANG_RUNNING_TIME),
  512. (menu_function)view_runtime, NULL, NULL, Icon_NOICON);
  513. -MENUITEM_FUNCTION(debug_menu_item, 0, ID2P(LANG_DEBUG),
  514. - (menu_function)debug_menu, NULL, NULL, Icon_NOICON);
  515. +MENUITEM_FUNCTION(debug_menu_item, MENU_FUNC_CHECK_RETVAL, ID2P(LANG_DEBUG),
  516. + debug_menu, NULL, NULL, Icon_NOICON);
  517.  
  518. -MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), 0, Icon_Questionmark,
  519. +MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), debug_callback, Icon_Questionmark,
  520. #if CONFIG_RTC
  521. &timedate_item,
  522. #endif
  523. Index: apps/menu.h
  524. ===================================================================
  525. --- apps/menu.h (Revision 21603)
  526. +++ apps/menu.h (Arbeitskopie)
  527. @@ -61,6 +61,7 @@
  528. /* Flags for MT_FUNCTION_CALL */
  529. #define MENU_FUNC_USEPARAM 0x80
  530. #define MENU_FUNC_CHECK_RETVAL 0x100
  531. +#define MENU_ALLOW_AUDIO_ACTIONS 0x200
  532.  
  533. #define MENU_COUNT_MASK 0xFFF
  534. #define MENU_COUNT_SHIFT 12
  535. Index: apps/filetree.c
  536. ===================================================================
  537. --- apps/filetree.c (Revision 21603)
  538. +++ apps/filetree.c (Arbeitskopie)
  539. @@ -552,22 +552,31 @@
  540.  
  541. /* plugin file */
  542. case FILE_ATTR_ROCK:
  543. + {
  544. + int ret;
  545. if (global_settings.party_mode && audio_status()) {
  546. splash(HZ, ID2P(LANG_PARTY_MODE));
  547. break;
  548. }
  549. -
  550. - if (plugin_load(buf,NULL) == PLUGIN_USB_CONNECTED)
  551. + ret = plugin_load(buf,NULL);
  552. + switch (ret)
  553. {
  554. - if(*c->dirfilter > NUM_FILTER_MODES)
  555. - /* leave sub-browsers after usb, doing
  556. - otherwise might be confusing to the user */
  557. - exit_func = true;
  558. - else
  559. - reload_dir = true;
  560. + case PLUGIN_USB_CONNECTED:
  561. + break;
  562. + case PLUGIN_GOTO_WPS:
  563. + play = true;
  564. + break;
  565. + default:
  566. + if(*c->dirfilter > NUM_FILTER_MODES)
  567. + /* leave sub-browsers after usb, doing
  568. + otherwise might be confusing to the user */
  569. + exit_func = true;
  570. + else
  571. + reload_dir = true;
  572. + break;
  573. }
  574. break;
  575. -
  576. + }
  577. case FILE_ATTR_CUE:
  578. display_cuesheet_content(buf);
  579. break;
  580. @@ -584,8 +593,11 @@
  581. plugin = filetype_get_plugin(file);
  582. if (plugin)
  583. {
  584. - if (plugin_load(plugin,buf) == PLUGIN_USB_CONNECTED)
  585. + int ret = plugin_load(plugin,buf);
  586. + if (ret == PLUGIN_USB_CONNECTED)
  587. reload_dir = true;
  588. + else if (ret == PLUGIN_GOTO_WPS)
  589. + play = true;
  590. }
  591. break;
  592. }
  593. Index: apps/plugin.c
  594. ===================================================================
  595. --- apps/plugin.c (Revision 21603)
  596. +++ apps/plugin.c (Arbeitskopie)
  597. @@ -658,6 +658,7 @@
  598. appsversion,
  599. /* new stuff at the end, sort into place next time
  600. the API gets incompatible */
  601. + onplay,
  602. playlist_insert_directory,
  603. };
  604.  
  605. @@ -804,8 +805,6 @@
  606. #endif /* LCD_DEPTH */
  607. #endif /* HAVE_LCD_BITMAP */
  608.  
  609. - lcd_clear_display();
  610. - lcd_update();
  611.  
  612. #ifdef HAVE_REMOTE_LCD
  613. #if LCD_REMOTE_DEPTH > 1
  614. @@ -814,12 +813,16 @@
  615. #else
  616. lcd_remote_set_drawmode(DRMODE_SOLID);
  617. #endif
  618. - lcd_remote_clear_display();
  619.  
  620. + if (rc != PLUGIN_GOTO_WPS)
  621. + {
  622. + lcd_clear_display();
  623. + lcd_update();
  624. + lcd_remote_clear_display();
  625. + lcd_remote_update();
  626. + }
  627.  
  628. - lcd_remote_update();
  629.  
  630. -
  631. #endif
  632. viewportmanager_set_statusbar(oldbars);
  633. if (pfn_tsr_exit == NULL)
  634. @@ -827,19 +830,10 @@
  635.  
  636. sim_plugin_close(pd);
  637.  
  638. - switch (rc) {
  639. - case PLUGIN_OK:
  640. - break;
  641. + if (rc == PLUGIN_ERROR)
  642. + splash(HZ*2, str(LANG_PLUGIN_ERROR));
  643.  
  644. - case PLUGIN_USB_CONNECTED:
  645. - return PLUGIN_USB_CONNECTED;
  646. -
  647. - default:
  648. - splash(HZ*2, str(LANG_PLUGIN_ERROR));
  649. - break;
  650. - }
  651. -
  652. - return PLUGIN_OK;
  653. + return rc;
  654. }
  655.  
  656. /* Returns a pointer to the portion of the plugin buffer that is not already
  657. Index: apps/plugin.h
  658. ===================================================================
  659. --- apps/plugin.h (Revision 21603)
  660. +++ apps/plugin.h (Arbeitskopie)
  661. @@ -93,6 +93,7 @@
  662. #include "ata_idle_notify.h"
  663. #include "settings_list.h"
  664. #include "timefuncs.h"
  665. +#include "onplay.h"
  666.  
  667. #ifdef HAVE_ALBUMART
  668. #include "albumart.h"
  669. @@ -139,6 +140,8 @@
  670. enum plugin_status {
  671. PLUGIN_OK = 0,
  672. PLUGIN_USB_CONNECTED,
  673. + PLUGIN_GOTO_WPS,
  674. + PLUGIN_MAX_RETURNS,
  675. PLUGIN_ERROR = -1,
  676. };
  677.  
  678. @@ -351,7 +354,7 @@
  679. const struct text_message * no_message);
  680. void (*simplelist_info_init)(struct simplelist_info *info, char* title,
  681. int count, void* data);
  682. - bool (*simplelist_show_list)(struct simplelist_info *info);
  683. + int (*simplelist_show_list)(struct simplelist_info *info);
  684.  
  685. /* button */
  686. long (*button_get)(bool block);
  687. @@ -821,6 +824,7 @@
  688. const char *appsversion;
  689. /* new stuff at the end, sort into place next time
  690. the API gets incompatible */
  691. + int (*onplay)(char* file, int attr, int from);
  692. int (*playlist_insert_directory)(struct playlist_info* playlist,
  693. const char *dirname, int position, bool queue,
  694. bool recurse);
  695. Index: apps/root_menu.c
  696. ===================================================================
  697. --- apps/root_menu.c (Revision 21603)
  698. +++ apps/root_menu.c (Arbeitskopie)
  699. @@ -414,6 +414,8 @@
  700. {
  701. switch (action)
  702. {
  703. + case ACTION_TREE_WPS:
  704. + return GO_TO_WPS;
  705. case ACTION_TREE_STOP:
  706. return ACTION_REDRAW;
  707. case ACTION_REQUEST_MENUITEM:
  708. @@ -434,6 +436,7 @@
  709. }
  710. return action;
  711. }
  712. +
  713. static int get_selection(int last_screen)
  714. {
  715. unsigned int i;
  716. Index: apps/debug_menu.c
  717. ===================================================================
  718. --- apps/debug_menu.c (Revision 21603)
  719. +++ apps/debug_menu.c (Arbeitskopie)
  720. @@ -2853,8 +2853,9 @@
  721. (void)data; (void)buffer; (void)buffer_len;
  722. return menuitems[item].desc;
  723. }
  724. -bool debug_menu(void)
  725. +int debug_menu(void* ignored)
  726. {
  727. + (void)ignored;
  728. struct simplelist_info info;
  729.  
  730. simplelist_info_init(&info, "Debug Menu", ARRAYLEN(menuitems), NULL);
  731. Index: apps/debug_menu.h
  732. ===================================================================
  733. --- apps/debug_menu.h (Revision 21603)
  734. +++ apps/debug_menu.h (Arbeitskopie)
  735. @@ -21,7 +21,7 @@
  736. #ifndef _DEBUG_MENU_H
  737. #define _DEBUG_MENU_H
  738.  
  739. -bool debug_menu(void);
  740. +int debug_menu(void* ignored);
  741.  
  742. #ifndef SIMULATOR
  743. extern bool dbg_ports(void);
  744. Index: apps/tagtree.c
  745. ===================================================================
  746. --- apps/tagtree.c (Revision 21603)
  747. +++ apps/tagtree.c (Arbeitskopie)
  748. @@ -54,6 +54,11 @@
  749. #include "storage.h"
  750. #include "dir_uncached.h"
  751.  
  752. +#ifdef HAVE_LCD_BITMAP
  753. +#include "plugin.h" /* to plugin_load() pictureflow */
  754. +#endif
  755. +
  756. +
  757. #define FILE_SEARCH_INSTRUCTIONS ROCKBOX_DIR "/tagnavi.config"
  758.  
  759. static int tagtree_play_folder(struct tree_context* c);
  760. @@ -65,6 +70,9 @@
  761. NAVIBROWSE,
  762. ALLSUBENTRIES,
  763. PLAYTRACK,
  764. +#ifdef HAVE_LCD_BITMAP
  765. + PICTUREFLOW,
  766. +#endif
  767. };
  768.  
  769. static const struct id3_to_search_mapping {
  770. @@ -1166,6 +1174,16 @@
  771. dptr++;
  772. current_entry_count++;
  773. }
  774. +#ifdef HAVE_LCD_BITMAP
  775. + if (offset <= 2 && tag == tag_album)
  776. + {
  777. + dptr->newtable = PICTUREFLOW;
  778. + dptr->name = "<By Covers>";
  779. + dptr++;
  780. + current_entry_count++;
  781. + special_entry_count++;
  782. + }
  783. +#endif
  784. special_entry_count+=2;
  785. }
  786.  
  787. @@ -1366,7 +1384,9 @@
  788. case ROOT:
  789. count = load_root(c);
  790. break;
  791. -
  792. +#ifdef HAVE_LCD_BITMAP
  793. + case PICTUREFLOW:
  794. +#endif
  795. case ALLSUBENTRIES:
  796. case NAVIBROWSE:
  797. logf("navibrowse...");
  798. @@ -1416,6 +1436,23 @@
  799. }
  800. newextra = dptr->newtable;
  801.  
  802. +#ifdef HAVE_LCD_BITMAP
  803. + /* Start pictureflow, and return as we're leaving the db browser
  804. + * and also we still want to be in the album node after exiting
  805. + */
  806. + if (newextra == PICTUREFLOW)
  807. + {
  808. + int retval = plugin_load(PLUGIN_DEMOS_DIR "/pictureflow.rock", NULL);
  809. + switch(retval)
  810. + {
  811. + case PLUGIN_GOTO_WPS:
  812. + return 2;
  813. + default:
  814. + return 0;
  815. + }
  816. + }
  817. +#endif
  818. +
  819. if (c->dirlevel >= MAX_DIR_LEVELS)
  820. return 0;
Add Comment
Please, Sign In to add comment