From 01d5bae77d80d8349dabcb2a8fe33d3a14bc6f96 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 5 Jul 2018 21:38:31 +0200 Subject: [PATCH] moviebrowser: allow to display record time Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/dc735caacec59bf651de1a8a199d4cbe339c7af6 Author: vanhofen Date: 2018-07-05 (Thu, 05 Jul 2018) Origin message was: ------------------ - moviebrowser: allow to display record time ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- data/locale/deutsch.locale | 2 + data/locale/english.locale | 2 + src/gui/moviebrowser/mb.cpp | 61 +++++++++++++++++------------ src/gui/moviebrowser/mb_functions.h | 3 +- src/gui/moviebrowser/mb_types.h | 3 +- src/system/locals.h | 2 + src/system/locals_intern.h | 2 + 7 files changed, 48 insertions(+), 27 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 46d0b5622..00b34d888 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1962,6 +1962,7 @@ moviebrowser.info_prodyear Jahr moviebrowser.info_quality Qualität moviebrowser.info_rating Bewertung moviebrowser.info_recorddate Aufnahmedatum +moviebrowser.info_recordtime Aufnahmezeit moviebrowser.info_serie Serie moviebrowser.info_size Dateigröße (MB) moviebrowser.info_spacer Abstandshalter @@ -2012,6 +2013,7 @@ moviebrowser.short_prodyear Jahr moviebrowser.short_quality Qualität moviebrowser.short_rating Vote moviebrowser.short_recorddate Datum +moviebrowser.short_recordtime Zeit moviebrowser.short_serie Serie moviebrowser.short_size Größe moviebrowser.short_spacer diff --git a/data/locale/english.locale b/data/locale/english.locale index a58e74a5c..b9e8f36c7 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1962,6 +1962,7 @@ moviebrowser.info_prodyear Year moviebrowser.info_quality Quality moviebrowser.info_rating Rating moviebrowser.info_recorddate Record date +moviebrowser.info_recordtime Record time moviebrowser.info_serie Serie moviebrowser.info_size File size (MB) moviebrowser.info_spacer Spacer @@ -2012,6 +2013,7 @@ moviebrowser.short_prodyear Year moviebrowser.short_quality * (quality) moviebrowser.short_rating Vote moviebrowser.short_recorddate Date +moviebrowser.short_recordtime Time moviebrowser.short_serie Serie moviebrowser.short_size MB moviebrowser.short_spacer diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 0a363fe44..3ba81c3e0 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -91,7 +91,7 @@ typedef struct dirent64 dirent_struct; #define NUMBER_OF_MOVIES_LAST 40 // This is the number of movies shown in last recored and last played list #define MOVIE_SMSKEY_TIMEOUT 800 -#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 22 +#define MESSAGEBOX_BROWSER_ROW_ITEM_COUNT 23 const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ROW_ITEM_COUNT] = { { MB_INFO_FILENAME, LOCALE_MOVIEBROWSER_INFO_FILENAME }, @@ -115,6 +115,7 @@ const CMenuOptionChooser::keyval MESSAGEBOX_BROWSER_ROW_ITEM[MESSAGEBOX_BROWSER_ { MB_INFO_LENGTH, LOCALE_MOVIEBROWSER_INFO_LENGTH }, { MB_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SIZE }, { MB_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RATING }, + { MB_INFO_RECORDTIME, LOCALE_MOVIEBROWSER_INFO_RECORDTIME }, { MB_INFO_SPACER, LOCALE_MOVIEBROWSER_INFO_SPACER } }; @@ -180,6 +181,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = LOCALE_MOVIEBROWSER_SHORT_SIZE, LOCALE_MOVIEBROWSER_SHORT_RATING, LOCALE_MOVIEBROWSER_SHORT_SPACER, + LOCALE_MOVIEBROWSER_SHORT_RECORDTIME, NONEXISTANT_LOCALE }; @@ -206,6 +208,7 @@ const neutrino_locale_t m_localizedItemName[MB_INFO_MAX_NUMBER+1] = #define MB_ROW_WIDTH_SIZE 12 #define MB_ROW_WIDTH_RATING 5 #define MB_ROW_WIDTH_SPACER 1 +#define MB_ROW_WIDTH_RECORDTIME 10 const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = { @@ -231,6 +234,7 @@ const int m_defaultRowWidth[MB_INFO_MAX_NUMBER+1] = MB_ROW_WIDTH_SIZE, MB_ROW_WIDTH_RATING, MB_ROW_WIDTH_SPACER, + MB_ROW_WIDTH_RECORDTIME, 0 //MB_ROW_WIDTH_MAX_NUMBER }; static MI_MOVIE_INFO* playing_info; @@ -3780,45 +3784,45 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite switch(item) { - case MB_INFO_FILENAME: // = 0, + case MB_INFO_FILENAME: // = 0, *item_string = movie_info.file.getFileName(); break; - case MB_INFO_FILEPATH: // = 1, + case MB_INFO_FILEPATH: // = 1, if (!m_dirNames.empty()) *item_string = m_dirNames[movie_info.dirItNr]; break; - case MB_INFO_TITLE: // = 2, + case MB_INFO_TITLE: // = 2, *item_string = movie_info.epgTitle; if (strcmp("not available",movie_info.epgTitle.c_str()) == 0) result = false; if (movie_info.epgTitle.empty()) result = false; break; - case MB_INFO_SERIE: // = 3, + case MB_INFO_SERIE: // = 3, *item_string = movie_info.serieName; break; - case MB_INFO_INFO1: // = 4, + case MB_INFO_INFO1: // = 4, *item_string = movie_info.epgInfo1; break; - case MB_INFO_MAJOR_GENRE: // = 5, + case MB_INFO_MAJOR_GENRE: // = 5, snprintf(str_tmp, sizeof(str_tmp),"%2d",movie_info.genreMajor); *item_string = str_tmp; break; - case MB_INFO_MINOR_GENRE: // = 6, + case MB_INFO_MINOR_GENRE: // = 6, snprintf(str_tmp, sizeof(str_tmp),"%2d",movie_info.genreMinor); *item_string = str_tmp; break; - case MB_INFO_INFO2: // = 7, + case MB_INFO_INFO2: // = 7, *item_string = movie_info.epgInfo2; break; - case MB_INFO_PARENTAL_LOCKAGE: // = 8, + case MB_INFO_PARENTAL_LOCKAGE: // = 8, snprintf(str_tmp, sizeof(str_tmp),"%2d",movie_info.parentalLockAge); *item_string = str_tmp; break; - case MB_INFO_CHANNEL: // = 9, + case MB_INFO_CHANNEL: // = 9, *item_string = movie_info.channelName; break; - case MB_INFO_BOOKMARK: // = 10, + case MB_INFO_BOOKMARK: // = 10, b = ""; s = false; @@ -3855,11 +3859,11 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = b; break; - case MB_INFO_QUALITY: // = 11, + case MB_INFO_QUALITY: // = 11, snprintf(str_tmp, sizeof(str_tmp),"%d",movie_info.quality); *item_string = str_tmp; break; - case MB_INFO_PREVPLAYDATE: // = 12, + case MB_INFO_PREVPLAYDATE: // = 12, if (movie_info.dateOfLastPlay == 0) { *item_string = "---"; @@ -3871,8 +3875,7 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; } break; - - case MB_INFO_RECORDDATE: // = 13, + case MB_INFO_RECORDDATE: // = 13, if (show_mode == MB_SHOW_YT) { *item_string = movie_info.ytdate; } else { @@ -3881,40 +3884,48 @@ bool CMovieBrowser::getMovieInfoItem(MI_MOVIE_INFO& movie_info, MB_INFO_ITEM ite *item_string = str_tmp; } break; - case MB_INFO_PRODDATE: // = 14, + case MB_INFO_PRODDATE: // = 14, snprintf(str_tmp, sizeof(str_tmp),"%d",movie_info.productionDate); *item_string = str_tmp; break; - case MB_INFO_COUNTRY: // = 15, + case MB_INFO_COUNTRY: // = 15, *item_string = movie_info.productionCountry; break; - case MB_INFO_GEOMETRIE: // = 16, + case MB_INFO_GEOMETRIE: // = 16, result = false; break; - case MB_INFO_AUDIO: // = 17, + case MB_INFO_AUDIO: // = 17, // we just return the number of audiopids snprintf(str_tmp, sizeof(str_tmp), "%d", (int)movie_info.audioPids.size()); *item_string = str_tmp; break; - case MB_INFO_LENGTH: // = 18, + case MB_INFO_LENGTH: // = 18, snprintf(str_tmp, sizeof(str_tmp),"%dh %02dm", movie_info.length/60, movie_info.length%60); *item_string = str_tmp; break; - case MB_INFO_SIZE: // = 19, + case MB_INFO_SIZE: // = 19, snprintf(str_tmp, sizeof(str_tmp),"%4" PRIu64 "",movie_info.file.Size>>20); *item_string = str_tmp; break; - case MB_INFO_RATING: // = 20, + case MB_INFO_RATING: // = 20, if (movie_info.rating) { snprintf(str_tmp, sizeof(str_tmp),"%d,%d",movie_info.rating/10, movie_info.rating%10); *item_string = str_tmp; } break; - case MB_INFO_SPACER: // = 21, + case MB_INFO_SPACER: // = 21, *item_string=""; break; - case MB_INFO_MAX_NUMBER: // = 22 + case MB_INFO_RECORDTIME: // = 22, + if (show_mode == MB_SHOW_RECORDS) + { + tm_tmp = localtime(&movie_info.file.Time); + snprintf(str_tmp, sizeof(str_tmp),"%02d:%02d", tm_tmp->tm_hour, tm_tmp->tm_min); + *item_string = str_tmp; + } + break; + case MB_INFO_MAX_NUMBER: // = 23 default: *item_string=""; result = false; diff --git a/src/gui/moviebrowser/mb_functions.h b/src/gui/moviebrowser/mb_functions.h index b83a9b405..32664f047 100644 --- a/src/gui/moviebrowser/mb_functions.h +++ b/src/gui/moviebrowser/mb_functions.h @@ -162,7 +162,8 @@ bool (* const sortBy[MB_INFO_MAX_NUMBER+1])(const MI_MOVIE_INFO* a, const MI_MOV &sortBySize, //MB_INFO_SIZE = 19, &sortByRating, //MB_INFO_RATING = 20, NULL, //MB_INFO_SPACER = 21, - NULL //MB_INFO_MAX_NUMBER = 22 + NULL, //MB_INFO_RECORDTIME = 22, + NULL //MB_INFO_MAX_NUMBER = 23 }; #endif /*__MB_FUNCTIONS__*/ diff --git a/src/gui/moviebrowser/mb_types.h b/src/gui/moviebrowser/mb_types.h index 30ba01b93..0cd735cb2 100644 --- a/src/gui/moviebrowser/mb_types.h +++ b/src/gui/moviebrowser/mb_types.h @@ -67,7 +67,8 @@ typedef enum MB_INFO_SIZE = 19, MB_INFO_RATING = 20, MB_INFO_SPACER = 21, - MB_INFO_MAX_NUMBER = 22 // MUST be allways the last item in the list + MB_INFO_RECORDTIME = 22, + MB_INFO_MAX_NUMBER = 23 // MUST be allways the last item in the list }MB_INFO_ITEM; typedef enum diff --git a/src/system/locals.h b/src/system/locals.h index 8c4fee0fe..4ff15fb29 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1989,6 +1989,7 @@ typedef enum LOCALE_MOVIEBROWSER_INFO_QUALITY, LOCALE_MOVIEBROWSER_INFO_RATING, LOCALE_MOVIEBROWSER_INFO_RECORDDATE, + LOCALE_MOVIEBROWSER_INFO_RECORDTIME, LOCALE_MOVIEBROWSER_INFO_SERIE, LOCALE_MOVIEBROWSER_INFO_SIZE, LOCALE_MOVIEBROWSER_INFO_SPACER, @@ -2039,6 +2040,7 @@ typedef enum LOCALE_MOVIEBROWSER_SHORT_QUALITY, LOCALE_MOVIEBROWSER_SHORT_RATING, LOCALE_MOVIEBROWSER_SHORT_RECORDDATE, + LOCALE_MOVIEBROWSER_SHORT_RECORDTIME, LOCALE_MOVIEBROWSER_SHORT_SERIE, LOCALE_MOVIEBROWSER_SHORT_SIZE, LOCALE_MOVIEBROWSER_SHORT_SPACER, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 5b4c948a3..d07bfd852 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1989,6 +1989,7 @@ const char * locale_real_names[] = "moviebrowser.info_quality", "moviebrowser.info_rating", "moviebrowser.info_recorddate", + "moviebrowser.info_recordtime", "moviebrowser.info_serie", "moviebrowser.info_size", "moviebrowser.info_spacer", @@ -2039,6 +2040,7 @@ const char * locale_real_names[] = "moviebrowser.short_quality", "moviebrowser.short_rating", "moviebrowser.short_recorddate", + "moviebrowser.short_recordtime", "moviebrowser.short_serie", "moviebrowser.short_size", "moviebrowser.short_spacer",