mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
Merge branch 'cst-next' of git://coolstreamtech.de/cst-public-gui-neutrino into ni/cst-next
Origin commit data
------------------
Branch: ni/coolstream
Commit: 3a43baac7b
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-09-06 (Tue, 06 Sep 2016)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -299,6 +299,7 @@ src/gui/Makefile
|
|||||||
src/gui/bedit/Makefile
|
src/gui/bedit/Makefile
|
||||||
src/gui/components/Makefile
|
src/gui/components/Makefile
|
||||||
src/gui/lua/Makefile
|
src/gui/lua/Makefile
|
||||||
|
src/gui/moviebrowser/Makefile
|
||||||
src/gui/widget/Makefile
|
src/gui/widget/Makefile
|
||||||
src/system/Makefile
|
src/system/Makefile
|
||||||
src/system/mtdutils/Makefile
|
src/system/mtdutils/Makefile
|
||||||
|
@@ -83,6 +83,7 @@ neutrino_LDADD = \
|
|||||||
driver/pictureviewer/libneutrino_pictureviewer.a \
|
driver/pictureviewer/libneutrino_pictureviewer.a \
|
||||||
$(MTDUTILSLIBS) \
|
$(MTDUTILSLIBS) \
|
||||||
gui/movieinfo.o \
|
gui/movieinfo.o \
|
||||||
|
gui/moviebrowser/mb.o \
|
||||||
gui/libneutrino_gui2.a \
|
gui/libneutrino_gui2.a \
|
||||||
gui/components/libneutrino_gui_components.a \
|
gui/components/libneutrino_gui_components.a \
|
||||||
$(LUALIBS) \
|
$(LUALIBS) \
|
||||||
|
@@ -15,7 +15,7 @@ version.h:
|
|||||||
noinst_HEADERS = version.h
|
noinst_HEADERS = version.h
|
||||||
.PHONY: version.h
|
.PHONY: version.h
|
||||||
|
|
||||||
SUBDIRS = bedit components widget
|
SUBDIRS = bedit components moviebrowser widget
|
||||||
|
|
||||||
if ENABLE_LUA
|
if ENABLE_LUA
|
||||||
SUBDIRS += lua
|
SUBDIRS += lua
|
||||||
@@ -72,7 +72,6 @@ libneutrino_gui_a_SOURCES = \
|
|||||||
mediaplayer.cpp \
|
mediaplayer.cpp \
|
||||||
mediaplayer_setup.cpp \
|
mediaplayer_setup.cpp \
|
||||||
miscsettings_menu.cpp \
|
miscsettings_menu.cpp \
|
||||||
moviebrowser.cpp \
|
|
||||||
movieinfo.cpp \
|
movieinfo.cpp \
|
||||||
movieplayer.cpp \
|
movieplayer.cpp \
|
||||||
network_service.cpp \
|
network_service.cpp \
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
#include <gui/followscreenings.h>
|
#include <gui/followscreenings.h>
|
||||||
#include <gui/epgplus.h>
|
#include <gui/epgplus.h>
|
||||||
#include <gui/epgview.h>
|
#include <gui/epgview.h>
|
||||||
#include <gui/moviebrowser.h>
|
#include <gui/moviebrowser/mb.h>
|
||||||
#include <sectionsdclient/sectionsdclient.h>
|
#include <sectionsdclient/sectionsdclient.h>
|
||||||
#include <timerdclient/timerdclient.h>
|
#include <timerdclient/timerdclient.h>
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@
|
|||||||
#include <driver/fade.h>
|
#include <driver/fade.h>
|
||||||
#include <gui/filebrowser.h>
|
#include <gui/filebrowser.h>
|
||||||
#include <gui/followscreenings.h>
|
#include <gui/followscreenings.h>
|
||||||
#include <gui/moviebrowser.h>
|
#include <gui/moviebrowser/mb.h>
|
||||||
#include <gui/movieplayer.h>
|
#include <gui/movieplayer.h>
|
||||||
#include <gui/customcolor.h>
|
#include <gui/customcolor.h>
|
||||||
#include <gui/pictureviewer.h>
|
#include <gui/pictureviewer.h>
|
||||||
|
@@ -34,7 +34,7 @@
|
|||||||
#include <gui/epgplus.h>
|
#include <gui/epgplus.h>
|
||||||
#include <gui/epgview.h>
|
#include <gui/epgview.h>
|
||||||
#include <gui/followscreenings.h>
|
#include <gui/followscreenings.h>
|
||||||
#include <gui/moviebrowser.h>
|
#include <gui/moviebrowser/mb.h>
|
||||||
#include <gui/timerlist.h>
|
#include <gui/timerlist.h>
|
||||||
#include <gui/user_menue.h>
|
#include <gui/user_menue.h>
|
||||||
|
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
#include <gui/audioplayer_setup.h>
|
#include <gui/audioplayer_setup.h>
|
||||||
#include <gui/pictureviewer_setup.h>
|
#include <gui/pictureviewer_setup.h>
|
||||||
#include <gui/webtv_setup.h>
|
#include <gui/webtv_setup.h>
|
||||||
#include <gui/moviebrowser.h>
|
#include <gui/moviebrowser/mb.h>
|
||||||
|
|
||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
|
|
||||||
|
20
src/gui/moviebrowser/Makefile.am
Normal file
20
src/gui/moviebrowser/Makefile.am
Normal file
@@ -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
|
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
Date: Nov 2005
|
Date: Nov 2005
|
||||||
|
|
||||||
Author: Günther@tuxbox.berlios.org
|
Author: Günther@tuxbox.berlios.org
|
||||||
based on code of Steffen Hehn 'McClean'
|
based on code of Steffen Hehn 'McClean'
|
||||||
|
|
||||||
(C) 2009-2014 Stefan Seyfried
|
(C) 2009-2014 Stefan Seyfried
|
||||||
@@ -42,9 +42,10 @@
|
|||||||
#include <driver/screen_max.h>
|
#include <driver/screen_max.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstdlib>
|
//#include <cstdlib>
|
||||||
#include "moviebrowser.h"
|
#include "mb.h"
|
||||||
#include "filebrowser.h"
|
#include "mb_functions.h"
|
||||||
|
#include <gui/filebrowser.h>
|
||||||
#include <gui/tmdb.h>
|
#include <gui/tmdb.h>
|
||||||
#include <gui/epgview.h>
|
#include <gui/epgview.h>
|
||||||
#include <gui/widget/hintbox.h>
|
#include <gui/widget/hintbox.h>
|
||||||
@@ -62,12 +63,12 @@
|
|||||||
#include <sys/vfs.h> // for statfs
|
#include <sys/vfs.h> // for statfs
|
||||||
#include <sys/mount.h>
|
#include <sys/mount.h>
|
||||||
#include <utime.h>
|
#include <utime.h>
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
#include <gui/pictureviewer.h>
|
#include <gui/pictureviewer.h>
|
||||||
#include <gui/customcolor.h>
|
#include <gui/customcolor.h>
|
||||||
#include <driver/record.h>
|
#include <driver/record.h>
|
||||||
#include <driver/display.h>
|
#include <driver/display.h>
|
||||||
#include <system/helpers.h>
|
//#include <system/helpers.h>
|
||||||
#include <system/ytcache.h>
|
#include <system/ytcache.h>
|
||||||
#include <zapit/debug.h>
|
#include <zapit/debug.h>
|
||||||
#include <driver/moviecut.h>
|
#include <driver/moviecut.h>
|
||||||
@@ -234,122 +235,7 @@ static MI_MOVIE_INFO* playing_info;
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
#define FILEBROWSER_NUMBER_OF_SORT_VARIANTS 5
|
#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')
|
CMovieBrowser::CMovieBrowser(): configfile ('\t')
|
||||||
{
|
{
|
||||||
@@ -3090,10 +2976,7 @@ void CMovieBrowser::showHelp(void)
|
|||||||
help.exec(NULL,NULL);
|
help.exec(NULL,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::string rateFormat(int i)
|
|
||||||
{
|
|
||||||
return to_string(i/10) + "," + to_string(i%10);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define MAX_STRING 30
|
#define MAX_STRING 30
|
||||||
int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info)
|
int CMovieBrowser::showMovieInfoMenu(MI_MOVIE_INFO* movie_info)
|
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
Date: Nov 2005
|
Date: Nov 2005
|
||||||
|
|
||||||
Author: Günther@tuxbox.berlios.org
|
Author: Günther@tuxbox.berlios.org
|
||||||
based on code of Steffen Hehn 'McClean'
|
based on code of Steffen Hehn 'McClean'
|
||||||
|
|
||||||
$Log: moviebrowser.h,v $
|
$Log: moviebrowser.h,v $
|
||||||
@@ -69,14 +69,16 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "mb_types.h"
|
||||||
|
|
||||||
#include <configfile.h>
|
#include <configfile.h>
|
||||||
|
|
||||||
#include <string>
|
//#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <gui/widget/listframe.h>
|
|
||||||
#include <gui/widget/menue.h>
|
|
||||||
#include <gui/widget/textbox.h>
|
#include <gui/widget/textbox.h>
|
||||||
|
#include <gui/widget/listframe.h>
|
||||||
#include <gui/movieinfo.h>
|
#include <gui/movieinfo.h>
|
||||||
#include <driver/file.h>
|
#include <driver/file.h>
|
||||||
#include <driver/fb_window.h>
|
#include <driver/fb_window.h>
|
||||||
@@ -92,105 +94,9 @@
|
|||||||
#define MAX_BROWSER_FRAME_HEIGHT 80
|
#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);
|
||||||
|
|
||||||
/* !!!! 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_ROWS LF_MAX_ROWS
|
||||||
#define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES
|
#define MB_MAX_DIRS NETWORK_NFS_NR_OF_ENTRIES
|
||||||
@@ -543,14 +449,7 @@ class CFileChooser : public CMenuWidget
|
|||||||
int exec(CMenuTarget* parent, const std::string & actionKey);
|
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
|
class CDirMenu : public CMenuWidget
|
||||||
{
|
{
|
||||||
@@ -571,90 +470,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_*/
|
#endif /*MOVIEBROWSER_H_*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
138
src/gui/moviebrowser/mb_functions.h
Normal file
138
src/gui/moviebrowser/mb_functions.h
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
|
||||||
|
#ifndef __MB_FUNCTIONS__
|
||||||
|
#define __MB_FUNCTIONS__
|
||||||
|
|
||||||
|
|
||||||
|
#include "mb_types.h"
|
||||||
|
#include <system/helpers.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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__*/
|
198
src/gui/moviebrowser/mb_types.h
Normal file
198
src/gui/moviebrowser/mb_types.h
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
#include <gui/widget/menue.h>
|
||||||
|
|
||||||
|
#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__*/
|
@@ -38,7 +38,7 @@
|
|||||||
#include <gui/filebrowser.h>
|
#include <gui/filebrowser.h>
|
||||||
#include <gui/bookmarkmanager.h>
|
#include <gui/bookmarkmanager.h>
|
||||||
#include <gui/widget/menue.h>
|
#include <gui/widget/menue.h>
|
||||||
#include <gui/moviebrowser.h>
|
#include <gui/moviebrowser/mb.h>
|
||||||
#include <gui/movieinfo.h>
|
#include <gui/movieinfo.h>
|
||||||
#include <gui/widget/hintbox.h>
|
#include <gui/widget/hintbox.h>
|
||||||
#include <gui/timeosd.h>
|
#include <gui/timeosd.h>
|
||||||
|
@@ -664,8 +664,7 @@ std::string& htmlEntityDecode(std::string& text)
|
|||||||
|
|
||||||
CFileHelpers::CFileHelpers()
|
CFileHelpers::CFileHelpers()
|
||||||
{
|
{
|
||||||
FileBufSize = 0xFFFF;
|
FileBufMaxSize = 0xFFFF;
|
||||||
FileBuf = new char[FileBufSize];
|
|
||||||
doCopyFlag = true;
|
doCopyFlag = true;
|
||||||
ConsoleQuiet = false;
|
ConsoleQuiet = false;
|
||||||
clearDebugInfo();
|
clearDebugInfo();
|
||||||
@@ -673,8 +672,21 @@ CFileHelpers::CFileHelpers()
|
|||||||
|
|
||||||
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()
|
CFileHelpers* CFileHelpers::getInstance()
|
||||||
@@ -872,10 +884,13 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/*
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char* FileBuf = NULL;
|
||||||
uint32_t block;
|
uint32_t block;
|
||||||
off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END);
|
off64_t fsizeSrc64 = lseek64(fd1, 0, SEEK_END);
|
||||||
lseek64(fd1, 0, SEEK_SET);
|
lseek64(fd1, 0, SEEK_SET);
|
||||||
if (fsizeSrc64 > 0x7FFFFFF0) { // > 2GB
|
if (fsizeSrc64 > 0x7FFFFFF0) { // > 2GB
|
||||||
|
uint32_t FileBufSize = FileBufMaxSize;
|
||||||
|
FileBuf = initFileBuf(FileBuf, FileBufSize);
|
||||||
off64_t fsize64 = fsizeSrc64;
|
off64_t fsize64 = fsizeSrc64;
|
||||||
block = FileBufSize;
|
block = FileBufSize;
|
||||||
//printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __FUNCTION__, fsizeSrc64, fsizeSrc64);
|
//printf("#####[%s] fsizeSrc64: %lld 0x%010llX - large file\n", __FUNCTION__, fsizeSrc64, fsizeSrc64);
|
||||||
@@ -894,12 +909,15 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/*
|
|||||||
if (fsizeSrc64 != fsizeDst64){
|
if (fsizeSrc64 != fsizeDst64){
|
||||||
close(fd1);
|
close(fd1);
|
||||||
close(fd2);
|
close(fd2);
|
||||||
|
FileBuf = deleteFileBuf(FileBuf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else { // < 2GB
|
else { // < 2GB
|
||||||
off_t fsizeSrc = lseek(fd1, 0, SEEK_END);
|
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);
|
lseek(fd1, 0, SEEK_SET);
|
||||||
off_t fsize = fsizeSrc;
|
off_t fsize = fsizeSrc;
|
||||||
block = FileBufSize;
|
block = FileBufSize;
|
||||||
@@ -919,6 +937,7 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/*
|
|||||||
if (fsizeSrc != fsizeDst){
|
if (fsizeSrc != fsizeDst){
|
||||||
close(fd1);
|
close(fd1);
|
||||||
close(fd2);
|
close(fd2);
|
||||||
|
FileBuf = deleteFileBuf(FileBuf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -929,9 +948,11 @@ bool CFileHelpers::copyFile(const char *Src, const char *Dst, mode_t forceMode/*
|
|||||||
if (!doCopyFlag) {
|
if (!doCopyFlag) {
|
||||||
sync();
|
sync();
|
||||||
unlink(Dst);
|
unlink(Dst);
|
||||||
|
FileBuf = deleteFileBuf(FileBuf);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileBuf = deleteFileBuf(FileBuf);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1054,8 +1075,14 @@ bool CFileHelpers::removeDir(const char *Dir)
|
|||||||
|
|
||||||
dir = opendir(Dir);
|
dir = opendir(Dir);
|
||||||
if (dir == NULL) {
|
if (dir == NULL) {
|
||||||
fh->setDebugInfo("Error opendir().", __path_file__, __func__, __LINE__);
|
if (errno == ENOENT)
|
||||||
fh->printDebugInfo();
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
|
@@ -86,10 +86,11 @@ struct helpersDebugInfo {
|
|||||||
class CFileHelpers
|
class CFileHelpers
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
unsigned long FileBufSize;
|
uint32_t FileBufMaxSize;
|
||||||
char *FileBuf;
|
|
||||||
int fd1, fd2;
|
int fd1, fd2;
|
||||||
|
|
||||||
|
char* initFileBuf(char* buf, uint32_t size);
|
||||||
|
char* deleteFileBuf(char* buf);
|
||||||
bool ConsoleQuiet;
|
bool ConsoleQuiet;
|
||||||
helpersDebugInfo DebugInfo;
|
helpersDebugInfo DebugInfo;
|
||||||
void setDebugInfo(const char* msg, const char* file, const char* func, int line);
|
void setDebugInfo(const char* msg, const char* file, const char* func, int line);
|
||||||
|
Reference in New Issue
Block a user