From 77a4db2431c1d9d32f897460b2274604acf05ff6 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 Signed-off-by: Thilo Graf Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c12ce65aa49d8bca0df7ec1a421d3e77f0b6124 Author: TangoCash Date: 2017-10-20 (Fri, 20 Oct 2017) ------------------ This commit was generated by Migit --- 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 c77d59d53..a7e215627 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -226,6 +226,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 @@ -258,7 +259,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 @@ -1165,7 +1166,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 e2990e072..35677bb6e 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -226,6 +226,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 @@ -258,7 +259,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 @@ -1165,7 +1166,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 dfc194025..d906874fd 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -1696,6 +1696,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 6d677a627..81a7698ef 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -253,6 +253,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 37ff3597b..6c2f37860 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -253,6 +253,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 f82908e26..b7195cc1d 100644 --- a/src/zapit/include/zapit/getservices.h +++ b/src/zapit/include/zapit/getservices.h @@ -140,6 +140,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 3071d7145..da803d047 100644 --- a/src/zapit/src/getservices.cpp +++ b/src/zapit/src/getservices.cpp @@ -294,6 +294,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();