summaryrefslogtreecommitdiff
path: root/apps/onplay.c
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-07-31 22:45:10 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2020-08-17 10:15:14 -0400
commit35502834423049b319fde41ff305b48de67d2d51 (patch)
tree00d638d9348cd38f15cf6d341e700bc36153b3f8 /apps/onplay.c
parentd553bb1149800daf16dcb92bc0608fe6248e1dab (diff)
downloadrockbox-35502834423049b319fde41ff305b48de67d2d51.tar.gz
rockbox-35502834423049b319fde41ff305b48de67d2d51.zip
Add open_plugin to core
open_plugin allows arbitrary plugins to be called in hotkey and start screen replaces PictureFlow Integration shortcuts menu plays plugins now too rather than store paths and parameters in the settings that reside in memory instead entries in a file are searched by hash. after all, the plugin has to be loaded from disk anyways ---------------------------------------------------------------------------- shortcut_viewer.rock-- can now call plugins rather than taking you to them in the browser ----------------------------------------------------------------------------- Added a new option to menus: F_CB_ON_SELECT_ONLY instead of option callback every time a item is accessed F_CB_ON_SELECT_ONLY fires callback only when item is selected ----------------------------------------------------------------------------- Added manual entries ----------------------------------------------------------------------------- Change-Id: I078b57b1d2b4dd633c89212c1082fcbc1b516e6a
Diffstat (limited to 'apps/onplay.c')
-rw-r--r--apps/onplay.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/apps/onplay.c b/apps/onplay.c
index fd956167d3..f2ebd47630 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -43,6 +43,7 @@
43#include "talk.h" 43#include "talk.h"
44#include "onplay.h" 44#include "onplay.h"
45#include "filetypes.h" 45#include "filetypes.h"
46#include "open_plugin.h"
46#include "plugin.h" 47#include "plugin.h"
47#include "bookmark.h" 48#include "bookmark.h"
48#include "action.h" 49#include "action.h"
@@ -1415,10 +1416,8 @@ MENUITEM_FUNCTION(rating_item, 0, ID2P(LANG_MENU_SET_RATING),
1415 set_rating_inline, NULL, 1416 set_rating_inline, NULL,
1416 ratingitem_callback, Icon_Questionmark); 1417 ratingitem_callback, Icon_Questionmark);
1417#endif 1418#endif
1418#ifdef HAVE_PICTUREFLOW_INTEGRATION 1419MENUITEM_RETURNVALUE(plugin_item, ID2P(LANG_OPEN_PLUGIN),
1419MENUITEM_RETURNVALUE(pictureflow_item, ID2P(LANG_ONPLAY_PICTUREFLOW), 1420 GO_TO_PLUGIN, NULL, Icon_Plugin);
1420 GO_TO_PICTUREFLOW, NULL, Icon_NOICON);
1421#endif
1422 1421
1423static bool view_cue(void) 1422static bool view_cue(void)
1424{ 1423{
@@ -1650,9 +1649,7 @@ MAKE_ONPLAYMENU( wps_onplay_menu, ID2P(LANG_ONPLAY_MENU_TITLE),
1650 &rating_item, 1649 &rating_item,
1651#endif 1650#endif
1652 &bookmark_menu, 1651 &bookmark_menu,
1653#ifdef HAVE_PICTUREFLOW_INTEGRATION 1652 &plugin_item,
1654 &pictureflow_item,
1655#endif
1656 &browse_id3_item, &list_viewers_item, 1653 &browse_id3_item, &list_viewers_item,
1657 &delete_file_item, &view_cue_item, 1654 &delete_file_item, &view_cue_item,
1658#ifdef HAVE_PITCHCONTROL 1655#ifdef HAVE_PITCHCONTROL
@@ -1732,6 +1729,11 @@ static int playlist_insert_shuffled(void)
1732 return ONPLAY_RELOAD_DIR; 1729 return ONPLAY_RELOAD_DIR;
1733} 1730}
1734 1731
1732static void hotkey_run_plugin(void)
1733{
1734 open_plugin_run(ID2P(LANG_HOTKEY_WPS));
1735}
1736
1735struct hotkey_assignment { 1737struct hotkey_assignment {
1736 int action; /* hotkey_action */ 1738 int action; /* hotkey_action */
1737 int lang_id; /* Language ID */ 1739 int lang_id; /* Language ID */
@@ -1768,11 +1770,9 @@ static struct hotkey_assignment hotkey_items[] = {
1768 { HOTKEY_INSERT_SHUFFLED, LANG_INSERT_SHUFFLED, 1770 { HOTKEY_INSERT_SHUFFLED, LANG_INSERT_SHUFFLED,
1769 HOTKEY_FUNC(playlist_insert_shuffled, NULL), 1771 HOTKEY_FUNC(playlist_insert_shuffled, NULL),
1770 ONPLAY_RELOAD_DIR }, 1772 ONPLAY_RELOAD_DIR },
1771#ifdef HAVE_PICTUREFLOW_INTEGRATION 1773 { HOTKEY_PLUGIN, LANG_OPEN_PLUGIN,
1772 { HOTKEY_PICTUREFLOW, LANG_ONPLAY_PICTUREFLOW, 1774 HOTKEY_FUNC(hotkey_run_plugin, NULL),
1773 HOTKEY_FUNC(NULL, NULL), 1775 ONPLAY_OK },
1774 ONPLAY_PICTUREFLOW },
1775#endif
1776 { HOTKEY_BOOKMARK, LANG_BOOKMARK_MENU_CREATE, 1776 { HOTKEY_BOOKMARK, LANG_BOOKMARK_MENU_CREATE,
1777 HOTKEY_FUNC(bookmark_create_menu, NULL), 1777 HOTKEY_FUNC(bookmark_create_menu, NULL),
1778 ONPLAY_OK }, 1778 ONPLAY_OK },
@@ -1861,10 +1861,8 @@ int onplay(char* file, int attr, int from, bool hotkey)
1861 return ONPLAY_MAINMENU; 1861 return ONPLAY_MAINMENU;
1862 case GO_TO_PLAYLIST_VIEWER: 1862 case GO_TO_PLAYLIST_VIEWER:
1863 return ONPLAY_PLAYLIST; 1863 return ONPLAY_PLAYLIST;
1864#ifdef HAVE_PICTUREFLOW_INTEGRATION 1864 case GO_TO_PLUGIN:
1865 case GO_TO_PICTUREFLOW: 1865 return ONPLAY_PLUGIN;
1866 return ONPLAY_PICTUREFLOW;
1867#endif
1868 default: 1866 default:
1869 return onplay_result; 1867 return onplay_result;
1870 } 1868 }