From b0c0c3bd053bb6f574e81a4ada1df5c198cecbfe Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 11 Aug 2016 16:34:00 +0200 Subject: [PATCH 1/5] 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 2/5] 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 3/5] 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 4/5] 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 5/5] 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);