From 589b8485da73ed4475fcc01099e96a47771abdc2 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Fri, 20 Oct 2017 08:02:09 +0200 Subject: [PATCH] modify autocreate HD _and_ UHD channels as seperate lists Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ec7f5e9b982ac491330149b6c1f30107dbc63030 Author: TangoCash Date: 2017-10-20 (Fri, 20 Oct 2017) --- data/locale/deutsch.locale | 5 +++-- data/locale/english.locale | 5 +++-- src/neutrino.cpp | 6 ++++++ src/system/locals.h | 1 + src/system/locals_intern.h | 1 + src/zapit/include/zapit/getservices.h | 1 + src/zapit/src/getservices.cpp | 10 ++++++++++ 7 files changed, 25 insertions(+), 4 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 23552b6ad..c859d698c 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -232,6 +232,7 @@ bouquetname.hdtv HD-Kanäle bouquetname.new Neue Kanäle bouquetname.other Unbekannter Provider bouquetname.removed Gelöschte Kanäle +bouquetname.uhdtv UHD-Kanäle bouquetname.webtv WebTV-Kanäle buildinfo.compiled_on Build Host buildinfo.compiled_with Compiler Version @@ -289,7 +290,7 @@ channellist.head Alle Kanäle channellist.history Verlauf channellist.history_clear Verlauf löschen channellist.keep_numbers Dauerhafte Kanalnummern -channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen +channellist.make_hdlist Erzeuge Bouquets mit HD und UHD Kanälen channellist.make_newlist Erzeuge Bouquet mit neuen Kanälen channellist.make_removedlist Erzeuge Bouquet mit gelöschten Kanälen channellist.make_webtvlist Erzeuge Bouquet mit WebTV-Kanälen @@ -1355,7 +1356,7 @@ menu.hint_leds_tv Definiert den Status der Power-LEDs im TV-Modus menu.hint_load Laden der Einstellungen aus einer Datei menu.hint_longkeypress_duration Tasten, die länger als die angegebene Zeit betätigt werden, werden als "langer Tastendruck" behandelt. menu.hint_lua Plugins ausführen -menu.hint_make_hdlist Bei aktiver Option wird ein Bouquet namens 'HD' erzeugt, in dem alle HD-Sender zusammengefasst sind +menu.hint_make_hdlist Bei aktiver Option werden Bouquets namens 'HD' und 'UHD' erzeugt, in denen alle HD bzw UHD-Sender zusammengefasst sind menu.hint_make_newlist Nach einer Kanalsuche wird ein Bouquet namens 'neue Kanäle' erzeugt menu.hint_make_removedlist Nach einer Kanalsuche wird ein Bouquet namens 'gelöschte Kanäle' erzeugt menu.hint_make_webtvlist Bei aktiver Option wird ein Bouquet namens 'WebTV' erzeugt, in dem alle WebTV-Sender zusammengefasst sind diff --git a/data/locale/english.locale b/data/locale/english.locale index 84d57fecf..1d357d606 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -232,6 +232,7 @@ bouquetname.hdtv HD channels bouquetname.new New channels bouquetname.other Unknown provider bouquetname.removed Removed channels +bouquetname.uhdtv UHD channels bouquetname.webtv WebTV channels buildinfo.compiled_on Build Host buildinfo.compiled_with Compiler version @@ -289,7 +290,7 @@ channellist.head All services channellist.history History channellist.history_clear Clear history channellist.keep_numbers Persistent channel numbers -channellist.make_hdlist Create list of HD channels +channellist.make_hdlist Create lists of HD and UHD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels channellist.make_webtvlist Create list of WebTV channels @@ -1354,7 +1355,7 @@ menu.hint_leds_tv Working LEDs state menu.hint_load Load GUI settings from file menu.hint_longkeypress_duration A key press will be considered as "long key press" if it's pressed longer than the specified time. menu.hint_lua Run Lua Plugins -menu.hint_make_hdlist Auto-create HD channel list based on\nchannel type and name +menu.hint_make_hdlist Auto-create HD and UHD channel lists based on\nchannel type and name menu.hint_make_newlist Create list of recently added channels menu.hint_make_removedlist Create list of recently removed channels menu.hint_make_webtvlist Auto-create WebTV channel list based on\nchannel type and name diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 48deb3d57..c66201f46 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1822,6 +1822,12 @@ void CNeutrinoApp::channelsInit(bool bOnly) TVallList->Bouquets.push_back(hdBouquet); printf("[neutrino] got %d HD channels\n", (int)zapitList.size()); fflush(stdout); } + if (CServiceManager::getInstance()->GetAllUHDChannels(zapitList)) { + CBouquet* uhdBouquet = new CBouquet(0, g_Locale->getText(LOCALE_BOUQUETNAME_UHDTV), false, true); + uhdBouquet->channelList->SetChannelList(&zapitList); + TVallList->Bouquets.push_back(uhdBouquet); + printf("[neutrino] got %d UHD channels\n", (int)zapitList.size()); fflush(stdout); + } } /* new channels */ if (g_settings.make_new_list) { diff --git a/src/system/locals.h b/src/system/locals.h index 3adf482b1..bcfa5af33 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -259,6 +259,7 @@ typedef enum LOCALE_BOUQUETNAME_NEW, LOCALE_BOUQUETNAME_OTHER, LOCALE_BOUQUETNAME_REMOVED, + LOCALE_BOUQUETNAME_UHDTV, LOCALE_BOUQUETNAME_WEBTV, LOCALE_BUILDINFO_COMPILED_ON, LOCALE_BUILDINFO_COMPILED_WITH, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 3120dc031..f4c3b87e7 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -259,6 +259,7 @@ const char * locale_real_names[] = "bouquetname.new", "bouquetname.other", "bouquetname.removed", + "bouquetname.uhdtv", "bouquetname.webtv", "buildinfo.compiled_on", "buildinfo.compiled_with", diff --git a/src/zapit/include/zapit/getservices.h b/src/zapit/include/zapit/getservices.h index 9ea51c97c..8094ea7fa 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -143,6 +143,7 @@ class CServiceManager bool GetAllRadioChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); bool GetAllTvChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); bool GetAllHDChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); + bool GetAllUHDChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); bool GetAllWebTVChannels(ZapitChannelList &list, int flags = CZapitChannel::PRESENT); bool GetAllSatelliteChannels(ZapitChannelList &list, t_satellite_position position, int flags = CZapitChannel::PRESENT); bool GetAllTransponderChannels(ZapitChannelList &list, transponder_id_t tpid, int flags = CZapitChannel::PRESENT); diff --git a/src/zapit/src/getservices.cpp b/src/zapit/src/getservices.cpp index 338f19023..024b19a20 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -312,6 +312,16 @@ bool CServiceManager::GetAllHDChannels(ZapitChannelList &list, int flags) return (!list.empty()); } +bool CServiceManager::GetAllUHDChannels(ZapitChannelList &list, int flags) +{ + list.clear(); + for (channel_map_iterator_t it = allchans.begin(); it != allchans.end(); ++it) { + if ((it->second.flags & flags) && it->second.isUHD()) + list.push_back(&(it->second)); + } + return (!list.empty()); +} + bool CServiceManager::GetAllWebTVChannels(ZapitChannelList &list, int flags) { list.clear();