diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/filetree.c | 48 | ||||
-rw-r--r-- | apps/plugin.c | 32 | ||||
-rw-r--r-- | apps/plugin.h | 1 |
3 files changed, 51 insertions, 30 deletions
diff --git a/apps/filetree.c b/apps/filetree.c index d4681ae2c7..87ac37c2e0 100644 --- a/apps/filetree.c +++ b/apps/filetree.c | |||
@@ -552,22 +552,35 @@ int ft_enter(struct tree_context* c) | |||
552 | 552 | ||
553 | /* plugin file */ | 553 | /* plugin file */ |
554 | case FILE_ATTR_ROCK: | 554 | case FILE_ATTR_ROCK: |
555 | { | ||
556 | int ret; | ||
555 | if (global_settings.party_mode && audio_status()) { | 557 | if (global_settings.party_mode && audio_status()) { |
556 | splash(HZ, ID2P(LANG_PARTY_MODE)); | 558 | splash(HZ, ID2P(LANG_PARTY_MODE)); |
557 | break; | 559 | break; |
558 | } | 560 | } |
559 | 561 | ret = plugin_load(buf,NULL); | |
560 | if (plugin_load(buf,NULL) == PLUGIN_USB_CONNECTED) | 562 | switch (ret) |
561 | { | 563 | { |
562 | if(*c->dirfilter > NUM_FILTER_MODES) | 564 | case PLUGIN_GOTO_WPS: |
563 | /* leave sub-browsers after usb, doing | 565 | play = true; |
564 | otherwise might be confusing to the user */ | 566 | break; |
565 | exit_func = true; | 567 | case PLUGIN_USB_CONNECTED: |
566 | else | 568 | if(*c->dirfilter > NUM_FILTER_MODES) |
567 | reload_dir = true; | 569 | /* leave sub-browsers after usb, doing |
570 | otherwise might be confusing to the user */ | ||
571 | exit_func = true; | ||
572 | else | ||
573 | reload_dir = true; | ||
574 | break; | ||
575 | /* | ||
576 | case PLUGIN_ERROR: | ||
577 | case PLUGIN_OK: | ||
578 | */ | ||
579 | default: | ||
580 | break; | ||
568 | } | 581 | } |
569 | break; | 582 | break; |
570 | 583 | } | |
571 | case FILE_ATTR_CUE: | 584 | case FILE_ATTR_CUE: |
572 | display_cuesheet_content(buf); | 585 | display_cuesheet_content(buf); |
573 | break; | 586 | break; |
@@ -584,8 +597,21 @@ int ft_enter(struct tree_context* c) | |||
584 | plugin = filetype_get_plugin(file); | 597 | plugin = filetype_get_plugin(file); |
585 | if (plugin) | 598 | if (plugin) |
586 | { | 599 | { |
587 | if (plugin_load(plugin,buf) == PLUGIN_USB_CONNECTED) | 600 | switch (plugin_load(plugin,buf)) |
588 | reload_dir = true; | 601 | { |
602 | case PLUGIN_USB_CONNECTED: | ||
603 | reload_dir = true; | ||
604 | break; | ||
605 | case PLUGIN_GOTO_WPS: | ||
606 | play = true; | ||
607 | break; | ||
608 | /* | ||
609 | case PLUGIN_OK: | ||
610 | case PLUGIN_ERROR: | ||
611 | */ | ||
612 | default: | ||
613 | break; | ||
614 | } | ||
589 | } | 615 | } |
590 | break; | 616 | break; |
591 | } | 617 | } |
diff --git a/apps/plugin.c b/apps/plugin.c index d6a5d067ce..f08a98753a 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -664,6 +664,7 @@ static const struct plugin_api rockbox_api = { | |||
664 | int plugin_load(const char* plugin, const void* parameter) | 664 | int plugin_load(const char* plugin, const void* parameter) |
665 | { | 665 | { |
666 | int rc; | 666 | int rc; |
667 | int i; | ||
667 | int oldbars; | 668 | int oldbars; |
668 | struct plugin_header *hdr; | 669 | struct plugin_header *hdr; |
669 | #ifdef SIMULATOR | 670 | #ifdef SIMULATOR |
@@ -804,8 +805,6 @@ int plugin_load(const char* plugin, const void* parameter) | |||
804 | #endif /* LCD_DEPTH */ | 805 | #endif /* LCD_DEPTH */ |
805 | #endif /* HAVE_LCD_BITMAP */ | 806 | #endif /* HAVE_LCD_BITMAP */ |
806 | 807 | ||
807 | lcd_clear_display(); | ||
808 | lcd_update(); | ||
809 | 808 | ||
810 | #ifdef HAVE_REMOTE_LCD | 809 | #ifdef HAVE_REMOTE_LCD |
811 | #if LCD_REMOTE_DEPTH > 1 | 810 | #if LCD_REMOTE_DEPTH > 1 |
@@ -814,32 +813,27 @@ int plugin_load(const char* plugin, const void* parameter) | |||
814 | #else | 813 | #else |
815 | lcd_remote_set_drawmode(DRMODE_SOLID); | 814 | lcd_remote_set_drawmode(DRMODE_SOLID); |
816 | #endif | 815 | #endif |
817 | lcd_remote_clear_display(); | 816 | #endif |
818 | |||
819 | |||
820 | lcd_remote_update(); | ||
821 | 817 | ||
818 | if (rc != PLUGIN_GOTO_WPS) | ||
819 | { | ||
820 | FOR_NB_SCREENS(i) | ||
821 | { | ||
822 | screens[i].clear_display(); | ||
823 | screens[i].update(); | ||
824 | } | ||
825 | } | ||
822 | 826 | ||
823 | #endif | ||
824 | viewportmanager_set_statusbar(oldbars); | 827 | viewportmanager_set_statusbar(oldbars); |
825 | if (pfn_tsr_exit == NULL) | 828 | if (pfn_tsr_exit == NULL) |
826 | plugin_loaded = false; | 829 | plugin_loaded = false; |
827 | 830 | ||
828 | sim_plugin_close(pd); | 831 | sim_plugin_close(pd); |
829 | 832 | ||
830 | switch (rc) { | 833 | if (rc == PLUGIN_ERROR) |
831 | case PLUGIN_OK: | 834 | splash(HZ*2, str(LANG_PLUGIN_ERROR)); |
832 | break; | ||
833 | |||
834 | case PLUGIN_USB_CONNECTED: | ||
835 | return PLUGIN_USB_CONNECTED; | ||
836 | |||
837 | default: | ||
838 | splash(HZ*2, str(LANG_PLUGIN_ERROR)); | ||
839 | break; | ||
840 | } | ||
841 | 835 | ||
842 | return PLUGIN_OK; | 836 | return rc; |
843 | } | 837 | } |
844 | 838 | ||
845 | /* Returns a pointer to the portion of the plugin buffer that is not already | 839 | /* Returns a pointer to the portion of the plugin buffer that is not already |
diff --git a/apps/plugin.h b/apps/plugin.h index f3d4c23e8a..253cfd0aab 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -139,6 +139,7 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
139 | enum plugin_status { | 139 | enum plugin_status { |
140 | PLUGIN_OK = 0, | 140 | PLUGIN_OK = 0, |
141 | PLUGIN_USB_CONNECTED, | 141 | PLUGIN_USB_CONNECTED, |
142 | PLUGIN_GOTO_WPS, | ||
142 | PLUGIN_ERROR = -1, | 143 | PLUGIN_ERROR = -1, |
143 | }; | 144 | }; |
144 | 145 | ||