From b0c0c3bd053bb6f574e81a4ada1df5c198cecbfe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 Aug 2016 16:34:00 +0200 Subject: [PATCH 01/41] Moviebrowser: start outsourcing moviebrowser code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/64053c1758b1157d02b31a33db34ffa4943032bf Author: Thilo Graf Date: 2016-08-11 (Thu, 11 Aug 2016) --- configure.ac | 1 + src/Makefile.am | 1 + src/gui/Makefile.am | 3 +-- src/gui/epgplus.cpp | 2 +- src/gui/epgview.cpp | 2 +- src/gui/eventlist.cpp | 2 +- src/gui/mediaplayer_setup.cpp | 2 +- src/gui/moviebrowser/Makefile.am | 20 +++++++++++++++++++ .../{moviebrowser.cpp => moviebrowser/mb.cpp} | 8 ++++---- src/gui/{moviebrowser.h => moviebrowser/mb.h} | 12 ++++------- src/gui/movieplayer.h | 2 +- 11 files changed, 36 insertions(+), 19 deletions(-) create mode 100644 src/gui/moviebrowser/Makefile.am rename src/gui/{moviebrowser.cpp => moviebrowser/mb.cpp} (99%) rename src/gui/{moviebrowser.h => moviebrowser/mb.h} (99%) diff --git a/configure.ac b/configure.ac index cf1fc12ee..e7b520033 100644 --- a/configure.ac +++ b/configure.ac @@ -297,6 +297,7 @@ src/gui/Makefile src/gui/bedit/Makefile src/gui/components/Makefile src/gui/lua/Makefile +src/gui/moviebrowser/Makefile src/gui/widget/Makefile src/system/Makefile src/system/mtdutils/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 1a30813fc..de465fc64 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -83,6 +83,7 @@ neutrino_LDADD = \ driver/pictureviewer/libneutrino_pictureviewer.a \ $(MTDUTILSLIBS) \ gui/movieinfo.o \ + gui/moviebrowser/mb.o \ gui/libneutrino_gui2.a \ gui/components/libneutrino_gui_components.a \ $(LUALIBS) \ diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index f1d0c89b9..86a06903f 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -14,7 +14,7 @@ version.h: noinst_HEADERS = version.h .PHONY: version.h -SUBDIRS = bedit components widget +SUBDIRS = bedit components moviebrowser widget if ENABLE_LUA SUBDIRS += lua @@ -68,7 +68,6 @@ libneutrino_gui_a_SOURCES = \ mediaplayer.cpp \ mediaplayer_setup.cpp \ miscsettings_menu.cpp \ - moviebrowser.cpp \ movieinfo.cpp \ movieplayer.cpp \ network_service.cpp \ diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 94ab4af35..c3d9981fa 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 14f1f26bc..c3878ed7b 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 505450779..38e2d9662 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/gui/mediaplayer_setup.cpp b/src/gui/mediaplayer_setup.cpp index c2894739d..bb18e8333 100644 --- a/src/gui/mediaplayer_setup.cpp +++ b/src/gui/mediaplayer_setup.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include diff --git a/src/gui/moviebrowser/Makefile.am b/src/gui/moviebrowser/Makefile.am new file mode 100644 index 000000000..46379f2ca --- /dev/null +++ b/src/gui/moviebrowser/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS + +AM_CPPFLAGS += \ + -I$(top_builddir) \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/zapit/include \ + -I$(top_srcdir)/lib \ + -I$(top_srcdir)/lib/libeventserver \ + -I$(top_srcdir)/lib/libconfigfile \ + -I$(top_srcdir)/lib/xmltree \ + @SIGC_CFLAGS@ \ + @FREETYPE_CFLAGS@ \ + @HWLIB_CFLAGS@ + +noinst_LIBRARIES = libneutrino_gui_moviebrowser.a + + +libneutrino_gui_moviebrowser_a_SOURCES = \ + mb.cpp diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser/mb.cpp similarity index 99% rename from src/gui/moviebrowser.cpp rename to src/gui/moviebrowser/mb.cpp index 99c376188..89d7f0a8e 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -27,7 +27,7 @@ Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Günther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' (C) 2009-2014 Stefan Seyfried @@ -43,8 +43,8 @@ #include #include -#include "moviebrowser.h" -#include "filebrowser.h" +#include "mb.h" +#include #include #include #include @@ -1404,7 +1404,7 @@ void CMovieBrowser::refreshMovieInfo(void) int w_logo = ratio*CChannelLogo->getWidth()/100; CChannelLogo->setWidth(min(w_logo, logo_w_max)); } - + lx = m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-CChannelLogo->getWidth()-10; ly = m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-CChannelLogo->getHeight())/2; CChannelLogo->setXPos(lx - pb_hdd_offset); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser/mb.h similarity index 99% rename from src/gui/moviebrowser.h rename to src/gui/moviebrowser/mb.h index 55e3e8516..0e14978db 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser/mb.h @@ -1,7 +1,7 @@ /*************************************************************************** Neutrino-GUI - DBoxII-Project - Homepage: http://dbox.cyberphoria.org/ + Homepage: http://dbox.cyberphoria.org/ $Id: moviebrowser.h,v 1.5 2006/09/11 21:11:35 guenther Exp $ @@ -37,7 +37,7 @@ Date: Nov 2005 - Author: Günther@tuxbox.berlios.org + Author: Günther@tuxbox.berlios.org based on code of Steffen Hehn 'McClean' $Log: moviebrowser.h,v $ @@ -74,9 +74,9 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -385,7 +385,7 @@ class CMovieBrowser : public CMenuTarget void setMode(int mode) { if (show_mode != mode) m_file_info_stale = true; - show_mode = mode; + show_mode = mode; } bool gotMovie(const char *rec_title); @@ -651,7 +651,3 @@ const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = }; #endif /*MOVIEBROWSER_H_*/ - - - - diff --git a/src/gui/movieplayer.h b/src/gui/movieplayer.h index c2101cdf7..cbe1ed10a 100644 --- a/src/gui/movieplayer.h +++ b/src/gui/movieplayer.h @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include From 85633abc0162061d46d214d34bc3eb19a98e1b89 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 Aug 2016 20:14:40 +0200 Subject: [PATCH 02/41] Movibrowser: types outsourced Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/71df2cab526095f1299764a20747be2d2da4c038 Author: Thilo Graf Date: 2016-08-11 (Thu, 11 Aug 2016) --- src/gui/moviebrowser/mb.h | 191 +----------------------------- src/gui/moviebrowser/mb_types.h | 198 ++++++++++++++++++++++++++++++++ 2 files changed, 203 insertions(+), 186 deletions(-) create mode 100644 src/gui/moviebrowser/mb_types.h diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 0e14978db..6da94e076 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -69,12 +69,14 @@ #include #endif +#include "mb_types.h" + #include #include #include #include -#include + #include #include #include @@ -91,105 +93,9 @@ #define MAX_BROWSER_FRAME_HEIGHT 80 void strReplace(std::string& orig, const char* fstr, const std::string &rstr); -/* !!!! Do NOT change the order of the enum, just add items at the end !!!! */ -typedef enum -{ - MB_INFO_FILENAME = 0, - MB_INFO_FILEPATH = 1, - MB_INFO_TITLE = 2, - MB_INFO_SERIE = 3, - MB_INFO_INFO1 = 4, - MB_INFO_MAJOR_GENRE = 5, - MB_INFO_MINOR_GENRE = 6, - MB_INFO_INFO2 = 7, - MB_INFO_PARENTAL_LOCKAGE = 8, - MB_INFO_CHANNEL = 9, - MB_INFO_BOOKMARK = 10, - MB_INFO_QUALITY = 11, - MB_INFO_PREVPLAYDATE = 12, - MB_INFO_RECORDDATE = 13, - MB_INFO_PRODDATE = 14, - MB_INFO_COUNTRY = 15, - MB_INFO_GEOMETRIE = 16, - MB_INFO_AUDIO = 17, - MB_INFO_LENGTH = 18, - MB_INFO_SIZE = 19, - MB_INFO_RATING = 20, - MB_INFO_MAX_NUMBER = 21 // MUST be allways the last item in the list -}MB_INFO_ITEM; -typedef enum -{ - MB_DIRECTION_AUTO = 0, - MB_DIRECTION_UP = 1, - MB_DIRECTION_DOWN = 2, - MB_DIRECTION_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_DIRECTION; - -typedef struct -{ - MB_INFO_ITEM item; - MB_DIRECTION direction; -}MB_SORTING; - -typedef enum -{ - MB_STORAGE_TYPE_UNDEFINED = 0, - MB_STORAGE_TYPE_NFS = 1, - MB_STORAGE_TYPE_VLC = 2, - MB_STORAGE_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_STORAGE_TYPE; - -typedef struct -{ - MB_INFO_ITEM item; - std::string optionString; - int optionVar; -}MB_FILTER; - -typedef enum -{ - MB_FOCUS_BROWSER = 0, - MB_FOCUS_LAST_PLAY = 1, - MB_FOCUS_LAST_RECORD = 2, - MB_FOCUS_MOVIE_INFO = 3, - MB_FOCUS_FILTER = 4, - MB_FOCUS_MAX_NUMBER = 5 // MUST be allways the last item in the list -}MB_FOCUS; - -typedef enum -{ - MB_GUI_BROWSER_ONLY = 0, - MB_GUI_MOVIE_INFO = 1, - MB_GUI_LAST_PLAY = 2, - MB_GUI_LAST_RECORD = 3, - MB_GUI_FILTER = 4, - MB_GUI_MAX_NUMBER = 5 // MUST be allways the last item in the list -}MB_GUI; - - -typedef enum -{ - MB_PARENTAL_LOCK_OFF = 0, - MB_PARENTAL_LOCK_ACTIVE = 1, - MB_PARENTAL_LOCK_OFF_TMP = 2, // use this to activate the lock temporarily until next dbox start up - MB_PARENTAL_LOCK_MAX_NUMBER = 3 // MUST be allways the last item in the list -}MB_PARENTAL_LOCK; - -typedef struct -{ - std::string name; - int* used; -}MB_DIR; - -typedef enum -{ - MB_SHOW_RECORDS, - MB_SHOW_FILES, - MB_SHOW_YT -} MB_SHOW_MODE; #define MB_MAX_ROWS LF_MAX_ROWS #define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES @@ -540,14 +446,7 @@ class CFileChooser : public CMenuWidget int exec(CMenuTarget* parent, const std::string & actionKey); }; -typedef enum -{ - DIR_STATE_UNKNOWN = 0, - DIR_STATE_SERVER_DOWN = 1, - DIR_STATE_NOT_MOUNTED = 2, - DIR_STATE_MOUNTED = 3, - DIR_STATE_DISABLED = 4 -} DIR_STATE; + class CDirMenu : public CMenuWidget { @@ -568,86 +467,6 @@ class CDirMenu : public CMenuWidget }; -// EPG Genre, taken from epgview, TODO: might be splitted in major/minor to increase handling -#define GENRE_ALL_COUNT 76 -const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = -{ - { 0x00, LOCALE_GENRE_UNKNOWN }, - { 0x10, LOCALE_GENRE_MOVIE_0 }, - { 0x11, LOCALE_GENRE_MOVIE_1 }, - { 0x12, LOCALE_GENRE_MOVIE_2 }, - { 0x13, LOCALE_GENRE_MOVIE_3 }, - { 0x14, LOCALE_GENRE_MOVIE_4 }, - { 0x15, LOCALE_GENRE_MOVIE_5 }, - { 0x16, LOCALE_GENRE_MOVIE_6 }, - { 0x17, LOCALE_GENRE_MOVIE_7 }, - { 0x18, LOCALE_GENRE_MOVIE_8 }, - { 0x20, LOCALE_GENRE_NEWS_0 }, - { 0x21, LOCALE_GENRE_NEWS_1 }, - { 0x22, LOCALE_GENRE_NEWS_2 }, - { 0x23, LOCALE_GENRE_NEWS_3 }, - { 0x24, LOCALE_GENRE_NEWS_4 }, - { 0x30, LOCALE_GENRE_SHOW_0 }, - { 0x31, LOCALE_GENRE_SHOW_1 }, - { 0x32, LOCALE_GENRE_SHOW_2 }, - { 0x33, LOCALE_GENRE_SHOW_3 }, - { 0x40, LOCALE_GENRE_SPORTS_0 }, - { 0x41, LOCALE_GENRE_SPORTS_1 }, - { 0x42, LOCALE_GENRE_SPORTS_2 }, - { 0x43, LOCALE_GENRE_SPORTS_3 }, - { 0x44, LOCALE_GENRE_SPORTS_4 }, - { 0x45, LOCALE_GENRE_SPORTS_5 }, - { 0x46, LOCALE_GENRE_SPORTS_6 }, - { 0x47, LOCALE_GENRE_SPORTS_7 }, - { 0x48, LOCALE_GENRE_SPORTS_8 }, - { 0x49, LOCALE_GENRE_SPORTS_9 }, - { 0x4A, LOCALE_GENRE_SPORTS_10 }, - { 0x4B, LOCALE_GENRE_SPORTS_11 }, - { 0x50, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, - { 0x51, LOCALE_GENRE_CHILDRENS_PROGRAMMES_1 }, - { 0x52, LOCALE_GENRE_CHILDRENS_PROGRAMMES_2 }, - { 0x53, LOCALE_GENRE_CHILDRENS_PROGRAMMES_3 }, - { 0x54, LOCALE_GENRE_CHILDRENS_PROGRAMMES_4 }, - { 0x55, LOCALE_GENRE_CHILDRENS_PROGRAMMES_5 }, - { 0x60, LOCALE_GENRE_MUSIC_DANCE_0 }, - { 0x61, LOCALE_GENRE_MUSIC_DANCE_1 }, - { 0x62, LOCALE_GENRE_MUSIC_DANCE_2 }, - { 0x63, LOCALE_GENRE_MUSIC_DANCE_3 }, - { 0x64, LOCALE_GENRE_MUSIC_DANCE_4 }, - { 0x65, LOCALE_GENRE_MUSIC_DANCE_5 }, - { 0x66, LOCALE_GENRE_MUSIC_DANCE_6 }, - { 0x70, LOCALE_GENRE_ARTS_0 }, - { 0x71, LOCALE_GENRE_ARTS_1 }, - { 0x72, LOCALE_GENRE_ARTS_2 }, - { 0x73, LOCALE_GENRE_ARTS_3 }, - { 0x74, LOCALE_GENRE_ARTS_4 }, - { 0x75, LOCALE_GENRE_ARTS_5 }, - { 0x76, LOCALE_GENRE_ARTS_6 }, - { 0x77, LOCALE_GENRE_ARTS_7 }, - { 0x78, LOCALE_GENRE_ARTS_8 }, - { 0x79, LOCALE_GENRE_ARTS_9 }, - { 0x7A, LOCALE_GENRE_ARTS_10 }, - { 0x7B, LOCALE_GENRE_ARTS_11 }, - { 0x80, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, - { 0x81, LOCALE_GENRE_SOCIAL_POLITICAL_1 }, - { 0x82, LOCALE_GENRE_SOCIAL_POLITICAL_2 }, - { 0x83, LOCALE_GENRE_SOCIAL_POLITICAL_3 }, - { 0x90, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, - { 0x91, LOCALE_GENRE_DOCUS_MAGAZINES_1 }, - { 0x92, LOCALE_GENRE_DOCUS_MAGAZINES_2 }, - { 0x93, LOCALE_GENRE_DOCUS_MAGAZINES_3 }, - { 0x94, LOCALE_GENRE_DOCUS_MAGAZINES_4 }, - { 0x95, LOCALE_GENRE_DOCUS_MAGAZINES_5 }, - { 0x96, LOCALE_GENRE_DOCUS_MAGAZINES_6 }, - { 0x97, LOCALE_GENRE_DOCUS_MAGAZINES_7 }, - { 0xA0, LOCALE_GENRE_TRAVEL_HOBBIES_0 }, - { 0xA1, LOCALE_GENRE_TRAVEL_HOBBIES_1 }, - { 0xA2, LOCALE_GENRE_TRAVEL_HOBBIES_2 }, - { 0xA3, LOCALE_GENRE_TRAVEL_HOBBIES_3 }, - { 0xA4, LOCALE_GENRE_TRAVEL_HOBBIES_4 }, - { 0xA5, LOCALE_GENRE_TRAVEL_HOBBIES_5 }, - { 0xA6, LOCALE_GENRE_TRAVEL_HOBBIES_6 }, - { 0xA7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } -}; + #endif /*MOVIEBROWSER_H_*/ diff --git a/src/gui/moviebrowser/mb_types.h b/src/gui/moviebrowser/mb_types.h new file mode 100644 index 000000000..82a36e385 --- /dev/null +++ b/src/gui/moviebrowser/mb_types.h @@ -0,0 +1,198 @@ +#include + +#ifndef __MB_TYPES__ +#define __MB_TYPES__ + + + +/* !!!! Do NOT change the order of the enum, just add items at the end !!!! */ +typedef enum +{ + MB_INFO_FILENAME = 0, + MB_INFO_FILEPATH = 1, + MB_INFO_TITLE = 2, + MB_INFO_SERIE = 3, + MB_INFO_INFO1 = 4, + MB_INFO_MAJOR_GENRE = 5, + MB_INFO_MINOR_GENRE = 6, + MB_INFO_INFO2 = 7, + MB_INFO_PARENTAL_LOCKAGE = 8, + MB_INFO_CHANNEL = 9, + MB_INFO_BOOKMARK = 10, + MB_INFO_QUALITY = 11, + MB_INFO_PREVPLAYDATE = 12, + MB_INFO_RECORDDATE = 13, + MB_INFO_PRODDATE = 14, + MB_INFO_COUNTRY = 15, + MB_INFO_GEOMETRIE = 16, + MB_INFO_AUDIO = 17, + MB_INFO_LENGTH = 18, + MB_INFO_SIZE = 19, + MB_INFO_RATING = 20, + MB_INFO_MAX_NUMBER = 21 // MUST be allways the last item in the list +}MB_INFO_ITEM; + + +typedef enum +{ + MB_DIRECTION_AUTO = 0, + MB_DIRECTION_UP = 1, + MB_DIRECTION_DOWN = 2, + MB_DIRECTION_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_DIRECTION; + +typedef struct +{ + MB_INFO_ITEM item; + MB_DIRECTION direction; +}MB_SORTING; + +typedef enum +{ + MB_STORAGE_TYPE_UNDEFINED = 0, + MB_STORAGE_TYPE_NFS = 1, + MB_STORAGE_TYPE_VLC = 2, + MB_STORAGE_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_STORAGE_TYPE; + +typedef struct +{ + MB_INFO_ITEM item; + std::string optionString; + int optionVar; +}MB_FILTER; + +typedef enum +{ + MB_FOCUS_BROWSER = 0, + MB_FOCUS_LAST_PLAY = 1, + MB_FOCUS_LAST_RECORD = 2, + MB_FOCUS_MOVIE_INFO = 3, + MB_FOCUS_FILTER = 4, + MB_FOCUS_MAX_NUMBER = 5 // MUST be allways the last item in the list +}MB_FOCUS; + +typedef enum +{ + MB_GUI_BROWSER_ONLY = 0, + MB_GUI_MOVIE_INFO = 1, + MB_GUI_LAST_PLAY = 2, + MB_GUI_LAST_RECORD = 3, + MB_GUI_FILTER = 4, + MB_GUI_MAX_NUMBER = 5 // MUST be allways the last item in the list +}MB_GUI; + + +typedef enum +{ + MB_PARENTAL_LOCK_OFF = 0, + MB_PARENTAL_LOCK_ACTIVE = 1, + MB_PARENTAL_LOCK_OFF_TMP = 2, // use this to activate the lock temporarily until next dbox start up + MB_PARENTAL_LOCK_MAX_NUMBER = 3 // MUST be allways the last item in the list +}MB_PARENTAL_LOCK; + +typedef struct +{ + std::string name; + int* used; +}MB_DIR; + +typedef enum +{ + MB_SHOW_RECORDS, + MB_SHOW_FILES, + MB_SHOW_YT +} MB_SHOW_MODE; + +typedef enum +{ + DIR_STATE_UNKNOWN = 0, + DIR_STATE_SERVER_DOWN = 1, + DIR_STATE_NOT_MOUNTED = 2, + DIR_STATE_MOUNTED = 3, + DIR_STATE_DISABLED = 4 +} DIR_STATE; + +// EPG Genre, taken from epgview, TODO: might be splitted in major/minor to increase handling +#define GENRE_ALL_COUNT 76 +const CMenuOptionChooser::keyval GENRE_ALL[GENRE_ALL_COUNT] = +{ + { 0x00, LOCALE_GENRE_UNKNOWN }, + { 0x10, LOCALE_GENRE_MOVIE_0 }, + { 0x11, LOCALE_GENRE_MOVIE_1 }, + { 0x12, LOCALE_GENRE_MOVIE_2 }, + { 0x13, LOCALE_GENRE_MOVIE_3 }, + { 0x14, LOCALE_GENRE_MOVIE_4 }, + { 0x15, LOCALE_GENRE_MOVIE_5 }, + { 0x16, LOCALE_GENRE_MOVIE_6 }, + { 0x17, LOCALE_GENRE_MOVIE_7 }, + { 0x18, LOCALE_GENRE_MOVIE_8 }, + { 0x20, LOCALE_GENRE_NEWS_0 }, + { 0x21, LOCALE_GENRE_NEWS_1 }, + { 0x22, LOCALE_GENRE_NEWS_2 }, + { 0x23, LOCALE_GENRE_NEWS_3 }, + { 0x24, LOCALE_GENRE_NEWS_4 }, + { 0x30, LOCALE_GENRE_SHOW_0 }, + { 0x31, LOCALE_GENRE_SHOW_1 }, + { 0x32, LOCALE_GENRE_SHOW_2 }, + { 0x33, LOCALE_GENRE_SHOW_3 }, + { 0x40, LOCALE_GENRE_SPORTS_0 }, + { 0x41, LOCALE_GENRE_SPORTS_1 }, + { 0x42, LOCALE_GENRE_SPORTS_2 }, + { 0x43, LOCALE_GENRE_SPORTS_3 }, + { 0x44, LOCALE_GENRE_SPORTS_4 }, + { 0x45, LOCALE_GENRE_SPORTS_5 }, + { 0x46, LOCALE_GENRE_SPORTS_6 }, + { 0x47, LOCALE_GENRE_SPORTS_7 }, + { 0x48, LOCALE_GENRE_SPORTS_8 }, + { 0x49, LOCALE_GENRE_SPORTS_9 }, + { 0x4A, LOCALE_GENRE_SPORTS_10 }, + { 0x4B, LOCALE_GENRE_SPORTS_11 }, + { 0x50, LOCALE_GENRE_CHILDRENS_PROGRAMMES_0 }, + { 0x51, LOCALE_GENRE_CHILDRENS_PROGRAMMES_1 }, + { 0x52, LOCALE_GENRE_CHILDRENS_PROGRAMMES_2 }, + { 0x53, LOCALE_GENRE_CHILDRENS_PROGRAMMES_3 }, + { 0x54, LOCALE_GENRE_CHILDRENS_PROGRAMMES_4 }, + { 0x55, LOCALE_GENRE_CHILDRENS_PROGRAMMES_5 }, + { 0x60, LOCALE_GENRE_MUSIC_DANCE_0 }, + { 0x61, LOCALE_GENRE_MUSIC_DANCE_1 }, + { 0x62, LOCALE_GENRE_MUSIC_DANCE_2 }, + { 0x63, LOCALE_GENRE_MUSIC_DANCE_3 }, + { 0x64, LOCALE_GENRE_MUSIC_DANCE_4 }, + { 0x65, LOCALE_GENRE_MUSIC_DANCE_5 }, + { 0x66, LOCALE_GENRE_MUSIC_DANCE_6 }, + { 0x70, LOCALE_GENRE_ARTS_0 }, + { 0x71, LOCALE_GENRE_ARTS_1 }, + { 0x72, LOCALE_GENRE_ARTS_2 }, + { 0x73, LOCALE_GENRE_ARTS_3 }, + { 0x74, LOCALE_GENRE_ARTS_4 }, + { 0x75, LOCALE_GENRE_ARTS_5 }, + { 0x76, LOCALE_GENRE_ARTS_6 }, + { 0x77, LOCALE_GENRE_ARTS_7 }, + { 0x78, LOCALE_GENRE_ARTS_8 }, + { 0x79, LOCALE_GENRE_ARTS_9 }, + { 0x7A, LOCALE_GENRE_ARTS_10 }, + { 0x7B, LOCALE_GENRE_ARTS_11 }, + { 0x80, LOCALE_GENRE_SOCIAL_POLITICAL_0 }, + { 0x81, LOCALE_GENRE_SOCIAL_POLITICAL_1 }, + { 0x82, LOCALE_GENRE_SOCIAL_POLITICAL_2 }, + { 0x83, LOCALE_GENRE_SOCIAL_POLITICAL_3 }, + { 0x90, LOCALE_GENRE_DOCUS_MAGAZINES_0 }, + { 0x91, LOCALE_GENRE_DOCUS_MAGAZINES_1 }, + { 0x92, LOCALE_GENRE_DOCUS_MAGAZINES_2 }, + { 0x93, LOCALE_GENRE_DOCUS_MAGAZINES_3 }, + { 0x94, LOCALE_GENRE_DOCUS_MAGAZINES_4 }, + { 0x95, LOCALE_GENRE_DOCUS_MAGAZINES_5 }, + { 0x96, LOCALE_GENRE_DOCUS_MAGAZINES_6 }, + { 0x97, LOCALE_GENRE_DOCUS_MAGAZINES_7 }, + { 0xA0, LOCALE_GENRE_TRAVEL_HOBBIES_0 }, + { 0xA1, LOCALE_GENRE_TRAVEL_HOBBIES_1 }, + { 0xA2, LOCALE_GENRE_TRAVEL_HOBBIES_2 }, + { 0xA3, LOCALE_GENRE_TRAVEL_HOBBIES_3 }, + { 0xA4, LOCALE_GENRE_TRAVEL_HOBBIES_4 }, + { 0xA5, LOCALE_GENRE_TRAVEL_HOBBIES_5 }, + { 0xA6, LOCALE_GENRE_TRAVEL_HOBBIES_6 }, + { 0xA7, LOCALE_GENRE_TRAVEL_HOBBIES_7 } +}; + +#endif /*__MB_TYPES__*/ \ No newline at end of file From 3dec3ca94b4240bc96d00404f58b3896fcd9c790 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 12 Aug 2016 17:28:12 +0200 Subject: [PATCH 03/41] Moviebrowser: functions outsourced TODO: Classes and menus should follow someday. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a10755dca78f87dde7b7f123f4f5a26249c7b077 Author: Thilo Graf Date: 2016-08-12 (Fri, 12 Aug 2016) --- src/gui/moviebrowser/mb.cpp | 127 +------------------------ src/gui/moviebrowser/mb.h | 2 +- src/gui/moviebrowser/mb_functions.h | 138 ++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+), 123 deletions(-) create mode 100644 src/gui/moviebrowser/mb_functions.h diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 89d7f0a8e..ea1319fea 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -42,8 +42,9 @@ #include #include -#include +//#include #include "mb.h" +#include "mb_functions.h" #include #include #include @@ -62,12 +63,12 @@ #include // for statfs #include #include -#include +//#include #include #include #include #include -#include +//#include #include #include #include @@ -227,122 +228,7 @@ static MI_MOVIE_INFO* playing_info; //------------------------------------------------------------------------ #define FILEBROWSER_NUMBER_OF_SORT_VARIANTS 5 -bool sortDirection = 0; -bool compare_to_lower(const char a, const char b) -{ - return tolower(a) < tolower(b); -} - -// sort operators -bool sortByTitle(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgTitle.begin(), a->epgTitle.end(), b->epgTitle.begin(), b->epgTitle.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgTitle.begin(), b->epgTitle.end(), a->epgTitle.begin(), a->epgTitle.end(), compare_to_lower)) - return false; - return a->file.Time < b->file.Time; -} -bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgInfo1.begin(), a->epgInfo1.end(), b->epgInfo1.begin(), b->epgInfo1.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgInfo1.begin(), b->epgInfo1.end(), a->epgInfo1.begin(), a->epgInfo1.end(), compare_to_lower)) - return false; - return sortByTitle(a,b); -} -bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) - return false; - return sortByTitle(a,b); -} -bool sortByFileName(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (std::lexicographical_compare(a->file.getFileName().begin(), a->file.getFileName().end(), b->file.getFileName().begin(), b->file.getFileName().end(), compare_to_lower)) - return true; - if (std::lexicographical_compare(b->file.getFileName().begin(), b->file.getFileName().end(), a->file.getFileName().begin(), a->file.getFileName().end(), compare_to_lower)) - return false; - return a->file.Time < b->file.Time; -} -bool sortByRecordDate(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->file.Time > b->file.Time ; - else - return a->file.Time < b->file.Time ; -} -bool sortBySize(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->file.Size > b->file.Size; - else - return a->file.Size < b->file.Size; -} -bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->parentalLockAge > b->parentalLockAge; - else - return a->parentalLockAge < b->parentalLockAge; -} -bool sortByRating(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->rating > b->rating; - else - return a->rating < b->rating; -} -bool sortByQuality(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->quality > b->quality; - else - return a->quality < b->quality; -} -bool sortByDir(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->dirItNr > b->dirItNr; - else - return a->dirItNr < b->dirItNr; -} - -bool sortByLastPlay(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) -{ - if (sortDirection) - return a->dateOfLastPlay > b->dateOfLastPlay; - else - return a->dateOfLastPlay < b->dateOfLastPlay; -} - -bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) = -{ - &sortByFileName, //MB_INFO_FILENAME = 0, - &sortByDir, //MB_INFO_FILEPATH = 1, - &sortByTitle, //MB_INFO_TITLE = 2, - NULL, //MB_INFO_SERIE = 3, - &sortByGenre, //MB_INFO_INFO1 = 4, - NULL, //MB_INFO_MAJOR_GENRE = 5, - NULL, //MB_INFO_MINOR_GENRE = 6, - NULL, //MB_INFO_INFO2 = 7, - &sortByAge, //MB_INFO_PARENTAL_LOCKAGE = 8, - &sortByChannel, //MB_INFO_CHANNEL = 9, - NULL, //MB_INFO_BOOKMARK = 10, - &sortByQuality, //MB_INFO_QUALITY = 11, - &sortByLastPlay, //MB_INFO_PREVPLAYDATE = 12, - &sortByRecordDate, //MB_INFO_RECORDDATE = 13, - NULL, //MB_INFO_PRODDATE = 14, - NULL, //MB_INFO_COUNTRY = 15, - NULL, //MB_INFO_GEOMETRIE = 16, - NULL, //MB_INFO_AUDIO = 17, - NULL, //MB_INFO_LENGTH = 18, - &sortBySize, //MB_INFO_SIZE = 19, - &sortByRating, //MB_INFO_RATING = 20, - NULL //MB_INFO_MAX_NUMBER = 21 -}; CMovieBrowser::CMovieBrowser(): configfile ('\t') { @@ -2977,10 +2863,7 @@ void CMovieBrowser::showHelp(void) help.exec(NULL,NULL); } -static std::string rateFormat(int i) -{ - return to_string(i/10) + "," + to_string(i%10); -} + #define MAX_STRING 30 int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 6da94e076..512a165ff 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -73,7 +73,7 @@ #include -#include +//#include #include #include diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h new file mode 100644 index 000000000..4b0002ddc --- /dev/null +++ b/src/gui/moviebrowser/mb_functions.h @@ -0,0 +1,138 @@ + +#ifndef __MB_FUNCTIONS__ +#define __MB_FUNCTIONS__ + + +#include "mb_types.h" +#include + + + + +void strReplace(std::string& orig, const char* fstr, const std::string &rstr); + +static std::string rateFormat(int i) +{ + return to_string(i/10) + "," + to_string(i%10); +} + +bool sortDirection = 0; + +bool compare_to_lower(const char a, const char b) +{ + return tolower(a) < tolower(b); +} + +// sort operators +bool sortByTitle(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgTitle.begin(), a->epgTitle.end(), b->epgTitle.begin(), b->epgTitle.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgTitle.begin(), b->epgTitle.end(), a->epgTitle.begin(), a->epgTitle.end(), compare_to_lower)) + return false; + return a->file.Time < b->file.Time; +} +bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgInfo1.begin(), a->epgInfo1.end(), b->epgInfo1.begin(), b->epgInfo1.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgInfo1.begin(), b->epgInfo1.end(), a->epgInfo1.begin(), a->epgInfo1.end(), compare_to_lower)) + return false; + return sortByTitle(a,b); +} +bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) + return false; + return sortByTitle(a,b); +} +bool sortByFileName(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (std::lexicographical_compare(a->file.getFileName().begin(), a->file.getFileName().end(), b->file.getFileName().begin(), b->file.getFileName().end(), compare_to_lower)) + return true; + if (std::lexicographical_compare(b->file.getFileName().begin(), b->file.getFileName().end(), a->file.getFileName().begin(), a->file.getFileName().end(), compare_to_lower)) + return false; + return a->file.Time < b->file.Time; +} +bool sortByRecordDate(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->file.Time > b->file.Time ; + else + return a->file.Time < b->file.Time ; +} +bool sortBySize(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->file.Size > b->file.Size; + else + return a->file.Size < b->file.Size; +} +bool sortByAge(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->parentalLockAge > b->parentalLockAge; + else + return a->parentalLockAge < b->parentalLockAge; +} +bool sortByRating(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->rating > b->rating; + else + return a->rating < b->rating; +} +bool sortByQuality(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->quality > b->quality; + else + return a->quality < b->quality; +} +bool sortByDir(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->dirItNr > b->dirItNr; + else + return a->dirItNr < b->dirItNr; +} + +bool sortByLastPlay(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) +{ + if (sortDirection) + return a->dateOfLastPlay > b->dateOfLastPlay; + else + return a->dateOfLastPlay < b->dateOfLastPlay; +} + +bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) = +{ + &sortByFileName, //MB_INFO_FILENAME = 0, + &sortByDir, //MB_INFO_FILEPATH = 1, + &sortByTitle, //MB_INFO_TITLE = 2, + NULL, //MB_INFO_SERIE = 3, + &sortByGenre, //MB_INFO_INFO1 = 4, + NULL, //MB_INFO_MAJOR_GENRE = 5, + NULL, //MB_INFO_MINOR_GENRE = 6, + NULL, //MB_INFO_INFO2 = 7, + &sortByAge, //MB_INFO_PARENTAL_LOCKAGE = 8, + &sortByChannel, //MB_INFO_CHANNEL = 9, + NULL, //MB_INFO_BOOKMARK = 10, + &sortByQuality, //MB_INFO_QUALITY = 11, + &sortByLastPlay, //MB_INFO_PREVPLAYDATE = 12, + &sortByRecordDate, //MB_INFO_RECORDDATE = 13, + NULL, //MB_INFO_PRODDATE = 14, + NULL, //MB_INFO_COUNTRY = 15, + NULL, //MB_INFO_GEOMETRIE = 16, + NULL, //MB_INFO_AUDIO = 17, + NULL, //MB_INFO_LENGTH = 18, + &sortBySize, //MB_INFO_SIZE = 19, + &sortByRating, //MB_INFO_RATING = 20, + NULL //MB_INFO_MAX_NUMBER = 21 +}; + + + +#endif /*__MB_FUNCTIONS__*/ From 640b0fca59472fe1f7c34c13f354300be07b1b92 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 6 Sep 2016 11:29:59 +0200 Subject: [PATCH 04/41] CFileHelpers::removeDir: Better error message - No error when directory does not exist Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ff9a71cd36f7f535897156aceb7f3a0b8f1121fd Author: Michael Liebmann Date: 2016-09-06 (Tue, 06 Sep 2016) --- src/system/helpers.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 246831c56..9a140cf52 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -925,8 +925,14 @@ bool CFileHelpers::removeDir(const char *Dir) dir = opendir(Dir); if (dir == NULL) { - fh->setDebugInfo("Error opendir().", __path_file__, __func__, __LINE__); - fh->printDebugInfo(); + if (errno == ENOENT) + return true; + if (!fh->getConsoleQuiet()) + dprintf(DEBUG_NORMAL, "[CFileHelpers %s] remove directory %s: %s\n", __func__, Dir, strerror(errno)); + char buf[1024]; + memset(buf, '\0', sizeof(buf)); + snprintf(buf, sizeof(buf)-1, "remove directory %s: %s", Dir, strerror(errno)); + fh->setDebugInfo(buf, __path_file__, __func__, __LINE__); return false; } while ((entry = readdir(dir)) != NULL) { From daf201ae37eb052424299694f5099246e74b4845 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Tue, 6 Sep 2016 11:30:06 +0200 Subject: [PATCH 05/41] CFileHelpers: Rework FileBuf handling FileBuf: Reserve memory only when it is needed (copyFile) copyFile: Reserve for small files, only as much memory as is required Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6a9c08ae900a38895724f53fab7a2fa71e3276cc Author: Michael Liebmann Date: 2016-09-06 (Tue, 06 Sep 2016) --- src/system/helpers.cpp | 29 +++++++++++++++++++++++++---- src/system/helpers.h | 5 +++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 9a140cf52..009dd1249 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -535,8 +535,7 @@ std::string& htmlEntityDecode(std::string& text) CFileHelpers::CFileHelpers() { - FileBufSize = 0xFFFF; - FileBuf = new char[FileBufSize]; + FileBufMaxSize = 0xFFFF; doCopyFlag = true; ConsoleQuiet = false; clearDebugInfo(); @@ -544,8 +543,21 @@ CFileHelpers::CFileHelpers() CFileHelpers::~CFileHelpers() { - if (FileBuf != NULL) - delete [] FileBuf; +} + +char* CFileHelpers::initFileBuf(char* buf, uint32_t size) +{ + if (buf == NULL) + buf = new char[size]; + return buf; +} + +char* CFileHelpers::deleteFileBuf(char* buf) +{ + if (buf != NULL) + delete [] buf; + buf = NULL; + return buf; } CFileHelpers* CFileHelpers::getInstance() @@ -743,10 +755,13 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* return false; } + char* FileBuf = NULL; uint32_t block; off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END); lseek64(fd1, 0, SEEK_SET); if (fsizeSrc64 > 0x7FFFFFF0) { // > 2GB + uint32_t FileBufSize = FileBufMaxSize; + FileBuf = initFileBuf(FileBuf, FileBufSize); off64_t fsize64 = fsizeSrc64; block = FileBufSize; //printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __FUNCTION__, fsizeSrc64, fsizeSrc64); @@ -765,12 +780,15 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* if (fsizeSrc64 != fsizeDst64){ close(fd1); close(fd2); + FileBuf = deleteFileBuf(FileBuf); return false; } } } else { // < 2GB off_t fsizeSrc = lseek(fd1, 0, SEEK_END); + uint32_t FileBufSize = (fsizeSrc < (off_t)FileBufMaxSize) ? fsizeSrc : FileBufMaxSize; + FileBuf = initFileBuf(FileBuf, FileBufSize); lseek(fd1, 0, SEEK_SET); off_t fsize = fsizeSrc; block = FileBufSize; @@ -790,6 +808,7 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* if (fsizeSrc != fsizeDst){ close(fd1); close(fd2); + FileBuf = deleteFileBuf(FileBuf); return false; } } @@ -800,9 +819,11 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/* if (!doCopyFlag) { sync(); unlink(Dst); + FileBuf = deleteFileBuf(FileBuf); return false; } + FileBuf = deleteFileBuf(FileBuf); return true; } diff --git a/src/system/helpers.h b/src/system/helpers.h index 1d56fe743..e9b860d04 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -84,10 +84,11 @@ struct helpersDebugInfo { class CFileHelpers { private: - unsigned long FileBufSize; - char *FileBuf; + uint32_t FileBufMaxSize; int fd1, fd2; + char* initFileBuf(char* buf, uint32_t size); + char* deleteFileBuf(char* buf); bool ConsoleQuiet; helpersDebugInfo DebugInfo; void setDebugInfo(const char* msg, const char* file, const char* func, int line); From 28a833a1f3821e93e7e6cdc7c31674dedeb06c55 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 6 Sep 2016 17:03:31 +0200 Subject: [PATCH 06/41] yWeb: allow screenshot page as start page Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/75639e6e698f540471dcc38d544e43514648ae80 Author: vanhofen Date: 2016-09-06 (Tue, 06 Sep 2016) Origin message was: ------------------ - yWeb: allow screenshot page as start page --- src/nhttpd/web/Y_Blocks.txt | 12 ++++++++++-- src/nhttpd/web/Y_Settings_yWeb.yhtm | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/nhttpd/web/Y_Blocks.txt b/src/nhttpd/web/Y_Blocks.txt index 6ecaa3aad..7f08329f7 100644 --- a/src/nhttpd/web/Y_Blocks.txt +++ b/src/nhttpd/web/Y_Blocks.txt @@ -374,6 +374,7 @@ function do_submit() + @@ -446,9 +447,16 @@ start-block~frame_boxcontrol ~ {=if-equal:{=var-get:startpage=}~control~Y_Tools_Boxcontrol.yhtm ~ - {=if-equal:{=var-get:startpage=}~remote~Y_Tools_Rcsim.yhtm~Y_NI_blank.yhtm=} + {=if-equal:{=var-get:startpage=}~remote~Y_Tools_Rcsim.yhtm + ~ + {=if-equal:{=var-get:startpage=}~screenshot~Y_Tools_Screenshot.yhtm?osd=1 + ~ + Y_NI_blank.yhtm + =} + =} =} - =}=} + =} +=} {=include-block:Y_Blocks.txt;frame_secondary=} end-block~frame_boxcontrol diff --git a/src/nhttpd/web/Y_Settings_yWeb.yhtm b/src/nhttpd/web/Y_Settings_yWeb.yhtm index 6f4c4b2af..864947720 100644 --- a/src/nhttpd/web/Y_Settings_yWeb.yhtm +++ b/src/nhttpd/web/Y_Settings_yWeb.yhtm @@ -48,11 +48,12 @@ function do_init(){ document.f.fb.selectedIndex = sel; obj_set_radio_value('screenshot_rc', "{=ini-get:/var/tuxbox/config/Y-Web.conf;screenshot_rc;false~cache=}"); val = "{=ini-get:/var/tuxbox/config/Y-Web.conf;start_page;bouquets~cache=}"; - var sel=3; + var sel=4; switch(val){ case "bouquets": sel=0; break; case "control": sel=1; break; case "remote": sel=2; break; + case "screenshot": sel=3; break; } document.f.start_page.selectedIndex = sel; style_old = "{=ini-get:/var/tuxbox/config/Y-Web.conf;style~cache=}"; @@ -171,6 +172,7 @@ select { + From 843d10dee7112a5f6deea1040ce95ce1fa2fc766 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 7 Sep 2016 17:45:49 +0200 Subject: [PATCH 07/41] fix CFileHelpers.copyFile() mode again; this time for real Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6098eb8e17137daf35f847a02820a16bcb476f19 Author: vanhofen Date: 2016-09-07 (Wed, 07 Sep 2016) Origin message was: ------------------ - fix CFileHelpers.copyFile() mode again; this time for real --- src/gui/epgview.cpp | 2 +- src/gui/infoviewer_bb.cpp | 2 +- src/gui/moviebrowser/mb.cpp | 2 +- src/gui/ni_menu.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 25c1cd57c..25d6d39b7 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1270,7 +1270,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start picname = imdb->getFilename(channel, epgData.eventID); CFileHelpers fh; - if (!fh.copyFile(imdb->posterfile.c_str(), picname.c_str(), 644)) + if (!fh.copyFile(imdb->posterfile.c_str(), picname.c_str(), 0644)) perror( "IMDb: error copy file" ); sleep(2); diff --git a/src/gui/infoviewer_bb.cpp b/src/gui/infoviewer_bb.cpp index 7ce4d64d8..e1fd9a59a 100644 --- a/src/gui/infoviewer_bb.cpp +++ b/src/gui/infoviewer_bb.cpp @@ -1084,7 +1084,7 @@ int CInfoViewerBB::check_ecmInfo() { int caid = 0; CFileHelpers fh; - if (fh.copyFile("/tmp/ecm.info", "/tmp/ecm.info.tmp", 644)) { + if (fh.copyFile("/tmp/ecm.info", "/tmp/ecm.info.tmp", 0644)) { g_InfoViewer->md5_ecmInfo = filehash((char *)"/tmp/ecm.info.tmp"); caid = parse_ecmInfo("/tmp/ecm.info.tmp"); } diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9b2212365..45ebafbc8 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -798,7 +798,7 @@ int CMovieBrowser::exec(CMenuTarget* parent, const std::string & actionKey) poster = m_movieSelectionHandler->file.Name.substr(0, pos); poster += ".jpg"; CFileHelpers fh; - if (fh.copyFile(imdb->posterfile.c_str(), poster.c_str(), 644)) + if (fh.copyFile(imdb->posterfile.c_str(), poster.c_str(), 0644)) printf("* poster: %s\n", poster.c_str()); else printf("* poster: copy error\n"); diff --git a/src/gui/ni_menu.cpp b/src/gui/ni_menu.cpp index b411dd47b..5e7d7e753 100644 --- a/src/gui/ni_menu.cpp +++ b/src/gui/ni_menu.cpp @@ -157,7 +157,7 @@ int CNIMenu::exec(CMenuTarget* parent, const std::string &actionkey) buffer=NULL; CFileHelpers fhlp; - if (fhlp.copyFile("/tmp/ecm.info", "/tmp/ecm.info.tmp", 644)) + if (fhlp.copyFile("/tmp/ecm.info", "/tmp/ecm.info.tmp", 0644)) { if ((fh = fopen("/tmp/ecm.info.tmp", "r"))) { From 418d68a592e803fd535d095aaf45491496dffbf9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 7 Sep 2016 18:05:01 +0200 Subject: [PATCH 08/41] src/gui/lua/lua_filehelpers.cpp fix possible segfault if string argument is not a string (nil) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6aab8c6d120e85546f919e901aa4511f7f51b9a3 Author: Jacek Jendrzej Date: 2016-09-07 (Wed, 07 Sep 2016) --- src/gui/lua/lua_filehelpers.cpp | 102 +++++++++++++++++++------------- 1 file changed, 62 insertions(+), 40 deletions(-) diff --git a/src/gui/lua/lua_filehelpers.cpp b/src/gui/lua/lua_filehelpers.cpp index c8d1cd252..c874087ac 100644 --- a/src/gui/lua/lua_filehelpers.cpp +++ b/src/gui/lua/lua_filehelpers.cpp @@ -93,26 +93,23 @@ int CLuaInstFileHelpers::FileHelpersCp(lua_State *L) return 1; } - if (!lua_isstring(L, 2)) { - printf("luascript cp: argument 1 is not a string.\n"); + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); lua_pushboolean(L, false); return 1; } - const char *from = ""; - from = luaL_checkstring(L, 2); - - if (!lua_isstring(L, 3)) { - printf("luascript cp: argument 2 is not a string.\n"); - lua_pushboolean(L, false); - return 1; - } - const char *to = ""; - to = luaL_checkstring(L, 3); + const char *from = luaL_checkstring(L, 2); + const char *to = luaL_checkstring(L, 3); const char *flags = ""; - if (numargs > min_numargs) + if (numargs > min_numargs){ + if (!lua_isstring(L, 4)) { + printf("%s: argument 3 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } flags = luaL_checkstring(L, 4); - + } bool ret = false; CFileHelpers fh; fh.setConsoleQuiet(true); @@ -143,9 +140,12 @@ int CLuaInstFileHelpers::FileHelpersChmod(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *file = ""; - file = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *file = luaL_checkstring(L, 2); int mode_i = luaL_checkint(L, 3); /* Hack for convert lua number to octal */ @@ -180,9 +180,12 @@ int CLuaInstFileHelpers::FileHelpersTouch(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *file = ""; - file = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *file = luaL_checkstring(L, 2); bool ret = true; lua_Debug ar; @@ -242,9 +245,12 @@ int CLuaInstFileHelpers::FileHelpersRmdir(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *dir = ""; - dir = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *dir = luaL_checkstring(L, 2); bool ret = false; CFileHelpers* fh = CFileHelpers::getInstance(); @@ -276,9 +282,12 @@ int CLuaInstFileHelpers::FileHelpersMkdir(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *dir = ""; - dir = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *dir = luaL_checkstring(L, 2); mode_t mode = 0755; if (numargs > min_numargs) { @@ -319,9 +328,12 @@ int CLuaInstFileHelpers::FileHelpersReadlink(lua_State *L) lua_pushnil(L); return 1; } - - const char *link = ""; - link = luaL_checkstring(L, 2); + if (!lua_isstring(L, 2)) { + printf("%s: argument 1 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *link = luaL_checkstring(L, 2); char buf[PATH_MAX]; memset(buf, '\0', sizeof(buf)); @@ -353,16 +365,23 @@ int CLuaInstFileHelpers::FileHelpersLn(lua_State *L) lua_pushboolean(L, false); return 1; } - - const char *src = ""; - src = luaL_checkstring(L, 2); - const char *link = ""; - link = luaL_checkstring(L, 3); + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } + const char *src = luaL_checkstring(L, 2); + const char *link = luaL_checkstring(L, 3); const char *flags = ""; - if (numargs > min_numargs) + if (numargs > min_numargs){ + if (!lua_isstring(L, 4)) { + printf("%s: argument 3 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } flags = luaL_checkstring(L, 4); - + } bool symlnk = (strchr(flags, 's') != NULL); bool force = (strchr(flags, 'f') != NULL); lua_Debug ar; @@ -413,15 +432,18 @@ int CLuaInstFileHelpers::FileHelpersExist(lua_State *L) return 1; } + if (!lua_isstring(L, 2) || !lua_isstring(L, 3)) { + printf("%s: argument 1 or 2 is not a string.\n",__func__); + lua_pushboolean(L, false); + return 1; + } bool ret = false; bool err = false; int errLine = 0; std::string errMsg = ""; - const char *file = ""; - file = luaL_checkstring(L, 2); - const char *flag = ""; - flag = luaL_checkstring(L, 3); + const char *file = luaL_checkstring(L, 2); + const char *flag = luaL_checkstring(L, 3); if (file_exists(file)) { struct stat FileInfo; From 442d5b414d1f2806d0a66518095ea1721c8a1a42 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 7 Sep 2016 18:30:03 +0200 Subject: [PATCH 09/41] fix compil error: redundant redeclaration of 'void strReplace' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f101655e1959d7fe9d18a6f5281fbc039a9c24e1 Author: Jacek Jendrzej Date: 2016-09-07 (Wed, 07 Sep 2016) --- src/gui/moviebrowser/mb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.h b/src/gui/moviebrowser/mb.h index 512a165ff..37c2e5b09 100644 --- a/src/gui/moviebrowser/mb.h +++ b/src/gui/moviebrowser/mb.h @@ -91,7 +91,7 @@ /* percent */ #define MIN_BROWSER_FRAME_HEIGHT 10 #define MAX_BROWSER_FRAME_HEIGHT 80 -void strReplace(std::string& orig, const char* fstr, const std::string &rstr); +// void strReplace(std::string& orig, const char* fstr, const std::string &rstr); From 74a6ac120f3e77439a1b1bb442a25eb8826a88b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 8 Sep 2016 00:09:52 +0200 Subject: [PATCH 10/41] lua: add pin-input; set lua api version to 1.58 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/80d1e9b6cfee78b956f3f900f19b8c15eef01828 Author: vanhofen Date: 2016-09-08 (Thu, 08 Sep 2016) Origin message was: ------------------ - lua: add pin-input; set lua api version to 1.58 --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_stringinput.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 86e7fdc8a..8688d8b3e 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 57 +#define LUA_API_VERSION_MINOR 58 diff --git a/src/gui/lua/lua_stringinput.cpp b/src/gui/lua/lua_stringinput.cpp index e61264b50..90e3023ed 100644 --- a/src/gui/lua/lua_stringinput.cpp +++ b/src/gui/lua/lua_stringinput.cpp @@ -90,8 +90,17 @@ int CLuaInstStringInput::StringInputExec(lua_State *L) lua_Integer sms = 0; tableLookup(L, "sms", sms); + lua_Integer pin = 0; + tableLookup(L, "pin", pin); + + if (sms && pin) + dprintf(DEBUG_NORMAL, "[CLuaInstance][%s - %d]: 'sms' AND 'pin' is defined! 'pin' will be prefered.\n", __func__, __LINE__); + CStringInput *i; - if (sms) + if (pin) + i = new CPINInput(name, &value, size, + NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL); + else if (sms) i = new CStringInputSMS(name, &value, size, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, valid_chars.c_str(), NULL, icon.c_str()); else From 48f698f3726e8467f529537d3f3ee31213b68db7 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Thu, 8 Sep 2016 08:42:41 +0200 Subject: [PATCH 11/41] Activate warnings for deprecated functions in CLuaInstMisc & CLuaInstVideo - Set Lua api version to 1.59 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b1ab3e229092ac9a402c40cdca8d51c15c4c1b38 Author: Michael Liebmann Date: 2016-09-08 (Thu, 08 Sep 2016) --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_misc.cpp | 3 +-- src/gui/lua/lua_video.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 8688d8b3e..2de684548 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 58 +#define LUA_API_VERSION_MINOR 59 diff --git a/src/gui/lua/lua_misc.cpp b/src/gui/lua/lua_misc.cpp index c732c7d6d..9b965ae5d 100644 --- a/src/gui/lua/lua_misc.cpp +++ b/src/gui/lua/lua_misc.cpp @@ -367,8 +367,7 @@ int CLuaInstMisc::MiscDelete(lua_State *L) deprecated functions --------------------------------------------------------------- */ -//#define MISC_FUNC_DEPRECATED miscFunctionDeprecated -#define MISC_FUNC_DEPRECATED(...) +#define MISC_FUNC_DEPRECATED miscFunctionDeprecated void CLuaInstMisc::miscFunctionDeprecated(lua_State *L, std::string oldFunc) { diff --git a/src/gui/lua/lua_video.cpp b/src/gui/lua/lua_video.cpp index fd25aeda2..dfef5c7e5 100644 --- a/src/gui/lua/lua_video.cpp +++ b/src/gui/lua/lua_video.cpp @@ -352,8 +352,7 @@ int CLuaInstVideo::VideoDelete(lua_State *L) deprecated functions --------------------------------------------------------------- */ -//#define VIDEO_FUNC_DEPRECATED videoFunctionDeprecated -#define VIDEO_FUNC_DEPRECATED(...) +#define VIDEO_FUNC_DEPRECATED videoFunctionDeprecated void CLuaInstVideo::videoFunctionDeprecated(lua_State *L, std::string oldFunc) { From fa2686a90e7fb997e992efb19637a1ac5f6e5c07 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 10:42:46 +0200 Subject: [PATCH 12/41] add listModeKey() function to simplify these calls Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2911e638c73c265275be81b2eb678982dc2cf776 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - add listModeKey() function to simplify these calls --- src/driver/rcinput.cpp | 3 ++- src/gui/bedit/bouqueteditor_bouquets.cpp | 5 +++-- src/gui/bedit/bouqueteditor_channels.cpp | 4 +++- src/gui/buildinfo.cpp | 2 +- src/gui/channellist.cpp | 6 ++++-- src/gui/dboxinfo.cpp | 2 +- src/gui/epgplus.cpp | 2 +- src/gui/epgview.cpp | 17 ++++++++--------- src/gui/eventlist.cpp | 5 +++-- src/gui/imageinfo.cpp | 2 +- src/gui/infoviewer.cpp | 2 +- src/gui/lua/lua_hintbox.cpp | 3 ++- src/gui/moviebrowser/mb.cpp | 4 ++-- src/gui/movieplayer.cpp | 4 ++-- src/gui/pictureviewer.cpp | 3 ++- src/gui/screensetup.cpp | 11 +++++------ src/gui/streaminfo2.cpp | 2 +- src/gui/timerlist.cpp | 3 +-- src/gui/widget/colorchooser.cpp | 12 +++++------- src/gui/widget/hintbox.cpp | 3 ++- src/gui/widget/keyboard_input.cpp | 3 ++- src/gui/widget/listbox.cpp | 4 ++-- src/gui/widget/menue.cpp | 12 +++++------- src/gui/widget/messagebox.cpp | 3 ++- src/gui/widget/msgbox.cpp | 3 ++- src/gui/widget/stringinput.cpp | 3 ++- src/gui/widget/stringinput_ext.cpp | 4 ++-- src/neutrino.cpp | 13 ++++++++++++- src/neutrino.h | 1 + 29 files changed, 80 insertions(+), 61 deletions(-) diff --git a/src/driver/rcinput.cpp b/src/driver/rcinput.cpp index 65856a9fe..16095b2cd 100644 --- a/src/driver/rcinput.cpp +++ b/src/driver/rcinput.cpp @@ -318,7 +318,8 @@ int CRCInput::messageLoop( bool anyKeyCancels, int timeout ) ( msg == CRCInput::RC_home ) || ( msg == CRCInput::RC_ok ) ) doLoop = false; - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 8326163df..821c1ae3a 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -366,12 +366,13 @@ int CBEBouquetWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveBouquet(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + // do nothing } else { CNeutrinoApp::getInstance()->handleMsg( msg, data ); - // kein canceling... } } hide(); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 88ae91ab2..bce6cc269 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -447,7 +447,9 @@ int CBEChannelWidget::exec(CMenuTarget* parent, const std::string & /*actionKey* cancelMoveChannel(); } } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + // do nothing } else { diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index ca8a31e6d..aab25e95f 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -82,7 +82,7 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 0fcb5da92..23c169e48 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -709,8 +709,9 @@ int CChannelList::show() loop = false; } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { if (!edit_state) { + //FIXME: what about LIST_MODE_WEBTV? int newmode = msg == CRCInput::RC_sat ? LIST_MODE_SAT : LIST_MODE_FAV; CNeutrinoApp::getInstance()->SetChannelMode(newmode); res = CHANLIST_CHANGE_MODE; @@ -1318,7 +1319,8 @@ int CChannelList::numericZap(int key) doZap = true; break; } - else if (msg == CRCInput::RC_favorites || msg == CRCInput::RC_sat || msg == CRCInput::RC_www || msg == CRCInput::RC_right) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg) || msg == CRCInput::RC_right) { + // do nothing } else if (CRCInput::isNumeric(msg)) { if (pos == 4) { diff --git a/src/gui/dboxinfo.cpp b/src/gui/dboxinfo.cpp index d9351a9c3..403220faf 100644 --- a/src/gui/dboxinfo.cpp +++ b/src/gui/dboxinfo.cpp @@ -138,7 +138,7 @@ int CDBoxInfoWidget::exec(CMenuTarget* parent, const std::string &) res = menu_return::RETURN_EXIT_ALL; doLoop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if(CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; doLoop = false; diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index c3d9981fa..3c6fa0828 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1132,7 +1132,7 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu } } } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c3878ed7b..ce034413a 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1259,14 +1259,6 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } else loop = false; break; - case CRCInput::RC_favorites: - case CRCInput::RC_sat: - case CRCInput::RC_www: - if( !call_fromfollowlist){ - g_RCInput->postMsg (msg, 0); - loop = false; - } - break; default: if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) { if(fader.StartFadeOut()) { @@ -1274,7 +1266,14 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start msg = 0; } else loop = false; - } else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { + } + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + if (!call_fromfollowlist) { + g_RCInput->postMsg (msg, 0); + loop = false; + } + } + else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { g_RCInput->postMsg(msg, data); loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 38e2d9662..dfa836f53 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -652,11 +652,12 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna in_search = findEvents(channel_id, channelname); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; loop = false; - } else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { + } + else if (msg == NeutrinoMessages::EVT_SERVICESCHANGED || msg == NeutrinoMessages::EVT_BOUQUETSCHANGED) { g_RCInput->postMsg(msg, data); loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index a8b871128..a5637052c 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -151,7 +151,7 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) btn_red->kill(); btn_red->paint(false); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index 372710cde..e65128d75 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -1025,7 +1025,7 @@ void CInfoViewer::loop(bool show_dot) if (msg == (neutrino_msg_t) g_settings.key_screenshot) { res = CNeutrinoApp::getInstance()->handleMsg(msg, data); - } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = messages_return::cancel_info; } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { diff --git a/src/gui/lua/lua_hintbox.cpp b/src/gui/lua/lua_hintbox.cpp index 4cee2bbbb..cfa25f203 100644 --- a/src/gui/lua/lua_hintbox.cpp +++ b/src/gui/lua/lua_hintbox.cpp @@ -154,7 +154,8 @@ int CLuaInstHintbox::HintboxExec(lua_State *L) D->b->scroll_up(); else D->b->scroll_down(); - } else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == CRCInput::RC_mode) { break; } else if ((msg == CRCInput::RC_next) || (msg == CRCInput::RC_prev)) { diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index ea1319fea..2648480a3 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -990,8 +990,8 @@ int CMovieBrowser::exec(const char* path) { loop = false; } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { - //FIXME do nothing ? + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == NeutrinoMessages::STANDBY_ON || msg == NeutrinoMessages::LEAVE_ALL || diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index ad2f7d611..1f878adcb 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1585,8 +1585,8 @@ void CMoviePlayerGui::PlayFileLoop(void) } else if (msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { if (playstate == CMoviePlayerGui::PLAY && (position >= 300000 || (duration < 300000 && (position > (duration /2))))) makeScreenShot(true); - } else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { - //FIXME do nothing ? + } else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (msg == (neutrino_msg_t) CRCInput::RC_setup) { CNeutrinoApp::getInstance()->handleMsg(NeutrinoMessages::SHOW_MAINMENU, 0); } else if (msg == CRCInput::RC_red || msg == CRCInput::RC_green || msg == CRCInput::RC_yellow || msg == CRCInput::RC_blue ) { diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 3f776af5e..d6a102770 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -632,7 +632,8 @@ int CPictureViewerGui::show() loop = false; g_RCInput->postMsg(msg, data); } - else if ((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/screensetup.cpp b/src/gui/screensetup.cpp index 1906518ee..9b446f0cd 100644 --- a/src/gui/screensetup.cpp +++ b/src/gui/screensetup.cpp @@ -209,13 +209,12 @@ int CScreenSetup::exec(CMenuTarget* parent, const std::string &) } break; } - case CRCInput::RC_favorites: - case CRCInput::RC_sat: - case CRCInput::RC_www: - break; - default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + break; + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/streaminfo2.cpp b/src/gui/streaminfo2.cpp index 0856435e0..586fdcfd5 100644 --- a/src/gui/streaminfo2.cpp +++ b/src/gui/streaminfo2.cpp @@ -238,7 +238,7 @@ int CStreamInfo2::doSignalStrengthLoop () res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if(CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ec9cb5085..8af61afe6 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -623,9 +623,8 @@ int CTimerList::show() paint(); } } - // help key } - else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 92634eece..a1eef250c 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -229,18 +229,16 @@ int CColorChooser::exec(CMenuTarget* parent, const std::string &) *value[VALUE_ALPHA] = a_alt; loop = false; break; - - case CRCInput::RC_sat: - case CRCInput::RC_favorites: - case CRCInput::RC_www: - break; case CRCInput::RC_timeout: case CRCInput::RC_ok: loop = false; break; - default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) + if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + break; + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { loop = false; res = menu_return::RETURN_EXIT_ALL; diff --git a/src/gui/widget/hintbox.cpp b/src/gui/widget/hintbox.cpp index 0f547dfe5..355efb877 100644 --- a/src/gui/widget/hintbox.cpp +++ b/src/gui/widget/hintbox.cpp @@ -290,7 +290,8 @@ int ShowHint(const char * const Caption, const char * const Text, const int Widt else hintBox->scroll_down(); } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if(msg == CRCInput::RC_mode) { res = messages_return::handled; diff --git a/src/gui/widget/keyboard_input.cpp b/src/gui/widget/keyboard_input.cpp index 4d459fefe..297e4e61b 100644 --- a/src/gui/widget/keyboard_input.cpp +++ b/src/gui/widget/keyboard_input.cpp @@ -610,8 +610,9 @@ int CKeyboardInput::exec(CMenuTarget* parent, const std::string &) loop = false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/widget/listbox.cpp b/src/gui/widget/listbox.cpp index 0ddf8d791..2dc01062f 100644 --- a/src/gui/widget/listbox.cpp +++ b/src/gui/widget/listbox.cpp @@ -223,13 +223,13 @@ int CListBox::exec(CMenuTarget* parent, const std::string & /*actionKey*/) { onBlueKeyPressed(); } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { CNeutrinoApp::getInstance()->handleMsg( msg, data ); - // kein canceling... } } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 21af5cd46..3a74dcbd9 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -966,13 +966,8 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) break; case (CRCInput::RC_timeout): break; - - case (CRCInput::RC_sat): - case (CRCInput::RC_favorites): - case (CRCInput::RC_www): - g_RCInput->postMsg (msg, 0); - //close any menue on dbox-key case (CRCInput::RC_setup): + //close any menu on menu-key { msg = CRCInput::RC_timeout; retval = menu_return::RETURN_EXIT_ALL; @@ -989,7 +984,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &) break; default: - if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { + if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + g_RCInput->postMsg (msg, 0); + } + else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { retval = menu_return::RETURN_EXIT_ALL; msg = CRCInput::RC_timeout; } diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index f7e497846..7140d7569 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -273,8 +273,9 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg) || (msg == CRCInput::RC_spkr)) { + // do nothing } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index 503e79233..6e0067e4f 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -730,8 +730,9 @@ int CMsgBox::exec( int timeout, int returnDefaultOnTimeout) { loop = false; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all) { diff --git a/src/gui/widget/stringinput.cpp b/src/gui/widget/stringinput.cpp index 4651d33d1..e776e1b6e 100644 --- a/src/gui/widget/stringinput.cpp +++ b/src/gui/widget/stringinput.cpp @@ -494,8 +494,9 @@ int CStringInput::exec( CMenuTarget* parent, const std::string & ) loop=false; res = menu_return::RETURN_EXIT_REPAINT; } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else { diff --git a/src/gui/widget/stringinput_ext.cpp b/src/gui/widget/stringinput_ext.cpp index d95d07681..2d04e833b 100644 --- a/src/gui/widget/stringinput_ext.cpp +++ b/src/gui/widget/stringinput_ext.cpp @@ -251,14 +251,14 @@ int CExtendedInput::exec( CMenuTarget* parent, const std::string & ) timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]); } } else { - //keine änderungen - beenden ok loop=false; if(cancel != NULL) *cancel = true; } } - else if ((msg ==CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www)) + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { + // do nothing } else if ( CNeutrinoApp::getInstance()->handleMsg( msg, data ) & messages_return::cancel_all ) { diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b185cd004..31dc68ce0 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -2765,6 +2765,17 @@ void CNeutrinoApp::lockPlayBack(bool blank) videoDecoder->setBlank(true); } +bool CNeutrinoApp::listModeKey(const neutrino_msg_t msg) +{ + if ( + msg == CRCInput::RC_sat + || msg == CRCInput::RC_favorites + || msg == CRCInput::RC_www + ) + return true; + return false; +} + int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) { int res = 0; @@ -2854,7 +2865,7 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t _msg, neutrino_msg_data_t data) } /* ================================== KEYS ================================================ */ - if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites || msg == CRCInput::RC_www))) { + if( msg == CRCInput::RC_ok || (!g_InfoViewer->getSwitchMode() && CNeutrinoApp::getInstance()->listModeKey(msg))) { if( (mode == mode_tv) || (mode == mode_radio) || (mode == mode_ts) || (mode == mode_webtv)) { showChannelList(msg); return messages_return::handled; diff --git a/src/neutrino.h b/src/neutrino.h index 61f616bfd..151aadd2b 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -189,6 +189,7 @@ public: // //onchange bool changeNotify(const neutrino_locale_t OptionName, void *); + bool listModeKey(const neutrino_msg_t msg); int handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data); int getMode() { From 509d918b3e340dc54f0cf8a675f81f180ac276b6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 10:46:12 +0200 Subject: [PATCH 13/41] adapt listModeKey() function to our code Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9c2cb63adbf6bdc6ff5931782bbea60a8819261e Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - adapt listModeKey() function to our code --- src/gui/hdd_info.cpp | 4 +++- src/gui/imageinfo_ni.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/hdd_info.cpp b/src/gui/hdd_info.cpp index f8feafe1d..ad6bfb4ea 100644 --- a/src/gui/hdd_info.cpp +++ b/src/gui/hdd_info.cpp @@ -128,7 +128,9 @@ int CHDDInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey) } else doLoop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) + { + // do nothing } else { diff --git a/src/gui/imageinfo_ni.cpp b/src/gui/imageinfo_ni.cpp index 36fe29a22..f5769a66b 100644 --- a/src/gui/imageinfo_ni.cpp +++ b/src/gui/imageinfo_ni.cpp @@ -165,7 +165,7 @@ int CImageInfoNI::exec(CMenuTarget* parent, const std::string &) res = menu_return::RETURN_EXIT_ALL; break; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites)) { + else if (CNeutrinoApp::getInstance()->listModeKey(msg)) { g_RCInput->postMsg (msg, 0); res = menu_return::RETURN_EXIT_ALL; break; From 17c74200f718f07a7a8f36dbf03ace2abd5843f3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:42:14 +0200 Subject: [PATCH 14/41] movieinfo: internally rename epgMode -> mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/93d882dc96a8c6afccff672e38c257d9c71e6f48 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgMode -> mode --- src/driver/record.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 0c36af20e..fc334c252 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -619,7 +619,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; - recMovieInfo->epgMode = g_Zapit->getMode(); + recMovieInfo->mode = g_Zapit->getMode(); recMovieInfo->epgVideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index b29fb74cb..01e576a03 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -112,7 +112,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); // %d + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { @@ -297,7 +297,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->epgMode) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) @@ -516,7 +516,7 @@ void MI_MOVIE_INFO::clear(void) epgId = 0; epgEpgId = 0; - epgMode = 0; + mode = 0; epgVideoPid = 0; VideoType = 0; epgVTXPID = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index eaa943d66..ab30bcb20 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -139,7 +139,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed - int epgMode; // currently not used, we just do not want to loose this info if movie info is saved backed + int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed From c1d73f292a4a977e4e54a1df79bd1727cac25974 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:45:07 +0200 Subject: [PATCH 15/41] movieinfo: internally rename epgVideoPid -> VideoPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0fa9e392affd9327da5e38abaf85fe51c308a530 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgVideoPid -> VideoPid --- src/driver/record.cpp | 6 +++--- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index fc334c252..91ab07c7a 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -620,7 +620,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; recMovieInfo->mode = g_Zapit->getMode(); - recMovieInfo->epgVideoPid = allpids.PIDs.vpid; + recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; EPG_AUDIO_PIDS audio_pids; @@ -2015,10 +2015,10 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.epgAudioPid, desc.c_str()); } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { - recMovieInfo->epgVideoPid = st->id; + recMovieInfo->VideoPid = st->id; if (codec->codec_id == AV_CODEC_ID_H264) recMovieInfo->VideoType = 1; - printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->epgVideoPid); + printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->VideoPid); } } } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 01e576a03..4c3e6623c 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -113,7 +113,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->VideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { *extMessage += "\t\t<" MI_XML_TAG_AUDIOPIDS ">\n"; @@ -298,7 +298,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID) @@ -517,7 +517,7 @@ void MI_MOVIE_INFO::clear(void) epgId = 0; epgEpgId = 0; mode = 0; - epgVideoPid = 0; + VideoPid = 0; VideoType = 0; epgVTXPID = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index ab30bcb20..899b9b87a 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -140,7 +140,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed int mode; // record mode (0: unknown; 1: tv record; 2: radio record) - int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed + int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 3e6e2278d..aa09eca02 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -415,7 +415,7 @@ void CMoviePlayerGui::fillPids() if (p_movie_info == NULL) return; - vpid = p_movie_info->epgVideoPid; + vpid = p_movie_info->VideoPid; vtype = p_movie_info->VideoType; numpida = 0; currentapid = 0; /* FIXME: better way to detect TS recording */ From ce05cd6d818efde22232f3edbd0d479e9731fc68 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:50:18 +0200 Subject: [PATCH 16/41] movieinfo: internally rename epgVTXPID -> VtxtPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6d3bf561583482140bf2d9530144d92f880b9671 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgVTXPID -> VtxtPid --- src/driver/record.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 91ab07c7a..9a86a6b14 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -645,7 +645,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis audio_pids.selected = 1; recMovieInfo->audioPids.push_back(audio_pids); } - recMovieInfo->epgVTXPID = allpids.PIDs.vtxtpid; + recMovieInfo->VtxtPid = allpids.PIDs.vtxtpid; } record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 4c3e6623c..e300b2112 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -132,7 +132,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo } *extMessage += "\t\t\n"; } - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->VtxtPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor); @@ -301,7 +301,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->VtxtPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_SERIE_NAME, movie_info->serieName) @@ -519,7 +519,7 @@ void MI_MOVIE_INFO::clear(void) mode = 0; VideoPid = 0; VideoType = 0; - epgVTXPID = 0; + VtxtPid = 0; audioPids.clear(); diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 899b9b87a..71a78ca17 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -142,7 +142,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; - int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed + int VtxtPid; // currently not used, we just do not want to loose this info if movie info is saved backed bool marked; bool delAsk; From d0882070ed2d14064f2284b846ea7be1b976567f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:58:11 +0200 Subject: [PATCH 17/41] movieinfo: internally rename epgAudioPid -> AudioPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6fe2d04e1e6e55954a4a80229066f8f51e5a29b2 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgAudioPid -> AudioPid --- src/driver/record.cpp | 32 ++++++++++++++++---------------- src/gui/epgview.cpp | 2 +- src/gui/movieinfo.cpp | 18 +++++++++--------- src/gui/movieinfo.h | 8 ++++---- src/gui/movieplayer.cpp | 12 ++++++------ 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 9a86a6b14..b142eaa3c 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -178,11 +178,11 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } } for (unsigned int i = 0; i < recMovieInfo->audioPids.size(); i++) { - apids[numpids++] = recMovieInfo->audioPids[i].epgAudioPid; + apids[numpids++] = recMovieInfo->audioPids[i].AudioPid; if(channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3){ - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); }else - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); if (numpids >= REC_MAX_APIDS) break; @@ -339,10 +339,10 @@ bool CRecordInstance::Update() record->AddPid(it->apid); for(unsigned int i = 0; i < allpids.APIDs.size(); i++) { if(allpids.APIDs[i].pid == it->apid) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 0; recMovieInfo->audioPids.push_back(audio_pids); @@ -623,15 +623,15 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; APIDList::iterator it; for(unsigned int i= 0; i< allpids.APIDs.size(); i++) { for(it = apid_list.begin(); it != apid_list.end(); ++it) { if(allpids.APIDs[i].pid == it->apid) { - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; - audio_pids.selected = (audio_pids.epgAudioPid == channel->getAudioPid()) ? 1 : 0; + audio_pids.selected = (audio_pids.AudioPid == channel->getAudioPid()) ? 1 : 0; recMovieInfo->audioPids.push_back(audio_pids); } } @@ -639,8 +639,8 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis /* FIXME sometimes no apid in xml ?? */ if(recMovieInfo->audioPids.empty() && !allpids.APIDs.empty()) { int i = 0; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 1; recMovieInfo->audioPids.push_back(audio_pids); @@ -1979,7 +1979,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li AVStream *st = ofcx->streams[i]; AVCodecContext * codec = st->codec; if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); AVDictionaryEntry *title = av_dict_get(st->metadata, "title", NULL, 0); @@ -2009,10 +2009,10 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li } audio_pids.selected = 0; - audio_pids.epgAudioPidName = desc; - audio_pids.epgAudioPid = st->id; + audio_pids.AudioPidName = desc; + audio_pids.AudioPid = st->id; recMovieInfo->audioPids.push_back(audio_pids); - printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.epgAudioPid, desc.c_str()); + printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.AudioPid, desc.c_str()); } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { recMovieInfo->VideoPid = st->id; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index f0b129675..fc49c8836 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -634,7 +634,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool { if (i) extMovieInfo += ", "; - extMovieInfo += mp_movie_info->audioPids[i].epgAudioPidName; + extMovieInfo += mp_movie_info->audioPids[i].AudioPidName; } extMovieInfo += "\n"; } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index e300b2112..197d79223 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -121,13 +121,13 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo for (unsigned int i = 0; i < movie_info->audioPids.size(); i++) // pids.APIDs.size() { *extMessage += "\t\t\t<" MI_XML_TAG_AUDIO " " MI_XML_TAG_PID "=\""; - *extMessage += to_string(movie_info->audioPids[i].epgAudioPid); + *extMessage += to_string(movie_info->audioPids[i].AudioPid); *extMessage += "\" " MI_XML_TAG_ATYPE "=\""; *extMessage += to_string(movie_info->audioPids[i].atype); *extMessage += "\" " MI_XML_TAG_SELECTED "=\""; *extMessage += to_string(movie_info->audioPids[i].selected); *extMessage += "\" " MI_XML_TAG_NAME "=\""; - *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].epgAudioPidName.c_str()); + *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].AudioPidName.c_str()); *extMessage += "\"/>\n"; } *extMessage += "\t\t\n"; @@ -287,7 +287,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) int pos = 0; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; while ((pos = find_next_char('<', text, pos, bytes)) != -1) { pos++; @@ -334,9 +334,9 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) while (text[pos + pos2] != '\"' && text[pos + pos2] != 0 && text[pos + pos2] != '/') pos2++; if (text[pos + pos2] == '\"') - audio_pids.epgAudioPid = atoi(&text[pos + pos2 + 1]); + audio_pids.AudioPid = atoi(&text[pos + pos2 + 1]); } else - audio_pids.epgAudioPid = 0; + audio_pids.AudioPid = 0; audio_pids.atype = 0; pos2 = -1; @@ -366,7 +366,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) audio_pids.selected = atoi(&text[pos + pos2 + 1]); } - audio_pids.epgAudioPidName = ""; + audio_pids.AudioPidName = ""; //pos2 = strcspn(&text[pos],MI_XML_TAG_NAME); pos2 = -1; ptr = strstr(&text[pos], MI_XML_TAG_NAME); @@ -382,12 +382,12 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) pos3++; if (text[pos + pos3] == '\"') { - audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - audio_pids.epgAudioPidName = htmlEntityDecode(audio_pids.epgAudioPidName); + audio_pids.AudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); + audio_pids.AudioPidName = htmlEntityDecode(audio_pids.AudioPidName); } } } - //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.epgAudioPid, audio_pids.atype, audio_pids.epgAudioPidName.c_str(), audio_pids.selected); + //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.AudioPid, audio_pids.atype, audio_pids.AudioPidName.c_str(), audio_pids.selected); movie_info->audioPids.push_back(audio_pids); } /* parse bookmarks */ diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 71a78ca17..6052b6fe4 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -108,9 +108,9 @@ typedef struct { int atype; int selected; - int epgAudioPid; // epg audio pid nr, usually filled by VCR - std::string epgAudioPidName; // epg audio pid name, usually filled by VCR -} EPG_AUDIO_PIDS; + int AudioPid; // audio pid nr, usually filled by VCR + std::string AudioPidName; // audio pid name, usually filled by VCR +} AUDIO_PIDS; class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); { @@ -135,7 +135,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); //char format; // currently not used //char audio; // currently not used MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie - std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] + std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index aa09eca02..f6a93bcc1 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -420,18 +420,18 @@ void CMoviePlayerGui::fillPids() numpida = 0; currentapid = 0; /* FIXME: better way to detect TS recording */ if (!p_movie_info->audioPids.empty()) { - currentapid = p_movie_info->audioPids[0].epgAudioPid; + currentapid = p_movie_info->audioPids[0].AudioPid; currentac3 = p_movie_info->audioPids[0].atype; } else if (!vpid) { is_file_player = true; return; } for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - apids[i] = p_movie_info->audioPids[i].epgAudioPid; + apids[i] = p_movie_info->audioPids[i].AudioPid; ac3flags[i] = p_movie_info->audioPids[i].atype; numpida++; if (p_movie_info->audioPids[i].selected) { - currentapid = p_movie_info->audioPids[i].epgAudioPid; + currentapid = p_movie_info->audioPids[i].AudioPid; currentac3 = p_movie_info->audioPids[i].atype; } } @@ -1748,8 +1748,8 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) return false; for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - if (p_movie_info->audioPids[i].epgAudioPid == apid && !p_movie_info->audioPids[i].epgAudioPidName.empty()) { - apidtitle = p_movie_info->audioPids[i].epgAudioPidName; + if (p_movie_info->audioPids[i].AudioPid == apid && !p_movie_info->audioPids[i].AudioPidName.empty()) { + apidtitle = p_movie_info->audioPids[i].AudioPidName; return true; } } @@ -1879,7 +1879,7 @@ void CMoviePlayerGui::selectAudioPid() CVolume::getInstance()->SetCurrentPid(currentapid); for (uint i=0; i < numpida; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); - APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].epgAudioPidName, + APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].AudioPidName, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance())); } From 599c6608fa9d151498bc3c1a0fbebb5e44b0e5b2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 19:33:04 +0200 Subject: [PATCH 18/41] movieinfo: internally rename epgChannel -> ChannelName Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/dbcbf065609bf29b7e8f5d42dc4932eb78560ad6 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgChannel -> ChannelName --- src/driver/record.cpp | 4 ++-- src/gui/epgview.cpp | 4 ++-- src/gui/lcd4l.cpp | 6 +++--- src/gui/moviebrowser/mb.cpp | 12 ++++++------ src/gui/moviebrowser/mb_functions.h | 4 ++-- src/gui/movieinfo.cpp | 8 ++++---- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 4 ++-- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index b142eaa3c..34ec91f2c 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -574,9 +574,9 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis std::string tmpstring = channel->getName(); if (tmpstring.empty()) - recMovieInfo->epgChannel = "unknown"; + recMovieInfo->channelName = "unknown"; else - recMovieInfo->epgChannel = tmpstring; + recMovieInfo->channelName = tmpstring; tmpstring = "not available"; if (epgid != 0) { diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index fc49c8836..143a9d9d3 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -592,12 +592,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool extMovieInfo += mp_movie_info->serieName; extMovieInfo += "\n"; } - if (!mp_movie_info->epgChannel.empty()) + if (!mp_movie_info->channelName.empty()) { extMovieInfo += "\n"; extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); extMovieInfo += ": "; - extMovieInfo += mp_movie_info->epgChannel; + extMovieInfo += mp_movie_info->channelName; extMovieInfo += "\n"; } if (mp_movie_info->rating != 0) diff --git a/src/gui/lcd4l.cpp b/src/gui/lcd4l.cpp index 51b93f1c4..d16916ba6 100644 --- a/src/gui/lcd4l.cpp +++ b/src/gui/lcd4l.cpp @@ -498,8 +498,8 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) Service = g_Locale->getText(LOCALE_RECORDINGMENU_TIMESHIFT); else if (CMoviePlayerGui::getInstance().p_movie_info) { - if (!CMoviePlayerGui::getInstance().p_movie_info->epgChannel.empty()) - Service = CMoviePlayerGui::getInstance().p_movie_info->epgChannel; + if (!CMoviePlayerGui::getInstance().p_movie_info->channelName.empty()) + Service = CMoviePlayerGui::getInstance().p_movie_info->channelName; } if (Service.empty()) @@ -520,7 +520,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) if (ModeTshift && CMoviePlayerGui::getInstance().p_movie_info) /* show channel-logo */ { if (!GetLogoName(CMoviePlayerGui::getInstance().p_movie_info->epgId, - CMoviePlayerGui::getInstance().p_movie_info->epgChannel, + CMoviePlayerGui::getInstance().p_movie_info->channelName, Logo)) Logo = ICONSDIR "/" NEUTRINO_ICON_PLAY ICONSEXT; } diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 3cee64c6a..bbf023e93 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1375,7 +1375,7 @@ void CMovieBrowser::refreshMovieInfo(void) } if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item + CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item old_EpgId = m_movieSelectionHandler->epgEpgId >>16; } @@ -2650,7 +2650,7 @@ bool CMovieBrowser::addFile(CFile &file, int dirItNr) movieInfo.file = file; if(!m_movieInfo.loadMovieInfo(&movieInfo)) { - movieInfo.epgChannel = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); + movieInfo.channelName = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); movieInfo.epgTitle = file.getFileName(); } movieInfo.dirItNr = dirItNr; @@ -3060,7 +3060,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",movie_info->file.Size>>20); CKeyboardInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size()); - CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, MAX_STRING); + CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->channelName, MAX_STRING); CKeyboardInput epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20); CKeyboardInput countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11); @@ -3091,7 +3091,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, true, yearUserIntInput.getValue(), &yearUserIntInput,NULL, CRCInput::RC_7)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, true, movie_info->productionCountry, &countryUserInput,NULL, CRCInput::RC_8)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_LENGTH, true, lengthUserIntInput.getValue(), &lengthUserIntInput,NULL, CRCInput::RC_9)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->epgChannel, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->channelName, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL movieInfoMenu.addItem(GenericMenuSeparatorLine); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PATH, false, dirItNr)); //LOCALE_TIMERLIST_RECORDING_DIR movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE, false, dateUserDateInput.getValue()));//LOCALE_FLASHUPDATE_CURRENTVERSIONDATE @@ -3466,7 +3466,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_CHANNEL: // = 9, - *item_string = movie_info.epgChannel; + *item_string = movie_info.channelName; break; case MB_INFO_BOOKMARK: // = 10, b = ""; @@ -3643,7 +3643,7 @@ void CMovieBrowser::loadYTitles(int mode, std::string search, std::string id) yt_video_list_t &ylist = ytparser.GetVideoList(); for (unsigned i = 0; i < ylist.size(); i++) { MI_MOVIE_INFO movieInfo; - movieInfo.epgChannel = ylist[i].author; + movieInfo.channelName = ylist[i].author; movieInfo.epgTitle = ylist[i].title; movieInfo.epgInfo1 = ylist[i].category; movieInfo.epgInfo2 = ylist[i].description; diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h index 4b0002ddc..ddea6d9fc 100644 --- a/src/gui/moviebrowser/mb_functions.h +++ b/src/gui/moviebrowser/mb_functions.h @@ -42,9 +42,9 @@ bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) } bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) { - if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) + if (std::lexicographical_compare(a->channelName.begin(), a->channelName.end(), b->channelName.begin(), b->channelName.end(), compare_to_lower)) return true; - if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) + if (std::lexicographical_compare(b->channelName.begin(), b->channelName.end(), a->channelName.begin(), a->channelName.end(), compare_to_lower)) return false; return sortByTitle(a,b); } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 197d79223..97d3ba914 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -106,7 +106,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo "\t<" MI_XML_TAG_RECORD " command=\"" "record" "\">\n"; - XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel); + XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->channelName); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); @@ -291,7 +291,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) while ((pos = find_next_char('<', text, pos, bytes)) != -1) { pos++; - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->channelName) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_EPGTITLE, movie_info->epgTitle) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->epgId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) @@ -300,7 +300,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->channelName) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->VtxtPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor) @@ -527,7 +527,7 @@ void MI_MOVIE_INFO::clear(void) epgTitle = ""; epgInfo1 = ""; epgInfo2 = ""; - epgChannel = ""; + channelName = ""; serieName = ""; bookmarks.end = 0; bookmarks.start = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 6052b6fe4..24d03b558 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -120,7 +120,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::string epgTitle; // plain movie name, usually filled by EPG std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string epgChannel; // Channel name, usually filled by EPG + std::string channelName; // Channel name, usually filled by EPG std::string serieName; // user defines series name time_t dateOfLastPlay; // last play date of movie in seconds since 1970 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index f6a93bcc1..5ee61b46a 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1061,7 +1061,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->cookie_header = cookie_header; instance_bg->movie_info.epgTitle = name; - instance_bg->movie_info.epgChannel = realUrl; + instance_bg->movie_info.channelName = realUrl; instance_bg->movie_info.epgId = chan; instance_bg->p_movie_info = &movie_info; @@ -1733,7 +1733,7 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) mi = milist[idx]; } } - g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1, + g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } From 8a52c8ab54d357df501d62599ff5d7a1f2b496bc Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 19:43:00 +0200 Subject: [PATCH 19/41] movieinfo: internally rename epgId -> channelId Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6978b8c994f185240301158b6a7a481186068828 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgId -> channelId --- src/driver/record.cpp | 2 +- src/gui/lcd4l.cpp | 2 +- src/gui/moviebrowser/mb.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 4 ++-- src/gui/movieplayer.cpp | 12 ++++++------ src/timerd/timermanager.cpp | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 34ec91f2c..9b58bd958 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -615,7 +615,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis tmpstring = epgTitle; } recMovieInfo->epgTitle = tmpstring; - recMovieInfo->epgId = channel->getChannelID(); + recMovieInfo->channelId = channel->getChannelID(); recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; diff --git a/src/gui/lcd4l.cpp b/src/gui/lcd4l.cpp index d16916ba6..44cfa1a1f 100644 --- a/src/gui/lcd4l.cpp +++ b/src/gui/lcd4l.cpp @@ -519,7 +519,7 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) case 3: /* play */ if (ModeTshift && CMoviePlayerGui::getInstance().p_movie_info) /* show channel-logo */ { - if (!GetLogoName(CMoviePlayerGui::getInstance().p_movie_info->epgId, + if (!GetLogoName(CMoviePlayerGui::getInstance().p_movie_info->channelId, CMoviePlayerGui::getInstance().p_movie_info->channelName, Logo)) Logo = ICONSDIR "/" NEUTRINO_ICON_PLAY ICONSEXT; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index bbf023e93..a580db7ce 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1358,7 +1358,7 @@ void CMovieBrowser::refreshMovieInfo(void) // static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->epgId, m_cBoxFrameTitleRel.iY); + //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 97d3ba914..4fd89ca03 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -108,7 +108,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo "\">\n"; XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->channelName); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->channelId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu @@ -293,7 +293,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) pos++; GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->channelName) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_EPGTITLE, movie_info->epgTitle) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->epgId) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->channelId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) @@ -514,7 +514,7 @@ void MI_MOVIE_INFO::clear(void) //format = 0; //audio = 0; - epgId = 0; + channelId = 0; epgEpgId = 0; mode = 0; VideoPid = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 24d03b558..05f845839 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -120,7 +120,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::string epgTitle; // plain movie name, usually filled by EPG std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string channelName; // Channel name, usually filled by EPG + std::string channelName; // channel name, auto filled std::string serieName; // user defines series name time_t dateOfLastPlay; // last play date of movie in seconds since 1970 @@ -137,7 +137,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] - uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed + uint64_t channelId; // channel id, auto filled uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 5ee61b46a..1661b1584 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -708,7 +708,7 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) int eof = 0, pos = 0; unsigned char *chid = new unsigned char[sizeof(t_channel_id)]; - *(t_channel_id*)chid = mp->movie_info.epgId; + *(t_channel_id*)chid = mp->movie_info.channelId; bool started = mp->StartWebtv(); printf("%s: started: %d\n", __func__, started);fflush(stdout); @@ -1062,7 +1062,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->movie_info.epgTitle = name; instance_bg->movie_info.channelName = realUrl; - instance_bg->movie_info.epgId = chan; + instance_bg->movie_info.channelId = chan; instance_bg->p_movie_info = &movie_info; stopPlayBack(); @@ -1156,7 +1156,7 @@ bool CMoviePlayerGui::PlayFileStart(void) } duration = p_movie_info->length * 60 * 1000; - int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, currentapid, currentac3 == 1); + int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, currentapid, currentac3 == 1); CZapit::getInstance()->SetVolumePercent(percent); } @@ -1186,7 +1186,7 @@ bool CMoviePlayerGui::PlayFileStart(void) int i; int towait = (timeshift == TSHIFT_MODE_ON) ? TIMESHIFT_SECONDS+1 : TIMESHIFT_SECONDS; int cnt = 500; - if (IS_WEBTV(movie_info.epgId)) { + if (IS_WEBTV(movie_info.channelId)) { videoDecoder->setBlank(false); cnt = 200; towait = 20; @@ -1875,10 +1875,10 @@ void CMoviePlayerGui::selectAudioPid() if (p_movie_info && numpida <= p_movie_info->audioPids.size()) { APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); - CVolume::getInstance()->SetCurrentChannel(p_movie_info->epgId); + CVolume::getInstance()->SetCurrentChannel(p_movie_info->channelId); CVolume::getInstance()->SetCurrentPid(currentapid); for (uint i=0; i < numpida; i++) { - percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); + percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, apids[i], ac3flags[i]); APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].AudioPidName, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance())); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 752fc523c..5ee767e2c 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1249,7 +1249,7 @@ void CTimerEvent_Record::saveToConfig(CConfigFile *config) //------------------------------------------------------------ void CTimerEvent_Record::Reschedule() { - // clear epgId on reschedule + // clear epgID on reschedule eventInfo.epgID = 0; eventInfo.epg_starttime = 0; epgTitle=""; From c7b679a9282b0a56c523c076d3cc5b3614fa4a2d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 22:01:34 +0200 Subject: [PATCH 20/41] movieinfo: internally rename epgEpgId -> epgId Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/53c6a23d07f853ad22c9e8ddc2f82dc6bcf16032 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgEpgId -> epgId --- src/driver/record.cpp | 2 +- src/gui/epgview.cpp | 6 +++--- src/gui/moviebrowser/mb.cpp | 10 +++++----- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 9b58bd958..8ee8b3b7e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -618,7 +618,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->channelId = channel->getChannelID(); recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; - recMovieInfo->epgEpgId = epgid; + recMovieInfo->epgId = epgid; recMovieInfo->mode = g_Zapit->getMode(); recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 143a9d9d3..20b4f0be1 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -568,7 +568,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool epgData.itemDescriptions.clear(); epgData.items.clear(); epgData.fsk = mp_movie_info->parentalLockAge; - epgData.table_id = mp_movie_info->epgEpgId; + epgData.table_id = mp_movie_info->epgId; #ifdef FULL_CONTENT_CLASSIFICATION epgData.contentClassification.clear(); #else @@ -696,7 +696,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool epg_done = 100; //printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done); - res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true); + res = show(mp_movie_info->epgId >> 16, 0, 0, doLoop, false, true); if(!epgTextSwitch.empty()) { mp_movie_info->epgInfo2 = epgTextSwitch; @@ -1361,7 +1361,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } g_settings.bigFonts = bigFonts; if (mp_info) - show(mp_movie_info->epgEpgId >> 16, 0, 0, false, false, true); + show(mp_movie_info->epgId >> 16, 0, 0, false, false, true); else show(channel_id, id, &startzeit, false, call_fromfollowlist); showPos=0; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index a580db7ce..f7c601e35 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1358,14 +1358,14 @@ void CMovieBrowser::refreshMovieInfo(void) // static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); + //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; - if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgEpgId >>16)) { + if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgId >>16)) { if (newHeader) CChannelLogo->clearFbData(); // reset logo screen data else @@ -1373,10 +1373,10 @@ void CMovieBrowser::refreshMovieInfo(void) delete CChannelLogo; CChannelLogo = NULL; } - if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { + if (old_EpgId != m_movieSelectionHandler->epgId >>16) { if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item - old_EpgId = m_movieSelectionHandler->epgEpgId >>16; + CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgId >>16); //TODO: add logo into header as item + old_EpgId = m_movieSelectionHandler->epgId >>16; } if (CChannelLogo && CChannelLogo->hasLogo()) { diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 4fd89ca03..954c93cde 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -111,7 +111,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->channelId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgId); // %llu XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->VideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u @@ -296,7 +296,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->channelId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgId) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) @@ -515,7 +515,7 @@ void MI_MOVIE_INFO::clear(void) //audio = 0; channelId = 0; - epgEpgId = 0; + epgId = 0; mode = 0; VideoPid = 0; VideoType = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 05f845839..8ce7e4426 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -138,7 +138,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] uint64_t channelId; // channel id, auto filled - uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed + uint64_t epgId; // EPG id, usually filled by EPG int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 1661b1584..5bbc18754 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1733,7 +1733,7 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) mi = milist[idx]; } } - g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, + g_InfoViewer->showMovieTitle(playstate, mi->epgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } From 9a1f5390a1a6b03b0d795d940dc469981254cd95 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:42:14 +0200 Subject: [PATCH 21/41] movieinfo: internally rename epgMode -> mode Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1c37abc0a060d1878f84699c508c08a4cec5137c Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgMode -> mode --- src/driver/record.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 0592347ff..9acbc98d9 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -615,7 +615,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; - recMovieInfo->epgMode = g_Zapit->getMode(); + recMovieInfo->mode = g_Zapit->getMode(); recMovieInfo->epgVideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index b29fb74cb..01e576a03 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -112,7 +112,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->epgMode); // %d + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { @@ -297,7 +297,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->epgMode) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) @@ -516,7 +516,7 @@ void MI_MOVIE_INFO::clear(void) epgId = 0; epgEpgId = 0; - epgMode = 0; + mode = 0; epgVideoPid = 0; VideoType = 0; epgVTXPID = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index eaa943d66..ab30bcb20 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -139,7 +139,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed - int epgMode; // currently not used, we just do not want to loose this info if movie info is saved backed + int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed From 15e649ebbe2f2db89bc37689c911f16c39154679 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:45:07 +0200 Subject: [PATCH 22/41] movieinfo: internally rename epgVideoPid -> VideoPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8bb566eba5a65844b58e4f7b0c02ee4d77fb76de Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgVideoPid -> VideoPid --- src/driver/record.cpp | 6 +++--- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 9acbc98d9..5111eb767 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -616,7 +616,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; recMovieInfo->mode = g_Zapit->getMode(); - recMovieInfo->epgVideoPid = allpids.PIDs.vpid; + recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; EPG_AUDIO_PIDS audio_pids; @@ -1937,10 +1937,10 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.epgAudioPid, desc.c_str()); } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { - recMovieInfo->epgVideoPid = st->id; + recMovieInfo->VideoPid = st->id; if (codec->codec_id == AV_CODEC_ID_H264) recMovieInfo->VideoType = 1; - printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->epgVideoPid); + printf("%s: [VIDEO] 0x%x\n", __FUNCTION__, recMovieInfo->VideoPid); } } } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 01e576a03..4c3e6623c 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -113,7 +113,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->VideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u if ( !movie_info->audioPids.empty() ) { *extMessage += "\t\t<" MI_XML_TAG_AUDIOPIDS ">\n"; @@ -298,7 +298,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->epgVideoPid) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID) @@ -517,7 +517,7 @@ void MI_MOVIE_INFO::clear(void) epgId = 0; epgEpgId = 0; mode = 0; - epgVideoPid = 0; + VideoPid = 0; VideoType = 0; epgVTXPID = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index ab30bcb20..899b9b87a 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -140,7 +140,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed int mode; // record mode (0: unknown; 1: tv record; 2: radio record) - int epgVideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed + int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 1f878adcb..cdeb50219 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -398,7 +398,7 @@ void CMoviePlayerGui::fillPids() if (p_movie_info == NULL) return; - vpid = p_movie_info->epgVideoPid; + vpid = p_movie_info->VideoPid; vtype = p_movie_info->VideoType; numpida = 0; currentapid = 0; /* FIXME: better way to detect TS recording */ From ea6cbecc6dce26a5087948cd8150aaa2d3348d05 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:50:18 +0200 Subject: [PATCH 23/41] movieinfo: internally rename epgVTXPID -> VtxtPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1feaad8fa5a1be1a7d287eeb8248f546624d840 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgVTXPID -> VtxtPid --- src/driver/record.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 5111eb767..64d892ac6 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -641,7 +641,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis audio_pids.selected = 1; recMovieInfo->audioPids.push_back(audio_pids); } - recMovieInfo->epgVTXPID = allpids.PIDs.vtxtpid; + recMovieInfo->VtxtPid = allpids.PIDs.vtxtpid; } record_error_msg_t CRecordInstance::MakeFileName(CZapitChannel * channel) diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 4c3e6623c..e300b2112 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -132,7 +132,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo } *extMessage += "\t\t\n"; } - XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID); // %u + XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VTXTPID, movie_info->VtxtPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor); XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor); @@ -301,7 +301,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) - GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->epgVTXPID) + GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->VtxtPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_SERIE_NAME, movie_info->serieName) @@ -519,7 +519,7 @@ void MI_MOVIE_INFO::clear(void) mode = 0; VideoPid = 0; VideoType = 0; - epgVTXPID = 0; + VtxtPid = 0; audioPids.clear(); diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 899b9b87a..71a78ca17 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -142,7 +142,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; - int epgVTXPID; // currently not used, we just do not want to loose this info if movie info is saved backed + int VtxtPid; // currently not used, we just do not want to loose this info if movie info is saved backed bool marked; bool delAsk; From bde496cad22ae4c7c69832ad0cc2fc3ea0af9626 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 18:58:11 +0200 Subject: [PATCH 24/41] movieinfo: internally rename epgAudioPid -> AudioPid Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c5dcb1c4f62e3fd5f2ce883e85fc5136ae0b5656 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgAudioPid -> AudioPid --- src/driver/record.cpp | 32 ++++++++++++++++---------------- src/gui/epgview.cpp | 2 +- src/gui/movieinfo.cpp | 18 +++++++++--------- src/gui/movieinfo.h | 8 ++++---- src/gui/movieplayer.cpp | 12 ++++++------ 5 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 64d892ac6..4068cea96 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -174,11 +174,11 @@ record_error_msg_t CRecordInstance::Start(CZapitChannel * channel) } } for (unsigned int i = 0; i < recMovieInfo->audioPids.size(); i++) { - apids[numpids++] = recMovieInfo->audioPids[i].epgAudioPid; + apids[numpids++] = recMovieInfo->audioPids[i].AudioPid; if(channel->getAudioChannel(i)->audioChannelType == CZapitAudioChannel::EAC3){ - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO_EAC3, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); }else - psi.addPid(recMovieInfo->audioPids[i].epgAudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); + psi.addPid(recMovieInfo->audioPids[i].AudioPid, EN_TYPE_AUDIO, recMovieInfo->audioPids[i].atype, channel->getAudioChannel(i)->description.c_str()); if (numpids >= REC_MAX_APIDS) break; @@ -335,10 +335,10 @@ bool CRecordInstance::Update() record->AddPid(it->apid); for(unsigned int i = 0; i < allpids.APIDs.size(); i++) { if(allpids.APIDs[i].pid == it->apid) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 0; recMovieInfo->audioPids.push_back(audio_pids); @@ -619,15 +619,15 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; APIDList::iterator it; for(unsigned int i= 0; i< allpids.APIDs.size(); i++) { for(it = apid_list.begin(); it != apid_list.end(); ++it) { if(allpids.APIDs[i].pid == it->apid) { - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; - audio_pids.selected = (audio_pids.epgAudioPid == channel->getAudioPid()) ? 1 : 0; + audio_pids.selected = (audio_pids.AudioPid == channel->getAudioPid()) ? 1 : 0; recMovieInfo->audioPids.push_back(audio_pids); } } @@ -635,8 +635,8 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis /* FIXME sometimes no apid in xml ?? */ if(recMovieInfo->audioPids.empty() && !allpids.APIDs.empty()) { int i = 0; - audio_pids.epgAudioPid = allpids.APIDs[i].pid; - audio_pids.epgAudioPidName = allpids.APIDs[i].desc; + audio_pids.AudioPid = allpids.APIDs[i].pid; + audio_pids.AudioPidName = allpids.APIDs[i].desc; audio_pids.atype = allpids.APIDs[i].is_ac3 ? 1 : allpids.APIDs[i].is_aac ? 5 : allpids.APIDs[i].is_eac3 ? 7 : 0; audio_pids.selected = 1; recMovieInfo->audioPids.push_back(audio_pids); @@ -1901,7 +1901,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li AVStream *st = ofcx->streams[i]; AVCodecContext * codec = st->codec; if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0); AVDictionaryEntry *title = av_dict_get(st->metadata, "title", NULL, 0); @@ -1931,10 +1931,10 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li } audio_pids.selected = 0; - audio_pids.epgAudioPidName = desc; - audio_pids.epgAudioPid = st->id; + audio_pids.AudioPidName = desc; + audio_pids.AudioPid = st->id; recMovieInfo->audioPids.push_back(audio_pids); - printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.epgAudioPid, desc.c_str()); + printf("%s: [AUDIO] 0x%x [%s]\n", __FUNCTION__, audio_pids.AudioPid, desc.c_str()); } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { recMovieInfo->VideoPid = st->id; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index ce034413a..c1cffffcd 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -593,7 +593,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool { if (i) extMovieInfo += ", "; - extMovieInfo += mp_movie_info->audioPids[i].epgAudioPidName; + extMovieInfo += mp_movie_info->audioPids[i].AudioPidName; } extMovieInfo += "\n"; } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index e300b2112..197d79223 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -121,13 +121,13 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo for (unsigned int i = 0; i < movie_info->audioPids.size(); i++) // pids.APIDs.size() { *extMessage += "\t\t\t<" MI_XML_TAG_AUDIO " " MI_XML_TAG_PID "=\""; - *extMessage += to_string(movie_info->audioPids[i].epgAudioPid); + *extMessage += to_string(movie_info->audioPids[i].AudioPid); *extMessage += "\" " MI_XML_TAG_ATYPE "=\""; *extMessage += to_string(movie_info->audioPids[i].atype); *extMessage += "\" " MI_XML_TAG_SELECTED "=\""; *extMessage += to_string(movie_info->audioPids[i].selected); *extMessage += "\" " MI_XML_TAG_NAME "=\""; - *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].epgAudioPidName.c_str()); + *extMessage += ZapitTools::UTF8_to_UTF8XML(movie_info->audioPids[i].AudioPidName.c_str()); *extMessage += "\"/>\n"; } *extMessage += "\t\t\n"; @@ -287,7 +287,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) int pos = 0; - EPG_AUDIO_PIDS audio_pids; + AUDIO_PIDS audio_pids; while ((pos = find_next_char('<', text, pos, bytes)) != -1) { pos++; @@ -334,9 +334,9 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) while (text[pos + pos2] != '\"' && text[pos + pos2] != 0 && text[pos + pos2] != '/') pos2++; if (text[pos + pos2] == '\"') - audio_pids.epgAudioPid = atoi(&text[pos + pos2 + 1]); + audio_pids.AudioPid = atoi(&text[pos + pos2 + 1]); } else - audio_pids.epgAudioPid = 0; + audio_pids.AudioPid = 0; audio_pids.atype = 0; pos2 = -1; @@ -366,7 +366,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) audio_pids.selected = atoi(&text[pos + pos2 + 1]); } - audio_pids.epgAudioPidName = ""; + audio_pids.AudioPidName = ""; //pos2 = strcspn(&text[pos],MI_XML_TAG_NAME); pos2 = -1; ptr = strstr(&text[pos], MI_XML_TAG_NAME); @@ -382,12 +382,12 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) pos3++; if (text[pos + pos3] == '\"') { - audio_pids.epgAudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); - audio_pids.epgAudioPidName = htmlEntityDecode(audio_pids.epgAudioPidName); + audio_pids.AudioPidName.append(&text[pos + pos2 + 1], pos3 - pos2 - 1); + audio_pids.AudioPidName = htmlEntityDecode(audio_pids.AudioPidName); } } } - //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.epgAudioPid, audio_pids.atype, audio_pids.epgAudioPidName.c_str(), audio_pids.selected); + //printf("MOVIE INFO: apid %d type %d name %s selected %d\n", audio_pids.AudioPid, audio_pids.atype, audio_pids.AudioPidName.c_str(), audio_pids.selected); movie_info->audioPids.push_back(audio_pids); } /* parse bookmarks */ diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 71a78ca17..6052b6fe4 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -108,9 +108,9 @@ typedef struct { int atype; int selected; - int epgAudioPid; // epg audio pid nr, usually filled by VCR - std::string epgAudioPidName; // epg audio pid name, usually filled by VCR -} EPG_AUDIO_PIDS; + int AudioPid; // audio pid nr, usually filled by VCR + std::string AudioPidName; // audio pid name, usually filled by VCR +} AUDIO_PIDS; class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); { @@ -135,7 +135,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); //char format; // currently not used //char audio; // currently not used MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie - std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] + std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index cdeb50219..0198657da 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -403,18 +403,18 @@ void CMoviePlayerGui::fillPids() numpida = 0; currentapid = 0; /* FIXME: better way to detect TS recording */ if (!p_movie_info->audioPids.empty()) { - currentapid = p_movie_info->audioPids[0].epgAudioPid; + currentapid = p_movie_info->audioPids[0].AudioPid; currentac3 = p_movie_info->audioPids[0].atype; } else if (!vpid) { is_file_player = true; return; } for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - apids[i] = p_movie_info->audioPids[i].epgAudioPid; + apids[i] = p_movie_info->audioPids[i].AudioPid; ac3flags[i] = p_movie_info->audioPids[i].atype; numpida++; if (p_movie_info->audioPids[i].selected) { - currentapid = p_movie_info->audioPids[i].epgAudioPid; + currentapid = p_movie_info->audioPids[i].AudioPid; currentac3 = p_movie_info->audioPids[i].atype; } } @@ -1715,8 +1715,8 @@ bool CMoviePlayerGui::getAudioName(int apid, std::string &apidtitle) return false; for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - if (p_movie_info->audioPids[i].epgAudioPid == apid && !p_movie_info->audioPids[i].epgAudioPidName.empty()) { - apidtitle = p_movie_info->audioPids[i].epgAudioPidName; + if (p_movie_info->audioPids[i].AudioPid == apid && !p_movie_info->audioPids[i].AudioPidName.empty()) { + apidtitle = p_movie_info->audioPids[i].AudioPidName; return true; } } @@ -1846,7 +1846,7 @@ void CMoviePlayerGui::selectAudioPid() CVolume::getInstance()->SetCurrentPid(currentapid); for (uint i=0; i < numpida; i++) { percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); - APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].epgAudioPidName, + APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].AudioPidName, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance())); } From 08e1339fcf977cd60860b54f7073d3c4a5f3aeb3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 19:33:04 +0200 Subject: [PATCH 25/41] movieinfo: internally rename epgChannel -> ChannelName Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a85d539bd03da86a3a8e3ed41af98768440f4b3e Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgChannel -> ChannelName --- src/driver/record.cpp | 4 ++-- src/gui/epgview.cpp | 4 ++-- src/gui/moviebrowser/mb.cpp | 12 ++++++------ src/gui/moviebrowser/mb_functions.h | 4 ++-- src/gui/movieinfo.cpp | 8 ++++---- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 4 ++-- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 4068cea96..c2e527ab9 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -570,9 +570,9 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis std::string tmpstring = channel->getName(); if (tmpstring.empty()) - recMovieInfo->epgChannel = "unknown"; + recMovieInfo->channelName = "unknown"; else - recMovieInfo->epgChannel = tmpstring; + recMovieInfo->channelName = tmpstring; tmpstring = "not available"; if (epgid != 0) { diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index c1cffffcd..1da2879a9 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -551,12 +551,12 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool extMovieInfo += mp_movie_info->serieName; extMovieInfo += "\n"; } - if (!mp_movie_info->epgChannel.empty()) + if (!mp_movie_info->channelName.empty()) { extMovieInfo += "\n"; extMovieInfo += g_Locale->getText(LOCALE_MOVIEBROWSER_INFO_CHANNEL); extMovieInfo += ": "; - extMovieInfo += mp_movie_info->epgChannel; + extMovieInfo += mp_movie_info->channelName; extMovieInfo += "\n"; } if (mp_movie_info->rating != 0) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 2648480a3..b2b609c80 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1277,7 +1277,7 @@ void CMovieBrowser::refreshMovieInfo(void) } if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->epgChannel, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item + CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item old_EpgId = m_movieSelectionHandler->epgEpgId >>16; } @@ -2547,7 +2547,7 @@ bool CMovieBrowser::addFile(CFile &file, int dirItNr) movieInfo.file = file; if(!m_movieInfo.loadMovieInfo(&movieInfo)) { - movieInfo.epgChannel = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); + movieInfo.channelName = string(g_Locale->getText(LOCALE_MOVIEPLAYER_HEAD)); movieInfo.epgTitle = file.getFileName(); } movieInfo.dirItNr = dirItNr; @@ -2947,7 +2947,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) snprintf(size,BUFFER_SIZE,"%5" PRIu64 "",movie_info->file.Size>>20); CKeyboardInput titelUserInput(LOCALE_MOVIEBROWSER_INFO_TITLE, &movie_info->epgTitle, (movie_info->epgTitle.empty() || (movie_info->epgTitle.size() < MAX_STRING)) ? MAX_STRING:movie_info->epgTitle.size()); - CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->epgChannel, MAX_STRING); + CKeyboardInput channelUserInput(LOCALE_MOVIEBROWSER_INFO_CHANNEL, &movie_info->channelName, MAX_STRING); CKeyboardInput epgUserInput(LOCALE_MOVIEBROWSER_INFO_INFO1, &movie_info->epgInfo1, 20); CKeyboardInput countryUserInput(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, &movie_info->productionCountry, 11); @@ -2977,7 +2977,7 @@ int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info) movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODYEAR, true, yearUserIntInput.getValue(), &yearUserIntInput,NULL, CRCInput::RC_7)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PRODCOUNTRY, true, movie_info->productionCountry, &countryUserInput,NULL, CRCInput::RC_8)); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_LENGTH, true, lengthUserIntInput.getValue(), &lengthUserIntInput,NULL, CRCInput::RC_9)); - movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->epgChannel, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL + movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_CHANNEL, true, movie_info->channelName, &channelUserInput,NULL, CRCInput::RC_0));//LOCALE_TIMERLIST_CHANNEL movieInfoMenu.addItem(GenericMenuSeparatorLine); movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PATH, false, dirItNr)); //LOCALE_TIMERLIST_RECORDING_DIR movieInfoMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_PREVPLAYDATE, false, dateUserDateInput.getValue()));//LOCALE_FLASHUPDATE_CURRENTVERSIONDATE @@ -3352,7 +3352,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; break; case MB_INFO_CHANNEL: // = 9, - *item_string = movie_info.epgChannel; + *item_string = movie_info.channelName; break; case MB_INFO_BOOKMARK: // = 10, b = ""; @@ -3529,7 +3529,7 @@ void CMovieBrowser::loadYTitles(int mode, std::string search, std::string id) yt_video_list_t &ylist = ytparser.GetVideoList(); for (unsigned i = 0; i < ylist.size(); i++) { MI_MOVIE_INFO movieInfo; - movieInfo.epgChannel = ylist[i].author; + movieInfo.channelName = ylist[i].author; movieInfo.epgTitle = ylist[i].title; movieInfo.epgInfo1 = ylist[i].category; movieInfo.epgInfo2 = ylist[i].description; diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h index 4b0002ddc..ddea6d9fc 100644 --- a/src/gui/moviebrowser/mb_functions.h +++ b/src/gui/moviebrowser/mb_functions.h @@ -42,9 +42,9 @@ bool sortByGenre(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) } bool sortByChannel(const MI_MOVIE_INFO* a, const MI_MOVIE_INFO* b) { - if (std::lexicographical_compare(a->epgChannel.begin(), a->epgChannel.end(), b->epgChannel.begin(), b->epgChannel.end(), compare_to_lower)) + if (std::lexicographical_compare(a->channelName.begin(), a->channelName.end(), b->channelName.begin(), b->channelName.end(), compare_to_lower)) return true; - if (std::lexicographical_compare(b->epgChannel.begin(), b->epgChannel.end(), a->epgChannel.begin(), a->epgChannel.end(), compare_to_lower)) + if (std::lexicographical_compare(b->channelName.begin(), b->channelName.end(), a->channelName.begin(), a->channelName.end(), compare_to_lower)) return false; return sortByTitle(a,b); } diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 197d79223..97d3ba914 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -106,7 +106,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo "\t<" MI_XML_TAG_RECORD " command=\"" "record" "\">\n"; - XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel); + XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->channelName); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); @@ -291,7 +291,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) while ((pos = find_next_char('<', text, pos, bytes)) != -1) { pos++; - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->epgChannel) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->channelName) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_EPGTITLE, movie_info->epgTitle) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->epgId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) @@ -300,7 +300,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) - GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->epgChannel) + GET_XML_DATA_STRING(text, pos, MI_XML_TAG_NAME, movie_info->channelName) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VTXTPID, movie_info->VtxtPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MAJOR, movie_info->genreMajor) GET_XML_DATA_INT(text, pos, MI_XML_TAG_GENRE_MINOR, movie_info->genreMinor) @@ -527,7 +527,7 @@ void MI_MOVIE_INFO::clear(void) epgTitle = ""; epgInfo1 = ""; epgInfo2 = ""; - epgChannel = ""; + channelName = ""; serieName = ""; bookmarks.end = 0; bookmarks.start = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 6052b6fe4..24d03b558 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -120,7 +120,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::string epgTitle; // plain movie name, usually filled by EPG std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string epgChannel; // Channel name, usually filled by EPG + std::string channelName; // Channel name, usually filled by EPG std::string serieName; // user defines series name time_t dateOfLastPlay; // last play date of movie in seconds since 1970 diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 0198657da..1e4762e31 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1028,7 +1028,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->cookie_header = cookie_header; instance_bg->movie_info.epgTitle = name; - instance_bg->movie_info.epgChannel = realUrl; + instance_bg->movie_info.channelName = realUrl; instance_bg->movie_info.epgId = chan; instance_bg->p_movie_info = &movie_info; @@ -1700,7 +1700,7 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) mi = milist[idx]; } } - g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->epgChannel, mi->epgTitle, mi->epgInfo1, + g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } From 138af5fcaf66c8ee7d037c0f841115f9ec906faf Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 19:43:00 +0200 Subject: [PATCH 26/41] movieinfo: internally rename epgId -> channelId Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/625cbb6122237d16aec97032a4d0a2e8045bfdbd Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgId -> channelId --- src/driver/record.cpp | 2 +- src/gui/moviebrowser/mb.cpp | 2 +- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 4 ++-- src/gui/movieplayer.cpp | 12 ++++++------ src/timerd/timermanager.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index c2e527ab9..29e5e140a 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -611,7 +611,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis tmpstring = epgTitle; } recMovieInfo->epgTitle = tmpstring; - recMovieInfo->epgId = channel->getChannelID(); + recMovieInfo->channelId = channel->getChannelID(); recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; recMovieInfo->epgEpgId = epgid; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index b2b609c80..d6c16d55d 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1260,7 +1260,7 @@ void CMovieBrowser::refreshMovieInfo(void) // static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->epgId, m_cBoxFrameTitleRel.iY); + //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 97d3ba914..4fd89ca03 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -108,7 +108,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo "\">\n"; XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_CHANNELNAME, movie_info->channelName); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_EPGTITLE, movie_info->epgTitle); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->epgId); + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->channelId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu @@ -293,7 +293,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) pos++; GET_XML_DATA_STRING(text, pos, MI_XML_TAG_CHANNELNAME, movie_info->channelName) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_EPGTITLE, movie_info->epgTitle) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->epgId) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->channelId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) @@ -514,7 +514,7 @@ void MI_MOVIE_INFO::clear(void) //format = 0; //audio = 0; - epgId = 0; + channelId = 0; epgEpgId = 0; mode = 0; VideoPid = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 24d03b558..05f845839 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -120,7 +120,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::string epgTitle; // plain movie name, usually filled by EPG std::string epgInfo1; // used for Genre (Premiere) or second title, usually filled by EPG std::string epgInfo2; // detailed movie content, usually filled by EPG - std::string channelName; // Channel name, usually filled by EPG + std::string channelName; // channel name, auto filled std::string serieName; // user defines series name time_t dateOfLastPlay; // last play date of movie in seconds since 1970 @@ -137,7 +137,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); MI_MOVIE_BOOKMARKS bookmarks; // bookmark collecton for this movie std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] - uint64_t epgId; // currently not used, we just do not want to loose this info if movie info is saved backed + uint64_t channelId; // channel id, auto filled uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 1e4762e31..e41a916e1 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -690,7 +690,7 @@ void* CMoviePlayerGui::bgPlayThread(void *arg) int eof = 0, pos = 0; unsigned char *chid = new unsigned char[sizeof(t_channel_id)]; - *(t_channel_id*)chid = mp->movie_info.epgId; + *(t_channel_id*)chid = mp->movie_info.channelId; bool started = mp->StartWebtv(); printf("%s: started: %d\n", __func__, started);fflush(stdout); @@ -1029,7 +1029,7 @@ bool CMoviePlayerGui::PlayBackgroundStart(const std::string &file, const std::st instance_bg->movie_info.epgTitle = name; instance_bg->movie_info.channelName = realUrl; - instance_bg->movie_info.epgId = chan; + instance_bg->movie_info.channelId = chan; instance_bg->p_movie_info = &movie_info; stopPlayBack(); @@ -1123,7 +1123,7 @@ bool CMoviePlayerGui::PlayFileStart(void) } duration = p_movie_info->length * 60 * 1000; - int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, currentapid, currentac3 == 1); + int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, currentapid, currentac3 == 1); CZapit::getInstance()->SetVolumePercent(percent); } @@ -1153,7 +1153,7 @@ bool CMoviePlayerGui::PlayFileStart(void) int i; int towait = (timeshift == TSHIFT_MODE_ON) ? TIMESHIFT_SECONDS+1 : TIMESHIFT_SECONDS; int cnt = 500; - if (IS_WEBTV(movie_info.epgId)) { + if (IS_WEBTV(movie_info.channelId)) { videoDecoder->setBlank(false); cnt = 200; towait = 20; @@ -1842,10 +1842,10 @@ void CMoviePlayerGui::selectAudioPid() if (p_movie_info && numpida <= p_movie_info->audioPids.size()) { APIDSelector.addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_AUDIOMENU_VOLUME_ADJUST)); - CVolume::getInstance()->SetCurrentChannel(p_movie_info->epgId); + CVolume::getInstance()->SetCurrentChannel(p_movie_info->channelId); CVolume::getInstance()->SetCurrentPid(currentapid); for (uint i=0; i < numpida; i++) { - percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, apids[i], ac3flags[i]); + percent[i] = CZapit::getInstance()->GetPidVolume(p_movie_info->channelId, apids[i], ac3flags[i]); APIDSelector.addItem(new CMenuOptionNumberChooser(p_movie_info->audioPids[i].AudioPidName, &percent[i], currentapid == apids[i], 0, 999, CVolume::getInstance())); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 6d9c12f3e..1e3329800 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1240,7 +1240,7 @@ void CTimerEvent_Record::saveToConfig(CConfigFile *config) //------------------------------------------------------------ void CTimerEvent_Record::Reschedule() { - // clear epgId on reschedule + // clear epgID on reschedule eventInfo.epgID = 0; eventInfo.epg_starttime = 0; epgTitle=""; From 49386530ec82a2fc036bf3fe6f98b9676dafa464 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 9 Sep 2016 22:01:34 +0200 Subject: [PATCH 27/41] movieinfo: internally rename epgEpgId -> epgId Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa8a3849f4449c08daea58c8f885d4a242094e30 Author: vanhofen Date: 2016-09-09 (Fri, 09 Sep 2016) Origin message was: ------------------ - movieinfo: internally rename epgEpgId -> epgId --- src/driver/record.cpp | 2 +- src/gui/epgview.cpp | 6 +++--- src/gui/moviebrowser/mb.cpp | 10 +++++----- src/gui/movieinfo.cpp | 6 +++--- src/gui/movieinfo.h | 2 +- src/gui/movieplayer.cpp | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 29e5e140a..07887096c 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -614,7 +614,7 @@ void CRecordInstance::FillMovieInfo(CZapitChannel * channel, APIDList & apid_lis recMovieInfo->channelId = channel->getChannelID(); recMovieInfo->epgInfo1 = info1; recMovieInfo->epgInfo2 = info2; - recMovieInfo->epgEpgId = epgid; + recMovieInfo->epgId = epgid; recMovieInfo->mode = g_Zapit->getMode(); recMovieInfo->VideoPid = allpids.PIDs.vpid; recMovieInfo->VideoType = channel->type; diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 1da2879a9..d05cc7e1c 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -527,7 +527,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool epgData.itemDescriptions.clear(); epgData.items.clear(); epgData.fsk = mp_movie_info->parentalLockAge; - epgData.table_id = mp_movie_info->epgEpgId; + epgData.table_id = mp_movie_info->epgId; #ifdef FULL_CONTENT_CLASSIFICATION epgData.contentClassification.clear(); #else @@ -655,7 +655,7 @@ int CEpgData::show_mp(MI_MOVIE_INFO *mi, int mp_position, int mp_duration, bool epg_done = 100; //printf("[%s:%d] epg_done: %d\n", __func__, __LINE__, epg_done); - res = show(mp_movie_info->epgEpgId >> 16, 0, 0, doLoop, false, true); + res = show(mp_movie_info->epgId >> 16, 0, 0, doLoop, false, true); if(!epgTextSwitch.empty()) { mp_movie_info->epgInfo2 = epgTextSwitch; @@ -1246,7 +1246,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start } g_settings.bigFonts = bigFonts; if (mp_info) - show(mp_movie_info->epgEpgId >> 16, 0, 0, false, false, true); + show(mp_movie_info->epgId >> 16, 0, 0, false, false, true); else show(channel_id, id, &startzeit, false, call_fromfollowlist); showPos=0; diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index d6c16d55d..fd4aa42c4 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1260,14 +1260,14 @@ void CMovieBrowser::refreshMovieInfo(void) // static int logo_h = 0; int logo_w_max = m_cBoxFrameTitleRel.iWidth / 4; - //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgEpgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); + //printf("refreshMovieInfo: EpgId %llx id %llx y %d\n", m_movieSelectionHandler->epgId, m_movieSelectionHandler->channelId, m_cBoxFrameTitleRel.iY); int lx = 0;//never read m_cBoxFrame.iX+m_cBoxFrameTitleRel.iX+m_cBoxFrameTitleRel.iWidth-logo_w-10; int ly = 0;//never read m_cBoxFrameTitleRel.iY+m_cBoxFrame.iY+ (m_cBoxFrameTitleRel.iHeight-logo_h)/2; short pb_hdd_offset = g_settings.infobar_show_sysfs_hdd ? 104 : 0; if (show_mode == MB_SHOW_YT) pb_hdd_offset = 0; - if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgEpgId >>16)) { + if (CChannelLogo && (old_EpgId != m_movieSelectionHandler->epgId >>16)) { if (newHeader) CChannelLogo->clearFbData(); // reset logo screen data else @@ -1275,10 +1275,10 @@ void CMovieBrowser::refreshMovieInfo(void) delete CChannelLogo; CChannelLogo = NULL; } - if (old_EpgId != m_movieSelectionHandler->epgEpgId >>16) { + if (old_EpgId != m_movieSelectionHandler->epgId >>16) { if (CChannelLogo == NULL) - CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgEpgId >>16); //TODO: add logo into header as item - old_EpgId = m_movieSelectionHandler->epgEpgId >>16; + CChannelLogo = new CComponentsChannelLogoScalable(0, 0, m_movieSelectionHandler->channelName, m_movieSelectionHandler->epgId >>16); //TODO: add logo into header as item + old_EpgId = m_movieSelectionHandler->epgId >>16; } if (CChannelLogo && CChannelLogo->hasLogo()) { diff --git a/src/gui/movieinfo.cpp b/src/gui/movieinfo.cpp index 4fd89ca03..954c93cde 100644 --- a/src/gui/movieinfo.cpp +++ b/src/gui/movieinfo.cpp @@ -111,7 +111,7 @@ bool CMovieInfo::encodeMovieInfoXml(std::string * extMessage, MI_MOVIE_INFO * mo XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_ID, movie_info->channelId); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO1, movie_info->epgInfo1); XML_ADD_TAG_STRING(*extMessage, MI_XML_TAG_INFO2, movie_info->epgInfo2); - XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgEpgId); // %llu + XML_ADD_TAG_LONG(*extMessage, MI_XML_TAG_EPGID, movie_info->epgId); // %llu XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_MODE, movie_info->mode); // %d XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOPID, movie_info->VideoPid); // %u XML_ADD_TAG_UNSIGNED(*extMessage, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType); // %u @@ -296,7 +296,7 @@ bool CMovieInfo::parseXmlTree(std::string &_text, MI_MOVIE_INFO *movie_info) GET_XML_DATA_LONG(text, pos, MI_XML_TAG_ID, movie_info->channelId) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO1, movie_info->epgInfo1) GET_XML_DATA_STRING(text, pos, MI_XML_TAG_INFO2, movie_info->epgInfo2) - GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgEpgId) + GET_XML_DATA_LONG(text, pos, MI_XML_TAG_EPGID, movie_info->epgId) GET_XML_DATA_INT(text, pos, MI_XML_TAG_MODE, movie_info->mode) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOPID, movie_info->VideoPid) GET_XML_DATA_INT(text, pos, MI_XML_TAG_VIDEOTYPE, movie_info->VideoType) @@ -515,7 +515,7 @@ void MI_MOVIE_INFO::clear(void) //audio = 0; channelId = 0; - epgEpgId = 0; + epgId = 0; mode = 0; VideoPid = 0; VideoType = 0; diff --git a/src/gui/movieinfo.h b/src/gui/movieinfo.h index 05f845839..8ce7e4426 100644 --- a/src/gui/movieinfo.h +++ b/src/gui/movieinfo.h @@ -138,7 +138,7 @@ class MI_MOVIE_INFO //MI_MOVIE_INFO &operator=(const MI_MOVIE_INFO& src); std::vector audioPids; // available AudioPids, usually filled by VCR. Note: Vectors are easy to is also using the heap (memory fragmentation), might be changed to array [MI_MAX_AUDIO_PIDS] uint64_t channelId; // channel id, auto filled - uint64_t epgEpgId; // off_t currently not used, we just do not want to loose this info if movie info is saved backed + uint64_t epgId; // EPG id, usually filled by EPG int mode; // record mode (0: unknown; 1: tv record; 2: radio record) int VideoPid; // currently not used, we just do not want to loose this info if movie info is saved backed int VideoType; diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index e41a916e1..e244d798c 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -1700,7 +1700,7 @@ void CMoviePlayerGui::callInfoViewer(bool init_vzap_it) mi = milist[idx]; } } - g_InfoViewer->showMovieTitle(playstate, mi->epgEpgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, + g_InfoViewer->showMovieTitle(playstate, mi->epgId >>16, mi->channelName, mi->epgTitle, mi->epgInfo1, duration, position, repeat_mode, init_vzap_it ? 0 /*IV_MODE_DEFAULT*/ : 1 /*IV_MODE_VIRTUAL_ZAP*/); return; } From 2a17c30cd4784ffb0a3f73158c3180cff294fc09 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sat, 10 Sep 2016 18:58:43 +0200 Subject: [PATCH 28/41] lua: Fix segfault in messagebox.exec at 'align' and 'default' - Set default values for 'show_buttons' and 'default_button' to the correct value - Set Lua api version to 1.60 Signed-off-by: M. Liebmann Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/24dd6a8c225dbcdf9cdc4f1272ff60ad4e44e44d Author: TangoCash Date: 2016-09-10 (Sat, 10 Sep 2016) Origin message was: ------------------ lua: Fix segfault in messagebox.exec at 'align' and 'default' - Set default values for 'show_buttons' and 'default_button' to the correct value - Set Lua api version to 1.60 Signed-off-by: M. Liebmann --- src/gui/lua/lua_api_version.h | 2 +- src/gui/lua/lua_messagebox.cpp | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/gui/lua/lua_api_version.h b/src/gui/lua/lua_api_version.h index 2de684548..642456596 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 59 +#define LUA_API_VERSION_MINOR 60 diff --git a/src/gui/lua/lua_messagebox.cpp b/src/gui/lua/lua_messagebox.cpp index 5be190692..3d5760525 100644 --- a/src/gui/lua/lua_messagebox.cpp +++ b/src/gui/lua/lua_messagebox.cpp @@ -66,15 +66,13 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) tableLookup(L, "name", name) || tableLookup(L, "title", name) || tableLookup(L, "caption", name); tableLookup(L, "text", text); tableLookup(L, "icon", icon); - lua_Integer timeout = -1, width = 450, return_default_on_timeout = 0, show_buttons = 0, default_button = 0; + lua_Integer timeout = -1, width = 450, return_default_on_timeout = 0, show_buttons = CMessageBox::mbAll, default_button = CMessageBox::mbrYes; tableLookup(L, "timeout", timeout); tableLookup(L, "width", width); tableLookup(L, "return_default_on_timeout", return_default_on_timeout); std::string tmp; if (tableLookup(L, "align", tmp)) { - lua_pushvalue(L, -2); - const char *val = lua_tostring(L, -2); table_key mb[] = { { "center1", CMessageBox::mbBtnAlignCenter1 }, { "center2", CMessageBox::mbBtnAlignCenter2 }, @@ -82,8 +80,9 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { "right", CMessageBox::mbBtnAlignRight }, { NULL, 0 } }; + show_buttons = 0; for (int i = 0; mb[i].name; i++) - if (!strcmp(mb[i].name, val)) { + if (!strcmp(mb[i].name, tmp.c_str())) { show_buttons |= mb[i].code; break; } @@ -119,10 +118,9 @@ int CLuaInstMessagebox::MessageboxExec(lua_State *L) { NULL, 0 } }; if (tableLookup(L, "default", tmp)) { - lua_pushvalue(L, -2); - const char *val = lua_tostring(L, -2); + default_button = 0; for (int i = 0; mbr[i].name; i++) - if (!strcmp(mbr[i].name, val)) { + if (!strcmp(mbr[i].name, tmp.c_str())) { default_button = mbr[i].code; break; } From b41dd96f56f3afcb6b90ac09c57bd6770a8896d0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 12 Sep 2016 08:22:51 +0200 Subject: [PATCH 29/41] cc_detailsline: more decent color for detailsline Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/e535afccb722184047c2651a2d4012eb27902e10 Author: vanhofen Date: 2016-09-12 (Mon, 12 Sep 2016) Origin message was: ------------------ - cc_detailsline: more decent color for detailsline --- src/gui/components/cc_detailsline.cpp | 2 +- src/gui/components/cc_detailsline.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index f09d8bfd3..5e530199f 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -142,6 +142,6 @@ void CComponentsDetailLine::paint(bool do_save_bg) //so you can ensure correct applied system colors in relevant objects with unchanged instances. void CComponentsDetailLine::syncSysColors() { - col_body = COL_MENUCONTENT_PLUS_6; + col_body = COL_MENUCONTENT_PLUS_1; //NI col_shadow = COL_SHADOW_PLUS_0; } diff --git a/src/gui/components/cc_detailsline.h b/src/gui/components/cc_detailsline.h index 37d01e4f0..3228b72b2 100644 --- a/src/gui/components/cc_detailsline.h +++ b/src/gui/components/cc_detailsline.h @@ -57,7 +57,7 @@ class CComponentsDetailLine : public CComponents public: CComponentsDetailLine( const int& x_pos = 1,const int& y_pos_top = 1, const int& y_pos_down = 1, const int& h_mark_top_ = CC_HEIGHT_MIN , const int& h_mark_down_ = CC_HEIGHT_MIN, - fb_pixel_t color_line = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + fb_pixel_t color_line = COL_MENUCONTENT_PLUS_1, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); //NI ~CComponentsDetailLine(); ///set colors From f5076147b76ef9804ff66c1e0253889a8951371a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 11 Sep 2016 22:17:08 +0200 Subject: [PATCH 30/41] CThemes: try to fix possible artefacts after changed theme This ensures a clean screen before repaint after changed theme. In some constellations (eg. with color gradient) it was possible to see some old artefacts inside widget items, eg. in header. This should avoid this. Small disadvantage: screen needs complete repaint after changed theme, but this should be not a problem in this case. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bb216f975c55a6bde8c5957a8804ac7fbc76905a Author: Thilo Graf Date: 2016-09-11 (Sun, 11 Sep 2016) --- src/gui/themes.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index c3d2da0d2..cd611c9a0 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -150,6 +150,8 @@ int CThemes::Show() std::string file_name = ""; CMenuWidget themes (LOCALE_COLORMENU_MENUCOLORS, NEUTRINO_ICON_SETTINGS, width); + sigc::slot0 slot_repaint = sigc::mem_fun(themes, &CMenuWidget::hide); //we want to clean screen before repaint after changed Option + themes.OnBeforePaint.connect(slot_repaint); themes.addIntroItems(LOCALE_COLORTHEMEMENU_HEAD2); From e534457250b3b246c957db397772e841b43b9349 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 12 Sep 2016 12:10:19 +0200 Subject: [PATCH 31/41] cc_detailsline: fix positions/dimensions of detailsline Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9948649f55f2bba8ece636a17028159d11a3298b Author: vanhofen Date: 2016-09-12 (Mon, 12 Sep 2016) Origin message was: ------------------ - cc_detailsline: fix positions/dimensions of detailsline --- src/gui/components/cc_detailsline.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/gui/components/cc_detailsline.cpp b/src/gui/components/cc_detailsline.cpp index 588a5e878..39f6143da 100644 --- a/src/gui/components/cc_detailsline.cpp +++ b/src/gui/components/cc_detailsline.cpp @@ -61,7 +61,8 @@ void CComponentsDetailLine::initVarDline( const int& x_pos, const int& y_pos_top shadow_w = 1; //CComponentsDetailLine - thickness = 4; + thickness = 4; /* MUST be an even value! */ + cc_body_gradient_enable = false; } @@ -95,11 +96,14 @@ void CComponentsDetailLine::paint(bool do_save_bg) if (v_fbdata.empty()){ - int y_mark_top = y-h_mark_top/2+thickness/2; - int y_mark_down = y_down-h_mark_down/2+thickness/2; - int sw = shadow_w; + // reduce two times the shadow width, to avoid shadow overlaps + h_mark_down -= 2*sw; + + int y_mark_top = y-h_mark_top/2; + int y_mark_down = y_down-h_mark_down/2; + cc_fbdata_t fbdata[] = { /*buffered bg full width and height */ @@ -111,16 +115,16 @@ void CComponentsDetailLine::paint(bool do_save_bg) {true, CC_FBDATA_TYPE_BOX, x+width-thickness, y_mark_top+h_mark_top, thickness, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal item line - */ - {true, CC_FBDATA_TYPE_BOX, x, y, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2, width-2*thickness-sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical connect line [ */ - {true, CC_FBDATA_TYPE_BOX, x, y+thickness, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y+thickness/2, thickness, y_down-y-thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+thickness, y+thickness/2+sw, sw, y_down-y-thickness-sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* horizontal info line - */ - {true, CC_FBDATA_TYPE_BOX, x, y_down, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, - {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x, y_down-thickness/2, width-thickness-sw, thickness, col_body, 0, 0, 0, NULL, NULL, NULL, false}, + {true, CC_FBDATA_TYPE_BOX, x+sw, y_down+thickness/2, width-thickness-2*sw, sw, col_shadow, 0, 0, 0, NULL, NULL, NULL, false}, /* vertical info mark | */ {true, CC_FBDATA_TYPE_BOX, x+width-thickness-sw, y_mark_down, thickness, h_mark_down, col_body, 0, 0, 0, NULL, NULL, NULL, false}, From 6ad341fcf813de3ba998ca2b212908298b9e34c0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 12 Sep 2016 12:11:04 +0200 Subject: [PATCH 32/41] detailsline: remove unneeded position/dimension additions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/974ef11d5b418a2e44ea49d59d6927f759b0693d Author: vanhofen Date: 2016-09-12 (Mon, 12 Sep 2016) Origin message was: ------------------ - detailsline: remove unneeded position/dimension additions --- src/gui/audioplayer.cpp | 6 +++--- src/gui/bedit/bouqueteditor_channels.cpp | 6 +++--- src/gui/bedit/bouqueteditor_chanselect.cpp | 6 +++--- src/gui/channellist.cpp | 6 +++--- src/gui/upnpbrowser.cpp | 2 +- src/gui/widget/menue.cpp | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 4ec247957..3a04eac13 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1826,8 +1826,8 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) int xpos = m_x - ConnectLineBox_Width; int ypos1 = m_y + m_title_height + m_theight+ 0 + pos*m_fheight + INFO_BOX_Y_OFFSET; int ypos2 = m_y + (m_height - m_info_height) + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (m_fheight / 2) - 2; - int ypos2a = ypos2 + (m_info_height / 2) - 2; + int ypos1a = ypos1 + (m_fheight / 2); + int ypos2a = ypos2 + (m_info_height / 2); // clear details line if (dline != NULL) @@ -1838,7 +1838,7 @@ void CAudioPlayerGui::paintItemID3DetailsLine (int pos) { //details line if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2+1, m_fheight); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, m_fheight/2, m_fheight); dline->setYPos(ypos1a); dline->paint(false); diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index bce6cc269..8f8a9b1d1 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -229,8 +229,8 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (fheight/2)-2; - int ypos2a = ypos2 + (info_height/2)-2; + int ypos1a = ypos1 + (fheight/2); + int ypos2a = ypos2 + (info_height/2); if (dline) dline->kill(); //kill details line @@ -239,7 +239,7 @@ void CBEChannelWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 2888bab7a..4ba413d75 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -291,8 +291,8 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) int xpos = x - ConnectLineBox_Width; int ypos1 = y + theight+0 + pos*iheight; int ypos2 = y + height + INFO_BOX_Y_OFFSET; - int ypos1a = ypos1 + (fheight/2)-2; - int ypos2a = ypos2 + (info_height/2)-2; + int ypos1a = ypos1 + (fheight/2); + int ypos2a = ypos2 + (info_height/2); if (dline) dline->kill(); //kill details line @@ -301,7 +301,7 @@ void CBEChannelSelectWidget::initItem2DetailsLine (int pos, int /*ch_index*/) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1a, ypos2a, fheight/2, info_height-RADIUS_LARGE*2); dline->setYPos(ypos1a); //infobox diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 23c169e48..aba0ff042 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -1654,13 +1654,13 @@ void CChannelList::paintItem2DetailsLine (int pos) return; int xpos = x - ConnectLineBox_Width; - int ypos1 = y + theight + pos*fheight + (fheight/2)-2; - int ypos2 = y + height + (info_height/2)-2; + int ypos1 = y + theight + pos*fheight + (fheight/2); + int ypos2 = y + height + (info_height/2); // paint Line if detail info (and not valid list pos) if (pos >= 0) { if (dline == NULL) - dline = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2+1, info_height-RADIUS_LARGE*2); + dline = new CComponentsDetailLine(xpos, ypos1, ypos2, fheight/2, info_height-RADIUS_LARGE*2); dline->paint(false); } } diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 6ba43bc41..bc59507e2 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1241,7 +1241,7 @@ void CUpnpBrowserGui::paintItem2DetailsLine (int pos) if (!dline) dline = new CComponentsDetailLine(); - dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight()-RADIUS_LARGE*3); + dline->setDimensionsAll(xpos, ypos1a, ypos2, m_item_height/2, infobox.getHeight()-RADIUS_LARGE*2); dline->paint(); } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 3a74dcbd9..412ccde7b 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1453,10 +1453,10 @@ void CMenuWidget::paintHint(int pos) //init details line and infobox dimensions int ypos1 = item->getYPosition(); - int ypos1a = ypos1 + (iheight/2)-2; - int ypos2a = ypos2 + (hint_height/2)-2; + int ypos1a = ypos1 + (iheight/2); + int ypos2a = ypos2 + (hint_height/2); int markh = hint_height > rad*2 ? hint_height - rad*2 : hint_height; - int imarkh = iheight/2+1; + int imarkh = iheight/2; //init details line if (details_line == NULL) From 6c5e3ab4aeb7fe42c338a5fd86390e7f1a35930d Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 12 Sep 2016 13:27:46 +0200 Subject: [PATCH 33/41] messagebox: fix navigation in buttons if just one button is present (thx dbo) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bf770e9a6882bc679e225797cfb811bca85b5837 Author: TangoCash Date: 2016-09-12 (Mon, 12 Sep 2016) Origin message was: ------------------ - messagebox: fix navigation in buttons if just one button is present (thx dbo) --- src/gui/widget/messagebox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 7140d7569..791bde242 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -233,7 +233,7 @@ int CMessageBox::exec(int timeout) result = mbrYes; loop = false; } - else if(msg==CRCInput::RC_right) + else if(msg==CRCInput::RC_right && ButtonCount > 1) { bool ok = false; while (!ok) @@ -257,7 +257,7 @@ int CMessageBox::exec(int timeout) paintButtons(); } } - else if(msg==CRCInput::RC_left) + else if(msg==CRCInput::RC_left && ButtonCount > 1) { bool ok = false; while (!ok) From 84b40fcffba8f7ee7b179e1d2e883816232ec4ff Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 13 Sep 2016 09:02:30 +0200 Subject: [PATCH 34/41] CComponentsFooter: rename var for btn icon is more plausible Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2de3a167e5c95b2cd46cce46ae5136f6d294af91 Author: Thilo Graf Date: 2016-09-13 (Tue, 13 Sep 2016) --- src/gui/components/cc_frm_footer.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index a02d999b2..a30fd2579 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -133,15 +133,15 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //generate and add button objects passed from button label content with default width to chain object. for (size_t i= 0; i< label_count; i++){ string txt = content[i].text; - string btn_name = string(content[i].button); + string icon_name = string(content[i].button); //ignore item, if no text and icon are defined; - if (txt.empty() && btn_name.empty()){ + if (txt.empty() && icon_name.empty()){ dprintf(DEBUG_INFO, "[CComponentsFooter] [%s - %d] ignore item [%d], no icon and text defined!\n", __func__, __LINE__, i); continue; } - CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, btn_name); + CComponentsButton *btn = new CComponentsButton(0, CC_CENTERED, w_btn_min, (btn_contour ? height-2*fr_thickness : height), txt, icon_name); btn->setButtonFont(ccf_btn_font); btn->doPaintBg(btn_contour); btn->enableFrame(btn_contour); @@ -153,13 +153,13 @@ void CComponentsFooter::setButtonLabels(const struct button_label_s * const cont //set button frames to icon color, predefined for available color buttons if (btn_auto_frame_col){ fb_pixel_t f_col = btn->getColorFrame(); - if (btn_name == NEUTRINO_ICON_BUTTON_RED) + if (icon_name == NEUTRINO_ICON_BUTTON_RED) f_col = COL_DARK_RED; - if (btn_name == NEUTRINO_ICON_BUTTON_GREEN) + if (icon_name == NEUTRINO_ICON_BUTTON_GREEN) f_col = COL_DARK_GREEN; - if (btn_name == NEUTRINO_ICON_BUTTON_YELLOW) + if (icon_name == NEUTRINO_ICON_BUTTON_YELLOW) f_col = COL_OLIVE; - if (btn_name == NEUTRINO_ICON_BUTTON_BLUE) + if (icon_name == NEUTRINO_ICON_BUTTON_BLUE) f_col = COL_DARK_BLUE; btn->setColorFrame(f_col); } From d75b4dea831a657df4038b02380255cdc43bbcbb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 1 Sep 2016 08:27:14 +0200 Subject: [PATCH 35/41] CFrameBuffer: add debug warning if radius < 0 Radius < 0 causes for wrong rendering. paintBoxFrame() gets confused. This will paint partial outside of frame area. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0eca61b71e190b80221cb687b6d01bb2d8dec41c Author: Thilo Graf Date: 2016-09-01 (Thu, 01 Sep 2016) --- src/driver/framebuffer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index c1877bb2d..c12d6a703 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -1381,9 +1381,11 @@ void CFrameBuffer::paintBoxFrame(const int x, const int y, const int dx, const i return; if (dx == 0 || dy == 0) { - printf("paintBoxFrame: radius %d, start x %d y %d end x %d y %d\n", radius, x, y, x+dx, y+dy); + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: radius %d, start x %d y %d end x %d y %d\n", __func__, __LINE__, radius, x, y, x+dx, y+dy); return; } + if (radius < 0) + dprintf(DEBUG_NORMAL, "[CFrameBuffer] [%s - %d]: WARNING! radius < 0 [%d] FIXIT\n", __func__, __LINE__, radius); setCornerFlags(type); int rad_tl = 0, rad_tr = 0, rad_bl = 0, rad_br = 0; From 85a8f0e8969b174dc4caa41ff98137d5365f99ff Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 6 Sep 2016 20:19:20 +0200 Subject: [PATCH 36/41] CCDraw: add member to get current shadow width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1caa54d6abba97071985671630d692e551a34c00 Author: Thilo Graf Date: 2016-09-06 (Tue, 06 Sep 2016) --- src/gui/components/cc_draw.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 08db89f5e..ae5557d42 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -254,6 +254,8 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void enableShadow(int mode = CC_SHADOW_ON, const int& shadow_width = -1, bool force_paint = false); ///switch shadow off virtual void disableShadow(){enableShadow(CC_SHADOW_OFF);} + ///return current schadow width + int getShadowWidth(){return shadow_w;} ///paint caching for body and shadow, see also cc_paint_cache NOTE: has no effect if paint_bg = false virtual void enablePaintCache(bool enable = true); From e07fe7d1fabf90ada2a7b9b0a22726479f8b3f6b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 14 Sep 2016 00:23:23 +0200 Subject: [PATCH 37/41] pzapit: fix change video mode; tell neutrino about the new value Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d1710bb07f01944e261df13e4dd9a90d5bce2e1 Author: vanhofen Date: 2016-09-14 (Wed, 14 Sep 2016) Origin message was: ------------------ - pzapit: fix change video mode; tell neutrino about the new value --- src/neutrino.h | 2 ++ src/zapit/src/zapit.cpp | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/neutrino.h b/src/neutrino.h index 151aadd2b..1b15140ea 100644 --- a/src/neutrino.h +++ b/src/neutrino.h @@ -242,6 +242,8 @@ public: sigc::signal OnBeforeRestart; sigc::signal OnAfterSetupFonts; void channelRezap(); + + void g_settings_video_Mode(int value) { g_settings.video_Mode = value; } }; #endif diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 6cf7d90d5..432e19e00 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -75,6 +75,8 @@ #include #include +#include + /* globals */ int sig_delay = 2; // seconds between signal check @@ -1653,14 +1655,13 @@ bool CZapit::ParseCommand(CBasicMessage::Header &rmsg, int connfd) } break; } -#if 0 case CZapitMessages::CMD_SET_VIDEO_SYSTEM: { CZapitMessages::commandInt msg; CBasicServer::receive_data(connfd, &msg, sizeof(msg)); videoDecoder->SetVideoSystem(msg.val); + CNeutrinoApp::getInstance()->g_settings_video_Mode(msg.val); break; } -#endif #if 0 case CZapitMessages::CMD_SET_NTSC: { videoDecoder->SetVideoSystem(8); From 23f523a8d08393eb4160202ba18e263930858cb3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 15 Sep 2016 00:46:15 +0200 Subject: [PATCH 38/41] src/zapit/src/Makefile.am: add @FREETYPE_CFLAGS@ to avoid build fails Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c3aee2b1146a7dceff0a8a95b83e0eae215b9f5 Author: vanhofen Date: 2016-09-15 (Thu, 15 Sep 2016) Origin message was: ------------------ - src/zapit/src/Makefile.am: add @FREETYPE_CFLAGS@ to avoid build fails --- src/zapit/src/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/src/zapit/src/Makefile.am b/src/zapit/src/Makefile.am index 9ece8df27..a1dac17bc 100644 --- a/src/zapit/src/Makefile.am +++ b/src/zapit/src/Makefile.am @@ -10,6 +10,7 @@ AM_CPPFLAGS += \ -I$(top_srcdir)/lib/connection \ -I$(top_srcdir)/lib/libeventserver \ -I$(top_srcdir)/lib/xmltree \ + @FREETYPE_CFLAGS@ \ @HWLIB_CFLAGS@ noinst_LIBRARIES = libzapit.a From 13901562504613fdccf85410c89a3dbf0d9c9bb0 Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 15 Sep 2016 00:48:06 +0200 Subject: [PATCH 39/41] [experimental] timerd: adjust recording timers to epg Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fe2d3517500294dcc6c85d98a1d077e1a3c2fc71 Author: martii Date: 2016-09-15 (Thu, 15 Sep 2016) --- lib/timerdclient/timerdclient.cpp | 1 + lib/timerdclient/timerdclient.h | 4 ++- lib/timerdclient/timerdtypes.h | 4 +++ src/gui/epgview.cpp | 4 +-- src/gui/followscreenings.cpp | 2 +- src/gui/timerlist.cpp | 2 ++ src/timerd/timerd.cpp | 4 ++- src/timerd/timermanager.cpp | 53 ++++++++++++++++++++++++++++++- src/timerd/timermanager.h | 7 +++- 9 files changed, 74 insertions(+), 7 deletions(-) diff --git a/lib/timerdclient/timerdclient.cpp b/lib/timerdclient/timerdclient.cpp index 0368e7011..c0783f295 100644 --- a/lib/timerdclient/timerdclient.cpp +++ b/lib/timerdclient/timerdclient.cpp @@ -330,6 +330,7 @@ int CTimerdClient::addTimerEvent( CTimerd::CTimerEventTypes evType, void* data, tri.epg_starttime = ri->epg_starttime; tri.epgID = ri->epgID; tri.recordingSafety = ri->recordingSafety; + tri.autoAdjustToEPG = ri->autoAdjustToEPG; tri.channel_ci = ri->channel_ci; //NI strncpy(tri.recordingDir, ri->recordingDir, RECORD_DIR_MAXLEN-1); length = sizeof( CTimerd::TransferRecordingInfo); diff --git a/lib/timerdclient/timerdclient.h b/lib/timerdclient/timerdclient.h index acd5cedf5..40ee5a06f 100644 --- a/lib/timerdclient/timerdclient.h +++ b/lib/timerdclient/timerdclient.h @@ -111,7 +111,7 @@ class CTimerdClient:private CBasicClient // adds new record timer event int addRecordTimerEvent(const t_channel_id channel_id, time_t alarmtime, time_t stoptime, uint64_t epgID=0, time_t epg_starttime=0, time_t announcetime = 0, - unsigned char apids=TIMERD_APIDS_STD, bool safety=false,std::string recDir="", bool forceAdd=true, bool channel_ci=false) //NI + unsigned char apids=TIMERD_APIDS_STD, bool safety=false,bool autoAdjust=false, std::string recDir="", bool forceAdd=true, bool channel_ci=false) //NI { CTimerd::RecordingInfo eventInfo; eventInfo.channel_id = channel_id; @@ -119,6 +119,7 @@ class CTimerdClient:private CBasicClient eventInfo.epg_starttime = epg_starttime; eventInfo.apids = apids; eventInfo.recordingSafety = safety; + eventInfo.autoAdjustToEPG = autoAdjust; eventInfo.channel_ci = channel_ci; //NI strncpy(eventInfo.recordingDir, recDir.c_str(), RECORD_DIR_MAXLEN); return addTimerEvent(CTimerd::TIMER_RECORD, &eventInfo, announcetime, alarmtime, stoptime,CTimerd::TIMERREPEAT_ONCE, 0,forceAdd); @@ -133,6 +134,7 @@ class CTimerdClient:private CBasicClient eventInfo.epg_starttime = epg_starttime; eventInfo.apids = apids; eventInfo.recordingSafety = false; + eventInfo.autoAdjustToEPG = false; return addTimerEvent(CTimerd::TIMER_IMMEDIATE_RECORD, &eventInfo, 0, alarmtime, stoptime); }; diff --git a/lib/timerdclient/timerdtypes.h b/lib/timerdclient/timerdtypes.h index 8c7ab2432..56e24651a 100644 --- a/lib/timerdclient/timerdtypes.h +++ b/lib/timerdclient/timerdtypes.h @@ -87,6 +87,7 @@ class CTimerd t_channel_id channel_id; unsigned char apids; bool recordingSafety; + bool autoAdjustToEPG; bool channel_ci; //NI - channel is member of CI bouquet? }; @@ -97,6 +98,7 @@ class CTimerd t_channel_id channel_id; unsigned char apids; bool recordingSafety; + bool autoAdjustToEPG; bool channel_ci; //NI - channel is member of CI bouquet? }; @@ -118,6 +120,7 @@ class CTimerd epgID = e.epgID; epg_starttime = e.epg_starttime; recordingSafety = e.recordingSafety; + autoAdjustToEPG = e.autoAdjustToEPG; channel_ci = e.channel_ci; //NI }; RecordingInfo& operator = (EventInfo& e) @@ -127,6 +130,7 @@ class CTimerd epgID = e.epgID; epg_starttime = e.epg_starttime; recordingSafety = e.recordingSafety; + autoAdjustToEPG = e.autoAdjustToEPG; channel_ci = e.channel_ci; //NI return *this; } diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 20b4f0be1..6fbe5cc09 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1170,7 +1170,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, recDir,false) == -1) + TIMERD_APIDS_CONF, true, true, recDir, false) == -1) { if (askUserOnTimerConflict(epgData.epg_times.startzeit - (ANNOUNCETIME + 120), epgData.epg_times.startzeit + epgData.epg_times.dauer)) @@ -1180,7 +1180,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, recDir,true); + TIMERD_APIDS_CONF, true, true, recDir, true); ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index 30034fd56..d286f54a4 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -111,7 +111,7 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); if (g_Timerd->addRecordTimerEvent(channel_id, e->startTime, e->startTime + e->duration, e->eventID, - e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, recDir, true, ch->bUseCI) == -1) { //NI + e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, true, recDir, true, ch->bUseCI) == -1) { //NI //FIXME -- no error handling, but this shouldn't happen ... } else { #if 0 diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index fcc76fdb4..35e435954 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -316,6 +316,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) eventinfo.channel_id=timerNew.channel_id; eventinfo.apids = TIMERD_APIDS_CONF; eventinfo.recordingSafety = false; + eventinfo.autoAdjustToEPG = true; timerNew.standby_on = (timerNew_standby_on == 1); void *data=NULL; if (timerNew.eventType == CTimerd::TIMER_STANDBY) @@ -333,6 +334,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) recinfo.channel_id=timerNew.channel_id; recinfo.apids=TIMERD_APIDS_CONF; recinfo.recordingSafety = false; + recinfo.autoAdjustToEPG = true; // FIXME -- add GUI option? timerNew.announceTime-= 120; // 2 more mins for rec timer strncpy(recinfo.recordingDir,timerNew.recordingDir,sizeof(recinfo.recordingDir)-1); diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index c6b639826..c1661b305 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -305,7 +305,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CTimerd::TransferRecordingInfo recInfo; CBasicServer::receive_data(connfd, &recInfo, sizeof(CTimerd::TransferRecordingInfo)); - if(recInfo.recordingSafety) + if(recInfo.recordingSafety) { int pre,post; CTimerManager::getInstance()->getRecordingSafety(pre,post); @@ -324,6 +324,8 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) msgAddTimer.eventRepeat, msgAddTimer.repeatCount, recInfo.recordingDir, + recInfo.recordingSafety, + recInfo.autoAdjustToEPG, recInfo.channel_ci); //NI rspAddTimer.eventID = CTimerManager::getInstance()->addEvent(event); diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 5ee767e2c..76f70032e 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1134,7 +1134,9 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, event_id_t epgID, time_t epg_starttime, unsigned char apids, CTimerd::CTimerEventRepeat evrepeat, - uint32_t repeatcount, const std::string &recDir, bool channel_ci) : //NI + uint32_t repeatcount, const std::string &recDir, + bool _recordingSafety, bool _autoAdjustToEPG, + bool channel_ci) : //NI CTimerEvent(getEventType(), announce_Time, alarm_Time, stop_Time, evrepeat, repeatcount) { eventInfo.epgID = epgID; @@ -1144,6 +1146,8 @@ CTimerEvent_Record::CTimerEvent_Record(time_t announce_Time, time_t alarm_Time, eventInfo.channel_ci = channel_ci; //NI recordingDir = recDir; epgTitle=""; + autoAdjustToEPG = _autoAdjustToEPG; + recordingSafety = _recordingSafety; CShortEPGData epgdata; if (CEitManager::getInstance()->getEPGidShort(epgID, &epgdata)) epgTitle=epgdata.title; @@ -1173,6 +1177,13 @@ CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): epgTitle = config->getString("EPG_TITLE_"+id); dprintf("read EPG_TITLE_%s %s (%p)\n",id.c_str(),epgTitle.c_str(),&epgTitle); + + recordingSafety = config->getInt32("RECORDING_SAFETY_"+id, true); + dprintf("read RECORDING_SAFETY_%s %d\n",id.c_str(), recordingSafety); + + autoAdjustToEPG = config->getInt32("EPG_AUTO_ADJUST_"+id, true); + dprintf("read EPG_AUTO_ADJUST_TO_EPG_%s %d\n",id.c_str(), autoAdjustToEPG); + //NI eventInfo.channel_ci = config->getBool("EVENT_INFO_CHANNEL_CI_"+id); dprintf("read EVENT_INFO_CHANNEL_CI_%s %i\n",id.c_str(),eventInfo.channel_ci); @@ -1180,6 +1191,8 @@ CTimerEvent_Record::CTimerEvent_Record(CConfigFile *config, int iId): //------------------------------------------------------------ void CTimerEvent_Record::fireEvent() { + if (adjustToCurrentEPG()) + return; Refresh(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; @@ -1194,6 +1207,8 @@ void CTimerEvent_Record::fireEvent() //------------------------------------------------------------ void CTimerEvent_Record::announceEvent() { + if (adjustToCurrentEPG()) + return; Refresh(); CTimerd::RecordingInfo ri=eventInfo; ri.eventID=eventID; @@ -1242,6 +1257,13 @@ void CTimerEvent_Record::saveToConfig(CConfigFile *config) config->setString("EPG_TITLE_"+id,epgTitle); dprintf("set EPG_TITLE_%s to %s (%p)\n",id.c_str(),epgTitle.c_str(), &epgTitle); + + config->setInt32("RECORDING_SAFETY_"+id, recordingSafety); + dprintf("set RECORDING_SAFETY_%s to %d\n",id.c_str(), recordingSafety); + + config->setInt32("EPG_AUTO_ADJUST_"+id, autoAdjustToEPG); + dprintf("set EPG_AUTO_ADJUST_TO_EPG_%s to %d\n",id.c_str(), autoAdjustToEPG); + //NI config->setBool("EVENT_INFO_CHANNEL_CI_"+id, eventInfo.channel_ci); dprintf("set EVENT_INFO_CHANNEL_CI_%s to %i\n",id.c_str(),eventInfo.channel_ci); @@ -1286,6 +1308,35 @@ void CTimerEvent_Record::Refresh() if (eventInfo.epgID == 0) getEpgId(); } +//------------------------------------------------------------ +bool CTimerEvent_Record::adjustToCurrentEPG() +{ + CChannelEventList evtlist; + CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); + + time_t now = time(NULL); + CChannelEventList::iterator first = evtlist.end(); + for (CChannelEventList::iterator e = evtlist.begin(); e != evtlist.end(); ++e) + { + if (e->startTime < now) + continue; + if (first == evtlist.end() || first->startTime > e->startTime) + first = e; + if (alarmTime <= e->startTime && e->startTime + (int)e->duration <= stopTime) + return false; + } + if (first == evtlist.end()) + return false; + + CTimerEvent_Record *event= new CTimerEvent_Record(first->startTime - (alarmTime - announceTime), first->startTime, first->startTime + first->duration, + eventInfo.channel_id, eventInfo.epgID, first->startTime, eventInfo.apids, + CTimerd::TIMERREPEAT_ONCE, 1, recordingDir, recordingSafety, autoAdjustToEPG, + eventInfo.channel_ci); //NI + CTimerManager::getInstance()->addEvent(event,false); + setState(CTimerd::TIMERSTATE_HASFINISHED); + + return true; +} //============================================================= // Zapto Event //============================================================= diff --git a/src/timerd/timermanager.h b/src/timerd/timermanager.h index 84f8a1af9..fbae3f2d0 100644 --- a/src/timerd/timermanager.h +++ b/src/timerd/timermanager.h @@ -117,13 +117,17 @@ class CTimerEvent_Record : public CTimerEvent CTimerd::EventInfo eventInfo; std::string recordingDir; std::string epgTitle; + bool recordingSafety; + bool autoAdjustToEPG; CTimerEvent_Record(time_t announceTime, time_t alarmTime, time_t stopTime, t_channel_id channel_id, event_id_t epgID = 0, time_t epg_starttime = 0, unsigned char apids = TIMERD_APIDS_STD, CTimerd::CTimerEventRepeat evrepeat = CTimerd::TIMERREPEAT_ONCE, - uint32_t repeatcount = 1, const std::string &recDir = "", bool channel_ci=false); //NI + uint32_t repeatcount = 1, const std::string &recDir = "", + bool _recordingSafety = true, bool _autoAdjustToEPG = true, + bool channel_ci=false); //NI CTimerEvent_Record(CConfigFile *config, int iId); virtual ~CTimerEvent_Record(){}; virtual CTimerd::CTimerEventTypes getEventType(void) const { return CTimerd::TIMER_RECORD; }; @@ -134,6 +138,7 @@ class CTimerEvent_Record : public CTimerEvent virtual void Reschedule(); virtual void getEpgId(); virtual void Refresh(); + virtual bool adjustToCurrentEPG(); }; class CTimerEvent_Zapto : public CTimerEvent_Record From 7d4fb5b880f5bb716baebead14b7ce95161b9062 Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 15 Sep 2016 00:51:01 +0200 Subject: [PATCH 40/41] timerd/timermanager: fix EPG auto-adjustment of recordings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/659f2b372df0cec64b305ac82b29744ad8f8d48c Author: martii Date: 2016-09-15 (Thu, 15 Sep 2016) --- src/gui/epgview.cpp | 4 ++-- src/gui/followscreenings.cpp | 2 +- src/timerd/timermanager.cpp | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 6fbe5cc09..4a65e8944 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -1170,7 +1170,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, true, recDir, false) == -1) + TIMERD_APIDS_CONF, true, epgData.epg_times.startzeit - (ANNOUNCETIME + 120) > time(NULL), recDir, false) == -1) { if (askUserOnTimerConflict(epgData.epg_times.startzeit - (ANNOUNCETIME + 120), epgData.epg_times.startzeit + epgData.epg_times.dauer)) @@ -1180,7 +1180,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start epgData.epg_times.startzeit + epgData.epg_times.dauer, epgData.eventID, epgData.epg_times.startzeit, epgData.epg_times.startzeit - (ANNOUNCETIME + 120 ), - TIMERD_APIDS_CONF, true, true, recDir, true); + TIMERD_APIDS_CONF, true, epgData.epg_times.startzeit - (ANNOUNCETIME + 120) > time(NULL), recDir, true); ShowMsg(LOCALE_TIMER_EVENTRECORD_TITLE, LOCALE_TIMER_EVENTRECORD_MSG, CMessageBox::mbrBack, CMessageBox::mbBack, NEUTRINO_ICON_INFO); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } diff --git a/src/gui/followscreenings.cpp b/src/gui/followscreenings.cpp index d286f54a4..475b8cdc4 100644 --- a/src/gui/followscreenings.cpp +++ b/src/gui/followscreenings.cpp @@ -111,7 +111,7 @@ int CFollowScreenings::exec(CMenuTarget* /*parent*/, const std::string & actionK CZapitChannel * ch = CServiceManager::getInstance()->FindChannel(channel_id); if (g_Timerd->addRecordTimerEvent(channel_id, e->startTime, e->startTime + e->duration, e->eventID, - e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, true, recDir, true, ch->bUseCI) == -1) { //NI + e->startTime, e->startTime - (ANNOUNCETIME + 120 ), apids, true, e->startTime - (ANNOUNCETIME + 120) > time(NULL), recDir, true, ch->bUseCI) == -1) { //NI //FIXME -- no error handling, but this shouldn't happen ... } else { #if 0 diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 76f70032e..2547995ac 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1311,6 +1311,9 @@ void CTimerEvent_Record::Refresh() //------------------------------------------------------------ bool CTimerEvent_Record::adjustToCurrentEPG() { + if (!autoAdjustToEPG) + return false; + CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); From 238b7536796491af23e8998c4b43b3e09cfdd475 Mon Sep 17 00:00:00 2001 From: martii Date: Thu, 15 Sep 2016 00:52:17 +0200 Subject: [PATCH 41/41] gui/timerlist: don't auto-adjust manually-added timer to EPG (untested) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ca49f488cda22e7733531b70403ed8074af75aae Author: martii Date: 2016-09-15 (Thu, 15 Sep 2016) --- src/gui/timerlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 35e435954..d954370fb 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -316,7 +316,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) eventinfo.channel_id=timerNew.channel_id; eventinfo.apids = TIMERD_APIDS_CONF; eventinfo.recordingSafety = false; - eventinfo.autoAdjustToEPG = true; + eventinfo.autoAdjustToEPG = false; timerNew.standby_on = (timerNew_standby_on == 1); void *data=NULL; if (timerNew.eventType == CTimerd::TIMER_STANDBY) @@ -334,7 +334,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) recinfo.channel_id=timerNew.channel_id; recinfo.apids=TIMERD_APIDS_CONF; recinfo.recordingSafety = false; - recinfo.autoAdjustToEPG = true; // FIXME -- add GUI option? + recinfo.autoAdjustToEPG = false; // FIXME -- add GUI option? timerNew.announceTime-= 120; // 2 more mins for rec timer strncpy(recinfo.recordingDir,timerNew.recordingDir,sizeof(recinfo.recordingDir)-1);