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
This commit is contained in:
Roman Artiukhin 2024-11-04 12:14:22 +02:00 committed by Christian Soffke
parent 5e66f0e762
commit 4062a6aefc
5 changed files with 53 additions and 2 deletions

View file

@ -207,3 +207,4 @@ xobox,games
xrick,games
xworld,games
zxbox,viewers
view_text,viewers

View file

@ -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 */

View file

@ -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

35
apps/plugins/view_text.c Normal file
View file

@ -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;
}

View file

@ -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;