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;