summaryrefslogtreecommitdiff
path: root/apps/plugins/lib/playback_control.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/lib/playback_control.c')
-rw-r--r--apps/plugins/lib/playback_control.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/apps/plugins/lib/playback_control.c b/apps/plugins/lib/playback_control.c
index 8a1381a1e7..672d275bcc 100644
--- a/apps/plugins/lib/playback_control.c
+++ b/apps/plugins/lib/playback_control.c
@@ -98,26 +98,31 @@ static bool repeat_mode(void)
98 98
99 return result; 99 return result;
100} 100}
101MENUITEM_FUNCTION(prevtrack_item, 0, "Previous Track",
102 prevtrack, NULL, NULL, Icon_NOICON);
103MENUITEM_FUNCTION(playpause_item, 0, "Pause / Play",
104 play, NULL, NULL, Icon_NOICON);
105MENUITEM_FUNCTION(stop_item, 0, "Stop Playback",
106 stop, NULL, NULL, Icon_NOICON);
107MENUITEM_FUNCTION(nexttrack_item, 0, "Next Track",
108 nexttrack, NULL, NULL, Icon_NOICON);
109MENUITEM_FUNCTION(volume_item, 0, "Change Volume",
110 volume, NULL, NULL, Icon_NOICON);
111MENUITEM_FUNCTION(shuffle_item, 0, "Enable/Disable Shuffle",
112 shuffle, NULL, NULL, Icon_NOICON);
113MENUITEM_FUNCTION(repeat_mode_item, 0, "Change Repeat Mode",
114 repeat_mode, NULL, NULL, Icon_NOICON);
115MAKE_MENU(playback_control_menu, "Playback Control", NULL, Icon_NOICON,
116 &prevtrack_item, &playpause_item, &stop_item, &nexttrack_item,
117 &volume_item, &shuffle_item, &repeat_mode_item);
101 118
102bool playback_control(struct plugin_api* newapi) 119void playback_control_init(struct plugin_api* newapi)
103{ 120{
104 int m;
105 api = newapi; 121 api = newapi;
106 bool result; 122}
107
108 static struct menu_item items[] = {
109 { "Previous Track", prevtrack },
110 { "Pause / Play", play },
111 { "Stop Playback", stop },
112 { "Next Track", nexttrack },
113 { "Change Volume", volume },
114 { "Enable/Disable Shuffle", shuffle },
115 { "Change Repeat Mode", repeat_mode },
116 };
117 123
118 m=api->menu_init( items, sizeof(items) / sizeof(*items), NULL, 124bool playback_control(struct plugin_api* newapi)
119 NULL, NULL, NULL); 125{
120 result = api->menu_run(m); 126 api = newapi;
121 api->menu_exit(m); 127 return api->do_menu(&playback_control_menu, NULL) == SYS_USB_CONNECTED;
122 return result;
123} 128}