diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 7cd5a19c8..60e5f6b37 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -79,10 +79,12 @@ #include #include +#include #include extern CRemoteControl * g_RemoteControl; /* neutrino.cpp */ extern CPlugins * g_PluginList; /* neutrino.cpp */ +extern cVideo * videoDecoder; #if !HAVE_SPARK_HARDWARE extern CCAMMenuHandler * g_CamHandler; #endif @@ -525,15 +527,28 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu case SNeutrinoSettings::ITEM_NONE: case SNeutrinoSettings::ITEM_BAR: case SNeutrinoSettings::ITEM_LIVESTREAM_RESOLUTION: - if(loc == NONEXISTANT_LOCALE && !text) { - /* TODO - get const char *valname from struct - keyval_ext LIVESTREAM_RESOLUTION_OPTIONS - */ - text = to_string(g_settings.livestreamResolution).c_str(); - } else - return_title = true; - active = true; + if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { + if(loc == NONEXISTANT_LOCALE && !text) { + CWebTVResolution webtvres; + text = webtvres.getResolutionValue(); + if (!(videoDecoder->getBlank())) + { + int xres = 0, yres = 0, framerate; + videoDecoder->getPictureInfo(xres, yres, framerate); + if (xres && yres) + { + std::string res = to_string(xres) + "x" + to_string(yres); + if (res.compare(text)) + { + std::string tmp = (string)text + " (" + res + ")"; + text = tmp.c_str(); + } + } + } + } else + return_title = true; + active = true; + } continue; case SNeutrinoSettings::ITEM_EPG_MISC: return_title = true; diff --git a/src/gui/webtv_setup.cpp b/src/gui/webtv_setup.cpp index cd8fa5bd8..9e0edf26f 100644 --- a/src/gui/webtv_setup.cpp +++ b/src/gui/webtv_setup.cpp @@ -210,4 +210,12 @@ int CWebTVResolution::Show() return res; } -// vim:ts=4 +const char *CWebTVResolution::getResolutionValue() +{ + for (unsigned int i = 0; i < LIVESTREAM_RESOLUTION_OPTION_COUNT; ++i) + { + if (g_settings.livestreamResolution == LIVESTREAM_RESOLUTION_OPTIONS[i].key) + return LIVESTREAM_RESOLUTION_OPTIONS[i].valname; + } + return ""; +} diff --git a/src/gui/webtv_setup.h b/src/gui/webtv_setup.h index 0a39332bc..698719ee8 100644 --- a/src/gui/webtv_setup.h +++ b/src/gui/webtv_setup.h @@ -48,6 +48,7 @@ class CWebTVResolution : public CMenuTarget CMenuWidget *m; public: CWebTVResolution(); + const char *getResolutionValue(); int exec(CMenuTarget* parent, const std::string & actionKey); int Show(); };