gui/moviebrowser.cpp: change marked list to pointers; honor sort order

This commit is contained in:
[CST] Focus
2014-09-22 17:03:02 +04:00
parent 857b9ade83
commit 2003ed670d
5 changed files with 15 additions and 11 deletions

View File

@@ -1243,14 +1243,14 @@ CFile* CMovieBrowser::getSelectedFile(void)
return(NULL);
}
bool CMovieBrowser::getSelectedFiles(CFileList &flist, MI_MOVIE_LIST &mlist)
bool CMovieBrowser::getSelectedFiles(CFileList &flist, P_MI_MOVIE_LIST &mlist)
{
flist.clear();
mlist.clear();
for(unsigned int i = 0; i < m_vMovieInfo.size(); i++) {
if (m_vMovieInfo[i].marked) {
flist.push_back(m_vMovieInfo[i].file);
mlist.push_back(m_vMovieInfo[i]);
for(unsigned int i = 0; i < m_vHandleBrowserList.size(); i++) {
if (m_vHandleBrowserList[i]->marked) {
flist.push_back(m_vHandleBrowserList[i]->file);
mlist.push_back(m_vHandleBrowserList[i]);
}
}
return (!flist.empty());

View File

@@ -338,7 +338,7 @@ class CMovieBrowser : public CMenuTarget
int exec(CMenuTarget* parent, const std::string & actionKey);
std::string getCurrentDir(void); //P1 for FileBrowser compatibility
CFile* getSelectedFile(void); //P1 for FileBrowser compatibility
bool getSelectedFiles(CFileList &flist, MI_MOVIE_LIST &mlist); //P1 for FileBrowser compatibility
bool getSelectedFiles(CFileList &flist, P_MI_MOVIE_LIST &mlist); //P1 for FileBrowser compatibility
MI_MOVIE_BOOKMARKS* getCurrentMovieBookmark(void){if(m_movieSelectionHandler == NULL) return NULL; return(&(m_movieSelectionHandler->bookmarks));};
int getCurrentStartPos(void){return(m_currentStartPos);}; //P1 return start position in [s]
MI_MOVIE_INFO* getCurrentMovieInfo(void){return(m_movieSelectionHandler);}; //P1 return start position in [s]

View File

@@ -176,6 +176,7 @@ typedef struct
} MI_MOVIE_INFO;
typedef std::vector<MI_MOVIE_INFO> MI_MOVIE_LIST;
typedef std::vector<MI_MOVIE_INFO*> P_MI_MOVIE_LIST;
class CMovieInfo
{

View File

@@ -434,7 +434,7 @@ bool CMoviePlayerGui::prepareFile(CFile *file)
if (isMovieBrowser) {
if (filelist_it != filelist.end()) {
unsigned idx = filelist_it - filelist.begin();
p_movie_info = &milist[idx];
p_movie_info = milist[idx];
}
if (isYT) {
file_name = file->Url;
@@ -492,7 +492,7 @@ bool CMoviePlayerGui::SelectFile()
filelist_it = filelist.end();
if (moviebrowser->getSelectedFiles(filelist, milist)) {
filelist_it = filelist.begin();
p_movie_info = &(*milist.begin());
p_movie_info = *(milist.begin());
file = &(*filelist_it);
}
else if ((file = moviebrowser->getSelectedFile()) != NULL) {
@@ -690,8 +690,11 @@ bool CMoviePlayerGui::PlayFileStart(void)
printf("IS FILE PLAYER: %s\n", is_file_player ? "true": "false" );
if (p_movie_info) {
if (timeshift != TSHIFT_MODE_OFF) {
// p_movie_info may be invalidated by CRecordManager while we're still using it. Create and use a copy.
movie_info = *p_movie_info;
p_movie_info = &movie_info;
}
duration = p_movie_info->length * 60 * 1000;
int percent = CZapit::getInstance()->GetPidVolume(p_movie_info->epgId, currentapid, currentac3 == 1);

View File

@@ -115,7 +115,7 @@ class CMoviePlayerGui : public CMenuTarget
CMovieBrowser* moviebrowser;
MI_MOVIE_INFO * p_movie_info;
MI_MOVIE_INFO movie_info;
MI_MOVIE_LIST milist;
P_MI_MOVIE_LIST milist;
const static short MOVIE_HINT_BOX_TIMER = 5; // time to show bookmark hints in seconds
/* playback from file */