From 5d744ba0f169897fa1949fab80dca1809815b2f8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 1 Oct 2016 22:10:00 +0200 Subject: [PATCH 01/12] CLuaInstCCSignalbox: fix compatibility Parameter for frontend was changed, is now NULL. older plugins could expect an instance and could show emtpty signal bars. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/f4387ccfa7d43143c7d1866cf6239951a270865e Author: Thilo Graf Date: 2016-10-01 (Sat, 01 Oct 2016) ------------------ This commit was generated by Migit --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_cc_signalbox.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 642456596..57f01d0ce 100644 --- a/src/gui/lua/lua_api_version.h +++ b/src/gui/lua/lua_api_version.h @@ -4,4 +4,4 @@ * to luainstance.h changes */ #define LUA_API_VERSION_MAJOR 1 -#define LUA_API_VERSION_MINOR 60 +#define LUA_API_VERSION_MINOR 61 diff --git a/src/gui/lua/lua_cc_signalbox.cpp b/src/gui/lua/lua_cc_signalbox.cpp index 6f9253f13..ac8a2ac17 100644 --- a/src/gui/lua/lua_cc_signalbox.cpp +++ b/src/gui/lua/lua_cc_signalbox.cpp @@ -34,6 +34,8 @@ #include "lua_cc_window.h" #include "lua_cc_signalbox.h" +#include + CLuaInstCCSignalbox* CLuaInstCCSignalbox::getInstance() { static CLuaInstCCSignalbox* LuaInstCCSignalbox = NULL; @@ -82,7 +84,7 @@ int CLuaInstCCSignalbox::CCSignalBoxNew(lua_State *L) CComponentsForm* pw = (parent && parent->w) ? parent->w->getBodyObject() : NULL; CLuaCCSignalBox **udata = (CLuaCCSignalBox **) lua_newuserdata(L, sizeof(CLuaCCSignalBox *)); *udata = new CLuaCCSignalBox(); - (*udata)->s = new CSignalBox(x, y, dx, dy, NULL, (vertical!=0)?true:false, pw); + (*udata)->s = new CSignalBox(x, y, dx, dy, CFEManager::getInstance()->getLiveFE(), (vertical!=0)?true:false, pw); (*udata)->parent = pw; luaL_getmetatable(L, "signalbox"); lua_setmetatable(L, -2); From 715968ee52166618c544d6a9a470b3acb9bff4e7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 2 Oct 2016 22:52:10 +0200 Subject: [PATCH 02/12] lua api: fix broken build with --disable-lua Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1d7437998135afaed37b8d8189c9b8698df940d6 Author: Thilo Graf Date: 2016-10-02 (Sun, 02 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + data/locale/nederlands.locale | 1 + data/locale/slovak.locale | 1 + src/gui/movieplayer.cpp | 6 ++++-- src/gui/plugins.cpp | 2 ++ src/neutrino.cpp | 12 ++++++++---- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 9 files changed, 20 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a56632c3f..ef6bbfb99 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -789,6 +789,7 @@ imageinfo.homepage Homepage: imageinfo.image Image: imageinfo.kernel Kernel: imageinfo.license Lizenz +imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio diff --git a/data/locale/english.locale b/data/locale/english.locale index 32d397b37..4b11dcf6f 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -789,6 +789,7 @@ imageinfo.homepage Home page: imageinfo.image Image: imageinfo.kernel Kernel: imageinfo.license License +imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 68dbea5bc..58960ab60 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -734,6 +734,7 @@ imageinfo.homepage Website: imageinfo.image Image: imageinfo.kernel Kernel: imageinfo.license Licentie +imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Versie: inetradio.name Internetradio diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index a4138edb1..1faf8c62b 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -784,6 +784,7 @@ imageinfo.homepage Adresa: imageinfo.image Image: imageinfo.kernel Jadro: imageinfo.license Licencia: +imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Verzia: inetradio.name Internetové rádio diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index db641841e..12e74be70 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -753,11 +753,11 @@ bool CMoviePlayerGui::luaGetUrl(const std::string &script, const std::string &fi std::vector args; args.push_back(file); - +#ifdef ENABLE_LUA CLuaInstance *lua = new CLuaInstance(); lua->runScript(script.c_str(), &args, &result_code, &result_string); delete lua; - +#endif if ((result_code != "0") || result_string.empty()) { if (box != NULL) { box->hide(); @@ -2157,7 +2157,9 @@ void CMoviePlayerGui::handleMovieBrowser(neutrino_msg_t msg, int /*position*/) yres = 1080; aspectRatio = videoDecoder->getAspectRatio(); } +#ifdef ENABLE_LUA CLuaInstVideo::getInstance()->execLuaInfoFunc(luaState, xres, yres, aspectRatio, framerate); +#endif } else if (p_movie_info) g_EpgData->show_mp(p_movie_info, position, duration); diff --git a/src/gui/plugins.cpp b/src/gui/plugins.cpp index fd86c8e99..1a8bb2fee 100644 --- a/src/gui/plugins.cpp +++ b/src/gui/plugins.cpp @@ -427,9 +427,11 @@ void CPlugins::startLuaPlugin(int number) script, plugin_list[number].cfgfile.c_str()); return; } +#ifdef ENABLE_LUA CLuaInstance *lua = new CLuaInstance(); lua->runScript(script); delete lua; +#endif #if HAVE_SPARK_HARDWARE frameBuffer->ClearFB(); #endif diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 31dc68ce0..4b85e0928 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -140,9 +140,9 @@ #include #include #include - +#ifdef ENABLE_LUA #include - +#endif int old_b_id = -1; CInfoClock *InfoClock; @@ -2288,9 +2288,9 @@ void CNeutrinoApp::RealRun() standbyMode(true, true); //cCA::GetInstance()->Ready(true); - +#ifdef ENABLE_LUA CLuaServer *luaServer = CLuaServer::getInstance(); - +#endif g_PluginList->startPlugin("startup"); if (!g_PluginList->getScriptOutput().empty()) { ShowMsg(LOCALE_PLUGINS_RESULT, g_PluginList->getScriptOutput(), CMessageBox::mbrBack,CMessageBox::mbBack,NEUTRINO_ICON_SHELL); @@ -2301,10 +2301,14 @@ void CNeutrinoApp::RealRun() m_screensaver = false; while( true ) { +#ifdef ENABLE_LUA luaServer->UnBlock(); +#endif g_RCInput->getMsg(&msg, &data, 100, ((g_settings.mode_left_right_key_tv == SNeutrinoSettings::VOLUME) && (g_RemoteControl->subChannels.size() < 1)) ? true : false); // 10 secs.. +#ifdef ENABLE_LUA if (luaServer->Block(msg, data)) continue; +#endif if (mode == mode_radio) { bool ignored_msg = ( diff --git a/src/system/locals.h b/src/system/locals.h index 54ceee3fb..1a132b51a 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -816,6 +816,7 @@ typedef enum LOCALE_IMAGEINFO_IMAGE, LOCALE_IMAGEINFO_KERNEL, LOCALE_IMAGEINFO_LICENSE, + LOCALE_IMAGEINFO_LUA, LOCALE_IMAGEINFO_VCS, LOCALE_IMAGEINFO_VERSION, LOCALE_INETRADIO_NAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7c5c6e304..1e6ca26e5 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -816,6 +816,7 @@ const char * locale_real_names[] = "imageinfo.image", "imageinfo.kernel", "imageinfo.license", + "imageinfo.lua", "imageinfo.vcs", "imageinfo.version", "inetradio.name", From 78cac3e91fb3a2c10fbf33e79a0424dce921825f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 00:44:27 +0200 Subject: [PATCH 03/12] CComponentsExtTextForm: add missed parameter font_text Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/80753c75d1414d9eef8786c119535e8c2ecf8e8b Author: Thilo Graf Date: 2016-10-03 (Mon, 03 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/buildinfo.cpp | 2 +- src/gui/components/cc_frm_ext_text.cpp | 8 ++++++-- src/gui/components/cc_frm_ext_text.h | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 48abd219c..f89f933d3 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -174,7 +174,7 @@ void CBuildInfo::InitInfoItems() //init info texts for(size_t i=0; igetText(v_info[i].caption), v_info[i].info_text, ccw_body); + CComponentsExtTextForm *info = new CComponentsExtTextForm(10, CC_APPEND, w_info, h_info, g_Locale->getText(v_info[i].caption), v_info[i].info_text, NULL, ccw_body); info->setLabelAndTextFont(font); info->setTextModes(CTextBox::TOP , CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS); info->doPaintBg(false); diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 97b798795..81354cc6c 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -36,18 +36,20 @@ using namespace std; CComponentsExtTextForm::CComponentsExtTextForm( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, fb_pixel_t text_color, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) { - initVarExtTextForm(x_pos, y_pos, w, h, label_text, text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow); + initVarExtTextForm(x_pos, y_pos, w, h, label_text, text, font_text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow); initCCTextItems(); } CComponentsExtTextFormLocalized::CComponentsExtTextFormLocalized(const int& x_pos, const int& y_pos, const int& w, const int& h, const neutrino_locale_t& locale_label_text, const neutrino_locale_t& locale_text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, @@ -55,12 +57,14 @@ CComponentsExtTextFormLocalized::CComponentsExtTextFormLocalized(const int& x_po fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) : CComponentsExtTextForm( x_pos, y_pos, w, h, g_Locale->getText(locale_label_text), g_Locale->getText(locale_text), + font_text, parent, shadow_mode, label_color, text_color, color_frame, color_body, color_shadow){}; void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, @@ -92,7 +96,7 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p ccx_text_obj = NULL; corner_type = 0; int dx = 0, dy = DEF_HEIGHT; - ccx_font = *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)); + ccx_font = font_text == NULL ? *(CNeutrinoFonts::getInstance()->getDynFont(dx, dy)) : g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]; ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; initParent(parent); diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 6bf1a23db..162ec34ad 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -68,6 +68,7 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen ///initialize basic variables void initVarExtTextForm(const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& label_text, const std::string& text, + Font* font_text, CComponentsForm* parent, int shadow_mode, fb_pixel_t label_color, @@ -78,6 +79,7 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as string CComponentsExtTextForm( const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, const std::string& label_text = "", const std::string& text = "", + Font* font_text = NULL, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, @@ -141,6 +143,7 @@ class CComponentsExtTextFormLocalized : public CComponentsExtTextForm ///advanced constructor for CComponentsExtTextForm, provides parameters for the most required properties, and caption as locales CComponentsExtTextFormLocalized(const int& x_pos = 1, const int& y_pos = 1, const int& w = 300, const int& h = 48, const neutrino_locale_t& locale_label_text = NONEXISTANT_LOCALE, const neutrino_locale_t& locale_text = NONEXISTANT_LOCALE, + Font* font_text = NULL, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, fb_pixel_t label_color = COL_MENUCONTENTINACTIVE_TEXT, From 07f4ba0bc38b0fa854952d824a1c56144642852d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 01:09:47 +0200 Subject: [PATCH 04/12] CComponentsExtTextForm: add methode to get current font Default font is generated by class it self, so it is useful to have access to current font if is required by implemenations. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/ac58c8c016e7adac13f7a392244a1d6fb2592dae Author: Thilo Graf Date: 2016-10-03 (Mon, 03 Oct 2016) ------------------ This commit was generated by Migit --- src/gui/components/cc_frm_ext_text.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/components/cc_frm_ext_text.h b/src/gui/components/cc_frm_ext_text.h index 162ec34ad..769d1b284 100644 --- a/src/gui/components/cc_frm_ext_text.h +++ b/src/gui/components/cc_frm_ext_text.h @@ -133,6 +133,9 @@ class CComponentsExtTextForm : public CComponentsForm, public CCTextScreen ///sets the text modes (mainly text alignment) to the label and text object, see /gui/widget/textbox.h for possible modes void setTextModes(const int& label_mode, const int& text_mode); + ///return current font + Font* getFont(){return ccx_font;} + ///paint this item/form void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; From c5a0795b82dff48d033bf3357000897cc0ac071b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 2 Oct 2016 18:31:26 +0200 Subject: [PATCH 05/12] CImageInfo: enable fade for image info window Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/c9314e4bd1279a2c564e3c69e59a20400b672189 Author: Thilo Graf Date: 2016-10-02 (Sun, 02 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index bb4961317..6a6b499ac 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -105,7 +105,8 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) //init window object, add cc-items and paint all ShowWindow(); - + bool fadeout = false; + neutrino_msg_t postmsg = 0; neutrino_msg_t msg; while (1) { @@ -113,9 +114,23 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) uint64_t timeoutEnd = CRCInput::calcTimeoutEnd_MS(100); g_RCInput->getMsgAbsoluteTimeout( &msg, &data, &timeoutEnd ); + if ((msg == NeutrinoMessages::EVT_TIMER) && (data ==cc_win->GetFadeTimer())){ + if (cc_win->FadeDone()) + break; + continue; + } + if (fadeout && msg == CRCInput::RC_timeout){ + if (cc_win->StartFadeOut()){ + msg = menu_return::RETURN_EXIT_ALL; + continue; + } + else + break; + } + if(msg == CRCInput::RC_setup) { res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } else if (msg == CRCInput::RC_red){ // init temporarly vars @@ -152,9 +167,9 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) btn_red->paint(false); } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { - g_RCInput->postMsg (msg, 0); + postmsg = msg; res = menu_return::RETURN_EXIT_ALL; - break; + fadeout = true; } else if ((msg == CRCInput::RC_up) || (msg == CRCInput::RC_page_up)) { ScrollLic(false); @@ -163,7 +178,7 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) ScrollLic(true); } else if (msg <= CRCInput::RC_MaxRC){ - break; + fadeout = true; } if ( msg > CRCInput::RC_MaxRC && msg != CRCInput::RC_timeout){ @@ -172,8 +187,10 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) } + if (postmsg) + g_RCInput->postMsg(postmsg, 0); + hide(); - return res; } @@ -206,6 +223,7 @@ void CImageInfo::ShowWindow() InitInfoText(getLicenseText()); //paint window + cc_win->StartFadeIn(); cc_win->paint(CC_SAVE_SCREEN_NO); } @@ -408,6 +426,7 @@ void CImageInfo::hide() printf("[CImageInfo] [%s - %d] hide...\n", __FUNCTION__, __LINE__); if (cc_win){ cc_win->kill(); + cc_win->StopFade(); Clean(); } } From e8a63cd1097bc81bf9a9f587b93fcdfb18513042 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 2 Oct 2016 23:24:54 +0200 Subject: [PATCH 06/12] Imageinfo: add lua API info Conflicts: data/locale/deutsch.locale data/locale/english.locale data/locale/nederlands.locale src/system/locals.h src/system/locals_intern.h Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/6b88cea7bf9026319c6c4e1627a4d6e7a2475851 Author: Thilo Graf Date: 2016-10-02 (Sun, 02 Oct 2016) ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 +- data/locale/english.locale | 2 +- data/locale/nederlands.locale | 2 +- data/locale/slovak.locale | 2 +- src/gui/imageinfo.cpp | 10 ++++++++++ src/system/locals.h | 2 +- src/system/locals_intern.h | 2 +- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index ef6bbfb99..fc15ae55b 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -780,6 +780,7 @@ hdd_statfs_recording nur während Aufnahme hdd_umount Aushängen hdd_umount_warn Laufwerk aushängen hdd_umounted Laufwerk entfernt +imageinfo.api API: imageinfo.creator Ersteller: imageinfo.date Datum: imageinfo.dokumentation Dokus: @@ -789,7 +790,6 @@ imageinfo.homepage Homepage: imageinfo.image Image: imageinfo.kernel Kernel: imageinfo.license Lizenz -imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio diff --git a/data/locale/english.locale b/data/locale/english.locale index 4b11dcf6f..3ef0ab02c 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -780,6 +780,7 @@ hdd_statfs_recording while recording only hdd_umount Unmount hdd_umount_warn unmount device hdd_umounted Device removed +imageinfo.api API: imageinfo.creator Creator: imageinfo.date Date: imageinfo.dokumentation Docs: @@ -789,7 +790,6 @@ imageinfo.homepage Home page: imageinfo.image Image: imageinfo.kernel Kernel: imageinfo.license License -imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Version: inetradio.name Internetradio diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index 58960ab60..0deb34b3c 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -725,6 +725,7 @@ hdd_statfs_recording alleen tijdens opname hdd_umount Unmount hdd_umount_warn Apparaat ontkoppelen hdd_umounted Device verwijderd +imageinfo.api API: imageinfo.creator Ontwikkelaar: imageinfo.date Datum: imageinfo.dokumentation Documentatie: @@ -734,7 +735,6 @@ imageinfo.homepage Website: imageinfo.image Image: imageinfo.kernel Kernel: imageinfo.license Licentie -imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Versie: inetradio.name Internetradio diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index 1faf8c62b..9088325c2 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -775,6 +775,7 @@ hdd_statfs_recording len pri nahrávaní hdd_umount Odpojenie hdd_umount_warn Chyba odpájania disku! hdd_umounted Zariadenie odstránené +imageinfo.api API: imageinfo.creator Vytvoril: imageinfo.date Dátum: imageinfo.dokumentation Dokumentácia: @@ -784,7 +785,6 @@ imageinfo.homepage Adresa: imageinfo.image Image: imageinfo.kernel Jadro: imageinfo.license Licencia: -imageinfo.lua LUA-API: imageinfo.vcs Git: imageinfo.version Verzia: inetradio.name Internetové rádio diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 6a6b499ac..a9ce4fd20 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -38,9 +38,13 @@ #include #include #include +#include #include "version.h" #include #define LICENSEDIR DATADIR "/neutrino/license/" +#ifdef ENABLE_LUA +#include +#endif using namespace std; @@ -294,6 +298,12 @@ void CImageInfo::InitInfoData() #endif image_info_t date = {LOCALE_IMAGEINFO_DATE, builddate}; v_info.push_back(date); + string s_api; +#ifdef ENABLE_LUA + s_api += "LUA " + to_string(LUA_API_VERSION_MAJOR) + "." + to_string(LUA_API_VERSION_MINOR); +#endif + image_info_t api = {LOCALE_IMAGEINFO_API, s_api}; + v_info.push_back(api); if (uname(&uts_info) == 0) { image_info_t kernel = {LOCALE_IMAGEINFO_KERNEL, uts_info.release}; v_info.push_back(kernel); diff --git a/src/system/locals.h b/src/system/locals.h index 1a132b51a..a80e31df8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -807,6 +807,7 @@ typedef enum LOCALE_HDD_UMOUNT, LOCALE_HDD_UMOUNT_WARN, LOCALE_HDD_UMOUNTED, + LOCALE_IMAGEINFO_API, LOCALE_IMAGEINFO_CREATOR, LOCALE_IMAGEINFO_DATE, LOCALE_IMAGEINFO_DOKUMENTATION, @@ -816,7 +817,6 @@ typedef enum LOCALE_IMAGEINFO_IMAGE, LOCALE_IMAGEINFO_KERNEL, LOCALE_IMAGEINFO_LICENSE, - LOCALE_IMAGEINFO_LUA, LOCALE_IMAGEINFO_VCS, LOCALE_IMAGEINFO_VERSION, LOCALE_INETRADIO_NAME, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 1e6ca26e5..d759559ab 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -807,6 +807,7 @@ const char * locale_real_names[] = "hdd_umount", "hdd_umount_warn", "hdd_umounted", + "imageinfo.api", "imageinfo.creator", "imageinfo.date", "imageinfo.dokumentation", @@ -816,7 +817,6 @@ const char * locale_real_names[] = "imageinfo.image", "imageinfo.kernel", "imageinfo.license", - "imageinfo.lua", "imageinfo.vcs", "imageinfo.version", "inetradio.name", From f1846549c23caca8104d2691ed66d2b89f79a44d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 00:16:44 +0200 Subject: [PATCH 07/12] CImageInfo: add yweb version info Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/7355ebb8838ab9ace4e1d71068bae03ff09a64e4 Author: Thilo Graf Date: 2016-10-03 (Mon, 03 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 27 ++++++++++++++++++++++++++- src/gui/imageinfo.h | 1 + 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index a9ce4fd20..1dfde2eb6 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -45,6 +45,10 @@ #ifdef ENABLE_LUA #include #endif +#include + +#define VERSION_FILE TARGET_PREFIX "/.version" +#define Y_VERSION_FILE TARGET_PREFIX "/share/tuxbox/neutrino/httpd/Y_Version.txt" using namespace std; @@ -71,7 +75,7 @@ void CImageInfo::Init(void) license_txt = ""; v_info.clear(); - config.loadConfig(TARGET_PREFIX "/.version"); + config.loadConfig(VERSION_FILE); } CImageInfo::~CImageInfo() @@ -301,7 +305,18 @@ void CImageInfo::InitInfoData() string s_api; #ifdef ENABLE_LUA s_api += "LUA " + to_string(LUA_API_VERSION_MAJOR) + "." + to_string(LUA_API_VERSION_MINOR); + s_api += ", "; #endif + s_api += "yWeb "; + s_api += getYApi(); + s_api += ", "; + s_api += HTTPD_NAME; + s_api += + " "; + s_api += HTTPD_VERSION; + s_api += + ", "; + s_api += YHTTPD_NAME; + s_api += + " "; + s_api += YHTTPD_VERSION; image_info_t api = {LOCALE_IMAGEINFO_API, s_api}; v_info.push_back(api); if (uname(&uts_info) == 0) { @@ -440,3 +455,13 @@ void CImageInfo::hide() Clean(); } } + +string CImageInfo::getYApi() +{ + string ret; + config.loadConfig(Y_VERSION_FILE); + ret = config.getString("version", "n/a"); + config.loadConfig(VERSION_FILE); + return ret; +} + diff --git a/src/gui/imageinfo.h b/src/gui/imageinfo.h index 150c6dc9e..a243866b4 100644 --- a/src/gui/imageinfo.h +++ b/src/gui/imageinfo.h @@ -63,6 +63,7 @@ class CImageInfo : public CMenuTarget std::string getLicenseText(); void ShowWindow(); void ScrollLic(bool scrollDown); + std::string getYApi(); CComponentsWindowMax *cc_win; CComponentsForm *cc_info; From d7214434906993d0d7cc42fce0d65bb1f9b9ee23 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 13:15:57 +0200 Subject: [PATCH 08/12] CImageInfo: use matched fontsize for informations This window contains many lines and it's possible that some lines are truncated. if users have changed to extreme font sizes, So it is hopefully solved. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/95735f6faf26ac9bd9d8596d016db33f276c0963 Author: Thilo Graf Date: 2016-10-03 (Mon, 03 Oct 2016) ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 1dfde2eb6..57fcd7d48 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -70,8 +70,8 @@ void CImageInfo::Init(void) b_info = NULL; btn_red = NULL; item_offset = 10; - item_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]; - item_height = item_font->getHeight(); + item_font = NULL; + item_height = 0; license_txt = ""; v_info.clear(); @@ -350,15 +350,18 @@ void CImageInfo::InitInfos() //set width, use size between left border and minitv cc_info->setWidth(cc_win->getWidth() - cc_tv->getWidth() - 2*item_offset); - //calculate initial height for info form - cc_info->setHeight(v_info.size()*item_height); - //create label and text items for (size_t i=0; igetWidth(), item_height, g_Locale->getText(v_info[i].caption), v_info[i].info_text); - item->setLabelAndTextFont(item_font); item->setLabelWidthPercent(20); + if (!item_font){ + item_font = item->getFont(); + //calculate initial height for info form + item_height = item_font->getHeight(); + cc_info->setHeight(v_info.size()*item_height); + } + if ((i == 0) && (item->getYPos() == CC_APPEND)) item->setYPos(1); From 17f82311be33e83931f03a946df09d88fdaffc67 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 15:05:24 +0200 Subject: [PATCH 09/12] CImageInfo: fix possible item height calculation Calculation of height was ok on first paint, but on next time was broken. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dae88708eecb6a0fd8769dc0d09abecd26c99e46 Author: Thilo Graf Date: 2016-10-03 (Mon, 03 Oct 2016) ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 57fcd7d48..93c6c7dee 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -359,8 +359,8 @@ void CImageInfo::InitInfos() item_font = item->getFont(); //calculate initial height for info form item_height = item_font->getHeight(); - cc_info->setHeight(v_info.size()*item_height); } + cc_info->setHeight(v_info.size()*item_height); if ((i == 0) && (item->getYPos() == CC_APPEND)) item->setYPos(1); From 1b46dbc39f95883826dd8ae50c4c70ee2bca1df0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Oct 2016 21:37:54 +0200 Subject: [PATCH 10/12] CImageInfo: fix initial height of first info item On first view of imageinfo window, no image name was visibla. Height for this item was not assigned. Height was only assigned at the second attempt. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/5fcd45b633c978db5824291564d39e30ab171d59 Author: Thilo Graf Date: 2016-10-03 (Mon, 03 Oct 2016) ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 93c6c7dee..282a1acdc 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -352,7 +352,7 @@ void CImageInfo::InitInfos() //create label and text items for (size_t i=0; igetWidth(), item_height, g_Locale->getText(v_info[i].caption), v_info[i].info_text); + CComponentsExtTextForm *item = new CComponentsExtTextForm(1, CC_APPEND, cc_info->getWidth(), 0, g_Locale->getText(v_info[i].caption), v_info[i].info_text); item->setLabelWidthPercent(20); if (!item_font){ @@ -360,6 +360,7 @@ void CImageInfo::InitInfos() //calculate initial height for info form item_height = item_font->getHeight(); } + item->setHeight(item_height); cc_info->setHeight(v_info.size()*item_height); if ((i == 0) && (item->getYPos() == CC_APPEND)) From 9fcaeb67458e3de4da8e59382be697696b5e04b0 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 4 Oct 2016 20:39:45 +0200 Subject: [PATCH 11/12] CImageInfo: using "DATADIR" instead fixed path Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/b8e1d0ebbdfed2b324ac245c2ec9cf57a3d9b449 Author: Thilo Graf Date: 2016-10-04 (Tue, 04 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/imageinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 282a1acdc..c3de0d622 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -48,7 +48,7 @@ #include #define VERSION_FILE TARGET_PREFIX "/.version" -#define Y_VERSION_FILE TARGET_PREFIX "/share/tuxbox/neutrino/httpd/Y_Version.txt" +#define Y_VERSION_FILE DATADIR "/neutrino/httpd/Y_Version.txt" using namespace std; From e236578f8dd635732f4f2a9b42e31ebf090cc9b1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 5 Oct 2016 17:45:52 +0200 Subject: [PATCH 12/12] Moviebrowser: complete licence texts Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe8e3896a0d094c412902fbefe2525da3491e8fd Author: Thilo Graf Date: 2016-10-05 (Wed, 05 Oct 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 28 +++++++------ src/gui/moviebrowser/mb.h | 64 +++++++++-------------------- src/gui/moviebrowser/mb_functions.h | 37 +++++++++++++++++ src/gui/moviebrowser/mb_types.h | 39 ++++++++++++++++++ 4 files changed, 110 insertions(+), 58 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index c227d5902..4721d8f5b 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1,25 +1,25 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' License: GPL - 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 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 program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . *********************************************************** - Module Name: moviebrowser.cpp . + Module Name: mb.cpp Description: Implementation of the CMovieBrowser class This class provides a filebrowser window to view, select and start a movies from HD. @@ -27,12 +27,14 @@ Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Guenther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' (C) 2009-2014 Stefan Seyfried -****************************************************************************/ + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ #ifdef HAVE_CONFIG_H #include diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 37c2e5b09..f518d8511 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -1,67 +1,41 @@ -/*************************************************************************** - Neutrino-GUI - DBoxII-Project - - Homepage: http://dbox.cyberphoria.org/ - - $Id: moviebrowser.h,v 1.5 2006/09/11 21:11:35 guenther Exp $ - - Kommentar: - - Diese GUI wurde von Grund auf neu programmiert und sollte nun vom - Aufbau und auch den Ausbaumoeglichkeiten gut aussehen. Neutrino basiert - auf der Client-Server Idee, diese GUI ist also von der direkten DBox- - Steuerung getrennt. Diese wird dann von Daemons uebernommen. - +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' License: GPL - 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 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 program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . *********************************************************** - Module Name: moviebrowser.h . + Module Name: mb.h - Description: implementation of the CMovieBrowser class + Description: Implementation of the CMovieBrowser class + This class provides a filebrowser window to view, select and start a movies from HD. + This class does replace the Filebrowser Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Guenther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' - $Log: moviebrowser.h,v $ - Revision 1.5 2006/09/11 21:11:35 guenther - General menu clean up - Dir menu updated - Add options menu - In movie info menu "update all" added - Serie option added (hide serie, auto serie) - Update movie info on delete movie - Delete Background when menu is entered - Timeout updated (MB does not exit after options menu is left) + (C) 2009-2014 Stefan Seyfried - Revision 1.4 2006/02/20 01:10:34 guenther - - temporary parental lock updated - remove 1s debug prints in movieplayer- Delete file without rescan of movies- Crash if try to scroll in list with 2 movies only- UTF8XML to UTF8 conversion in preview- Last file selection recovered- use of standard folders adjustable in config- reload and remount option in config + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ - Revision 1.3 2005/12/18 09:23:53 metallica - fix compil warnings - - Revision 1.2 2005/12/12 07:58:02 guenther - - fix bug on deleting CMovieBrowser - speed up parse time (20 ms per .ts file now)- update stale function- refresh directories on reload- print scan time in debug console - - -****************************************************************************/ #ifndef MOVIEBROWSER_H_ #define MOVIEBROWSER_H_ diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h index ddea6d9fc..4c0ce19b1 100644 --- a/src/gui/moviebrowser/mb_functions.h +++ b/src/gui/moviebrowser/mb_functions.h @@ -1,3 +1,40 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + License: GPL + + 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 program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + *********************************************************** + + Module Name: mb_functions.h + + Description: Implementation of the CMovieBrowser class + This class provides a filebrowser window to view, select and start a movies from HD. + This class does replace the Filebrowser + + Date: Nov 2005 + + Author: Guenther@tuxbox.berlios.org + based on code of Steffen Hehn 'McClean' + + (C) 2009-2014 Stefan Seyfried + + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ #ifndef __MB_FUNCTIONS__ #define __MB_FUNCTIONS__ diff --git a/src/gui/moviebrowser/mb_types.h b/src/gui/moviebrowser/mb_types.h index 82a36e385..e8c62c087 100644 --- a/src/gui/moviebrowser/mb_types.h +++ b/src/gui/moviebrowser/mb_types.h @@ -1,3 +1,42 @@ +/* + Based up Neutrino-GUI - Tuxbox-Project + Copyright (C) 2001 by Steffen Hehn 'McClean' + + License: GPL + + 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 program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + *********************************************************** + + Module Name: mb_types.h + + Description: Implementation of the CMovieBrowser class + This class provides a filebrowser window to view, select and start a movies from HD. + This class does replace the Filebrowser + + Date: Nov 2005 + + Author: Guenther@tuxbox.berlios.org + based on code of Steffen Hehn 'McClean' + + (C) 2009-2014 Stefan Seyfried + + outsourced: + (C) 2016, Thilo Graf 'dbt' +*/ + + #include #ifndef __MB_TYPES__