diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e1292fd5d..c2aa9e35d 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -567,21 +567,38 @@ void CInfoViewer::check_channellogo_ca_SettingsChange() void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap, int epgpos) { if(channel) { + std::string pname = ""; + if(g_settings.infobar_show_channeldesc){ + if(channel->pname){ + pname = channel->pname; + pname=pname.substr(pname.find_first_of("]")+1); + } + } + showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos); + channel->getChannelID(), calledFromNumZap, epgpos, pname); } } void CInfoViewer::showTitle(t_channel_id chid, const bool calledFromNumZap, int epgpos) { + CZapitChannel * channel = CServiceManager::getInstance()->FindChannel(chid); + std::string pname = ""; + if(channel) { + if(g_settings.infobar_show_channeldesc){ + if(channel->pname){ + pname = channel->pname; + pname=pname.substr(pname.find_first_of("]")+1); + } + } showTitle(channel->number, channel->getName(), channel->getSatellitePosition(), - channel->getChannelID(), calledFromNumZap, epgpos); + channel->getChannelID(), calledFromNumZap, epgpos, pname); } } -void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos) +void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id, const bool calledFromNumZap, int epgpos, std::string pname) { check_channellogo_ca_SettingsChange(); aspectRatio = 0; @@ -709,6 +726,15 @@ void CInfoViewer::showTitle (const int ChanNum, const std::string & Channel, con ChanNameX + 10 + ChanNumWidth, ChanNameY + time_height, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth, ChannelName, color /*COL_INFOBAR*/, 0, true); // UTF-8 + if(g_settings.infobar_show_channeldesc && !pname.empty()){ + int chname_width = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (ChannelName); + chname_width += (chname_width/(ChannelName.size()-1)/2); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( + ChanNameX + 10 + ChanNumWidth + chname_width, ChanNameY + time_height -SHADOW_OFFSET/2, + BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 5 - ChanNumWidth - chname_width, + pname, color /*COL_INFOBAR*/, 0, true); // UTF-8 + } + } } diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index e2d5a9b95..6a70a154c 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -155,7 +155,7 @@ class CInfoViewer void start(); void showEpgInfo(); - void showTitle(const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false, int epgpos = 0); // Channel must be UTF-8 encoded + void showTitle(const int ChanNum, const std::string & Channel, const t_satellite_position satellitePosition, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false, int epgpos = 0, std::string pname=""); // Channel must be UTF-8 encoded void showTitle(CZapitChannel * channel, const bool calledFromNumZap = false, int epgpos = 0); void showTitle(t_channel_id channel_id, const bool calledFromNumZap = false, int epgpos = 0); void lookAheadEPG(const int ChanNum, const std::string & Channel, const t_channel_id new_channel_id = 0, const bool calledFromNumZap = false); //alpha: fix for nvod subchannel update diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 45e780792..baa905480 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -378,6 +378,7 @@ int CNeutrinoApp::loadSetup(const char * fname) strcpy(g_settings.shutdown_min, configfile.getString("shutdown_min","180").c_str()); g_settings.infobar_sat_display = configfile.getBool("infobar_sat_display" , true ); + g_settings.infobar_show_channeldesc = configfile.getBool("infobar_show_channeldesc" , false ); g_settings.infobar_subchan_disp_pos = configfile.getInt32("infobar_subchan_disp_pos" , 0 ); g_settings.progressbar_color = configfile.getBool("progressbar_color", true ); g_settings.infobar_show = configfile.getInt32("infobar_show", 1); @@ -833,6 +834,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setString("shutdown_count" , g_settings.shutdown_count); configfile.setString("shutdown_min" , g_settings.shutdown_min ); configfile.setBool("infobar_sat_display" , g_settings.infobar_sat_display ); + configfile.setBool("infobar_show_channeldesc" , g_settings.infobar_show_channeldesc ); configfile.setInt32("infobar_subchan_disp_pos" , g_settings.infobar_subchan_disp_pos ); configfile.setBool("progressbar_color" , g_settings.progressbar_color ); configfile.setInt32("infobar_show", g_settings.infobar_show); @@ -1953,7 +1955,18 @@ void CNeutrinoApp::numericZap(int msg) void CNeutrinoApp::showInfo() { StopSubtitles(); - g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), channelList->getActiveChannelName(), channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID()); + std::string name = channelList->getActiveChannelName(); + std::string pname = ""; + + if(g_settings.infobar_show_channeldesc){ + CZapitChannel* channel= channelList->getActiveChannel(); + if(channel->pname){ + pname = channel->pname; + pname=pname.substr(pname.find_first_of("]")+1); + } + } + + g_InfoViewer->showTitle(channelList->getActiveChannelNumber(), name, channelList->getActiveSatellitePosition(), channelList->getActiveChannel_ChannelID(), false, 0, pname); StartSubtitles(); } diff --git a/src/system/settings.h b/src/system/settings.h index 2ca0ddd42..29c9ee2fb 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -63,6 +63,7 @@ struct SNeutrinoSettings char record_safety_time_after[3]; int zapto_pre_time; int infobar_sat_display; + int infobar_show_channeldesc; int infobar_subchan_disp_pos; int fan_speed; int infobar_show;