diff options
author | Roman Artiukhin <bahusdrive@gmail.com> | 2024-11-04 12:14:22 +0200 |
---|---|---|
committer | Christian Soffke <christian.soffke@gmail.com> | 2024-12-16 00:13:19 +0100 |
commit | 4062a6aefca73b051448eff125b0069fdcc00732 (patch) | |
tree | 45c4e20869f30fb904aa486e8e39f71e8cd31c66 | |
parent | 5e66f0e762b78b207053d29bddd65e83353b33e0 (diff) | |
download | rockbox-4062a6aefc.tar.gz rockbox-4062a6aefc.zip |
WIP Show Track Info: Select on tag opens it in full screen
Mostly useful for reading comments
WIP as it currently works only from WPS. Doesn't work from file browser(see https://gerrit.rockbox.org/r/c/rockbox/+/5999). Also breaks playlist viewer if called from there. Not sure how to handle it properly in all cases and not currently planning to work on it
Change-Id: I441eb9c6b3fe50f58436111d83bc98a25841d656
-rw-r--r-- | apps/plugins/CATEGORIES | 1 | ||||
-rw-r--r-- | apps/plugins/SOURCES | 3 | ||||
-rw-r--r-- | apps/plugins/SOURCES.app_build | 1 | ||||
-rw-r--r-- | apps/plugins/view_text.c | 35 | ||||
-rw-r--r-- | apps/screens.c | 15 |
5 files changed, 53 insertions, 2 deletions
diff --git a/apps/plugins/CATEGORIES b/apps/plugins/CATEGORIES index aa7dbf38e5..23a7df6fbf 100644 --- a/apps/plugins/CATEGORIES +++ b/apps/plugins/CATEGORIES @@ -207,3 +207,4 @@ xobox,games xrick,games xworld,games zxbox,viewers +view_text,viewers
\ No newline at end of file diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index a070637a77..8dbdc436c6 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES @@ -32,6 +32,7 @@ settings_dumper.c snow.c sort.c stats.c +view_text.c #ifdef HAVE_TOUCHSCREEN stopwatch.lua #else @@ -237,4 +238,4 @@ test_touchscreen.c #endif test_usb.c test_viewports.c -#endif /* HAVE_TEST_PLUGINS */ +#endif /* HAVE_TEST_PLUGINS */
\ No newline at end of file diff --git a/apps/plugins/SOURCES.app_build b/apps/plugins/SOURCES.app_build index 50c79ec016..9822d3b70b 100644 --- a/apps/plugins/SOURCES.app_build +++ b/apps/plugins/SOURCES.app_build @@ -12,6 +12,7 @@ search.c sort.c theme_remove.c vbrfix.c +view_text.c #if PLUGIN_BUFFER_SIZE >= 0x80000 boomshine.lua stopwatch.lua diff --git a/apps/plugins/view_text.c b/apps/plugins/view_text.c new file mode 100644 index 0000000000..7ce7b5215f --- /dev/null +++ b/apps/plugins/view_text.c @@ -0,0 +1,35 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id$ + * + * Copyright (C) 2002 Björn Stenberg + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +/* welcome to the example rockbox plugin */ + +/* mandatory include for all plugins */ +#include "plugin.h" +#include "lib/simple_viewer.h" + +/* this is the plugin entry point */ +enum plugin_status plugin_start(const void* parameter) +{ + + char** title_and_text = (char**)parameter; + view_text(title_and_text[0], title_and_text[1]); + return PLUGIN_OK; +} diff --git a/apps/screens.c b/apps/screens.c index e9c8cb6bf6..278ac350b7 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -55,6 +55,7 @@ #include "replaygain.h" #include "ctype.h" +#include "plugin.h" #if CONFIG_CHARGING void charging_splash(void) @@ -815,7 +816,19 @@ refresh_info: if(!list_do_action(CONTEXT_LIST,HZ/2, &id3_lists, &key) && key!=ACTION_NONE && key!=ACTION_UNKNOWN) { - if (key == ACTION_STD_OK || key == ACTION_STD_CANCEL) + if (key == ACTION_STD_OK) + { + int header_id = id3_headers[info.info_id[id3_lists.selected_item/2]]; + char* title_and_text[2]; + title_and_text[0] = str(header_id); + + char buffer[MAX_PATH]; + title_and_text[1] = (char*)id3_get_or_speak_info(id3_lists.selected_item+1,&info, buffer, sizeof(buffer), false); + plugin_load(VIEWERS_DIR"/view_text.rock", title_and_text); + gui_synclist_draw(&id3_lists); + continue; + } + if (key == ACTION_STD_CANCEL) { ret = false; break; |