diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index e7de13fa2..201ab47e4 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -78,7 +78,7 @@ extern t_channel_id live_channel_id; //zapit #define LEFT_OFFSET 5 -static event_id_t last_curr_id = 0, last_next_id = 0; +event_id_t CInfoViewer::last_curr_id = 0, CInfoViewer::last_next_id = 0; extern CZapitClient::SatelliteList satList; diff --git a/src/gui/infoviewer.h b/src/gui/infoviewer.h index c3a783a40..23c251c4b 100644 --- a/src/gui/infoviewer.h +++ b/src/gui/infoviewer.h @@ -101,6 +101,8 @@ class CInfoViewer bool newfreq ; char old_timestr[10]; static const short bar_width = 72; + static event_id_t last_curr_id, last_next_id; + CChannelEventList evtlist; CChannelEventList::iterator eli; diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index ab699f416..a9b651bca 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -69,7 +69,6 @@ #include extern CPictureViewer * g_PicViewer; - static CProgressBar *timescale; #define my_scandir scandir64 @@ -82,7 +81,6 @@ static off64_t get_full_len(char * startname); static off64_t truncate_movie(MI_MOVIE_INFO * minfo); static off64_t cut_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie); static off64_t copy_movie(MI_MOVIE_INFO * minfo, CMovieInfo * cmovie, bool onefile); -void strReplace(std::string& orig, const char* fstr, const std::string rstr); #define TRACE printf #define TRACE_1 printf diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index cc0184eb7..8aad4ad39 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -86,6 +86,8 @@ #define MIN_BROWSER_FRAME_HEIGHT 100 #define MAX_BROWSER_FRAME_HEIGHT 400 +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 { diff --git a/src/gui/movieplayer.cpp b/src/gui/movieplayer.cpp index 29abcb443..ad4441d7f 100644 --- a/src/gui/movieplayer.cpp +++ b/src/gui/movieplayer.cpp @@ -36,7 +36,6 @@ #include #include -#include #include #include @@ -46,6 +45,7 @@ #include #include #include +#include #include #include @@ -75,40 +75,35 @@ #include #include -#include #include "libtuxtxt/teletext.h" -int dvbsub_start(int pid); -int dvbsub_pause(); +//int dvbsub_start(int pid);//??? +//int dvbsub_pause(); //??? +//extern CPlugins *g_PluginList; extern cVideo * videoDecoder; -static cPlayback *playback; - extern CRemoteControl *g_RemoteControl; /* neutrino.cpp */ -void strReplace(std::string & orig, const char *fstr, const std::string rstr); -#define MOVIE_HINT_BOX_TIMER 5 // time to show bookmark hints in seconds -extern CPlugins *g_PluginList; extern CInfoClock *InfoClock; #define MINUTEOFFSET 117*262072 #define MP_TS_SIZE 262072 // ~0.5 sec extern char rec_filename[512]; -extern off64_t glob_limit; -extern int glob_splits; #ifndef __USE_FILE_OFFSET64 #error not using 64 bit file offsets #endif /* __USE_FILE__OFFSET64 */ -static unsigned short g_apids[REC_MAX_APIDS]; -static unsigned short g_ac3flags[REC_MAX_APIDS]; -static unsigned short g_numpida = 0; -static unsigned short g_vpid = 0; -static unsigned short g_vtype = 0; -static std::string g_language[REC_MAX_APIDS]; -static unsigned short g_currentapid = 0, g_currentac3 = 0, apidchanged = 0; + +unsigned short CMoviePlayerGui::g_numpida = 0; +unsigned short CMoviePlayerGui::g_vtype = 0; +unsigned short CMoviePlayerGui::g_vpid = 0; +std::string CMoviePlayerGui::g_language[REC_MAX_APIDS]; + +unsigned short CAPIDSelectExec::g_apids[REC_MAX_APIDS]; +unsigned short CAPIDSelectExec::g_ac3flags[REC_MAX_APIDS]; +unsigned short CAPIDSelectExec::g_currentapid = 0, CAPIDSelectExec::g_currentac3 = 0, CAPIDSelectExec::apidchanged = 0; bool get_movie_info_apid_name(int apid, MI_MOVIE_INFO * movie_info, std::string * apidtitle) { @@ -138,6 +133,7 @@ int CAPIDSelectExec::exec(CMenuTarget * /*parent*/, const std::string & actionKe } CMoviePlayerGui* CMoviePlayerGui::instance_mp = NULL; +cPlayback *CMoviePlayerGui::playback = NULL; CMoviePlayerGui& CMoviePlayerGui::getInstance() { @@ -276,7 +272,7 @@ int CMoviePlayerGui::exec(CMenuTarget * parent, const std::string & actionKey) bookmarkmanager = new CBookmarkManager(); - dvbsub_pause(); +// dvbsub_pause(); if (parent) { parent->hide(); @@ -452,7 +448,7 @@ void CMoviePlayerGui::PlayFile(void) system("(rm /hdd/.wakeup; touch /hdd/.wakeup; sync) > /dev/null 2> /dev/null &"); if (timeshift) { - CVCRControl::getInstance()->GetPids(&g_vpid, &g_vtype, &g_currentapid, &g_currentac3, &g_numpida, g_apids, g_ac3flags); + CVCRControl::getInstance()->GetPids(&g_vpid, &g_vtype, &CAPIDSelectExec::g_currentapid, &CAPIDSelectExec::g_currentac3, &g_numpida, CAPIDSelectExec::g_apids, CAPIDSelectExec::g_ac3flags); p_movie_info = CVCRControl::getInstance()->GetMovieInfo(); } @@ -646,11 +642,11 @@ void CMoviePlayerGui::PlayFile(void) FileTime.hide(); /*clear audipopids */ for (int i = 0; i < g_numpida; i++) { - g_apids[i] = 0; - g_ac3flags[i] = 0; + CAPIDSelectExec::g_apids[i] = 0; + CAPIDSelectExec::g_ac3flags[i] = 0; g_language[i].clear(); } - g_numpida = 0; g_currentapid = 0; + g_numpida = 0; CAPIDSelectExec::g_currentapid = 0; if (isMovieBrowser == true) { // start the moviebrowser instead of the filebrowser @@ -683,22 +679,22 @@ void CMoviePlayerGui::PlayFile(void) } if(!p_movie_info->audioPids.empty()) { - g_currentapid = p_movie_info->audioPids[0].epgAudioPid; //FIXME - g_currentac3 = p_movie_info->audioPids[0].atype; + CAPIDSelectExec::g_currentapid = p_movie_info->audioPids[0].epgAudioPid; //FIXME + CAPIDSelectExec::g_currentac3 = p_movie_info->audioPids[0].atype; } for (int i = 0; i < (int)p_movie_info->audioPids.size(); i++) { - g_apids[i] = p_movie_info->audioPids[i].epgAudioPid; - g_ac3flags[i] = p_movie_info->audioPids[i].atype; + CAPIDSelectExec::g_apids[i] = p_movie_info->audioPids[i].epgAudioPid; + CAPIDSelectExec::g_ac3flags[i] = p_movie_info->audioPids[i].atype; g_numpida++; if (p_movie_info->audioPids[i].selected) { - g_currentapid = p_movie_info->audioPids[i].epgAudioPid; //FIXME - g_currentac3 = p_movie_info->audioPids[i].atype; + CAPIDSelectExec::g_currentapid = p_movie_info->audioPids[i].epgAudioPid; //FIXME + CAPIDSelectExec::g_currentac3 = p_movie_info->audioPids[i].atype; //break; } } g_vpid = p_movie_info->epgVideoPid; g_vtype = p_movie_info->VideoType; - printf("CMoviePlayerGui::PlayFile: file %s apid %X atype %d vpid %x vtype %d\n", filename, g_currentapid, g_currentac3, g_vpid, g_vtype); + printf("CMoviePlayerGui::PlayFile: file %s apid %X atype %d vpid %x vtype %d\n", filename, CAPIDSelectExec::g_currentapid, CAPIDSelectExec::g_currentac3, g_vpid, g_vtype); printf("Bytes per minute: %lld\n", minuteoffset); // get the start position for the movie startposition = 1000 * moviebrowser->getCurrentStartPos(); @@ -766,17 +762,17 @@ void CMoviePlayerGui::PlayFile(void) bool enabled; bool defpid; if(is_file_player && !g_numpida){ - playback->FindAllPids(g_apids, g_ac3flags, &g_numpida, g_language); + playback->FindAllPids(CAPIDSelectExec::g_apids, CAPIDSelectExec::g_ac3flags, &g_numpida, g_language); } for (unsigned int count = 0; count < g_numpida; count++) { bool name_ok = false; char apidnumber[10]; - sprintf(apidnumber, "%d %X", count + 1, g_apids[count]); + sprintf(apidnumber, "%d %X", count + 1, CAPIDSelectExec::g_apids[count]); enabled = true; - defpid = g_currentapid ? (g_currentapid == g_apids[count]) : (count == 0); + defpid = CAPIDSelectExec::g_currentapid ? (CAPIDSelectExec::g_currentapid == CAPIDSelectExec::g_apids[count]) : (count == 0); std::string apidtitle = "Stream "; if(!is_file_player){ - name_ok = get_movie_info_apid_name(g_apids[count], p_movie_info, &apidtitle); + name_ok = get_movie_info_apid_name(CAPIDSelectExec::g_apids[count], p_movie_info, &apidtitle); } else if (!g_language[count].empty()){ apidtitle = g_language[count]; @@ -785,7 +781,7 @@ void CMoviePlayerGui::PlayFile(void) if (!name_ok) apidtitle = "Stream "; - switch(g_ac3flags[count]) + switch(CAPIDSelectExec::g_ac3flags[count]) { case 1: /*AC3,EAC3*/ if (apidtitle.find("AC3") == std::numeric_limits::max() || is_file_player) @@ -820,15 +816,15 @@ void CMoviePlayerGui::PlayFile(void) APIDSelector.addItem(new CMenuForwarderNonLocalized(apidtitle.c_str(), enabled, NULL, APIDChanger, apidnumber, CRCInput::convertDigitToKey(count + 1)), defpid); } - apidchanged = 0; + CAPIDSelectExec::apidchanged = 0; APIDSelector.exec(NULL, ""); - if (apidchanged) { - if (g_currentapid == 0) { - g_currentapid = g_apids[0]; - g_currentac3 = g_ac3flags[0]; + if (CAPIDSelectExec::apidchanged) { + if (CAPIDSelectExec::g_currentapid == 0) { + CAPIDSelectExec::g_currentapid = CAPIDSelectExec::g_apids[0]; + CAPIDSelectExec::g_currentac3 = CAPIDSelectExec::g_ac3flags[0]; } - playback->SetAPid(g_currentapid, g_currentac3); - apidchanged = 0; + playback->SetAPid(CAPIDSelectExec::g_currentapid, CAPIDSelectExec::g_currentac3); + CAPIDSelectExec::apidchanged = 0; } delete APIDChanger; showaudioselectdialog = false; @@ -858,7 +854,7 @@ void CMoviePlayerGui::PlayFile(void) printf("IS FILE PLAYER: %s\n", is_file_player ? "true": "false" ); - if(!playback->Start((char *)filename, g_vpid, g_vtype, g_currentapid, g_currentac3)) { + if(!playback->Start((char *)filename, g_vpid, g_vtype, CAPIDSelectExec::g_currentapid, CAPIDSelectExec::g_currentac3)) { playback->Close(); restoreNeutrino(); } else {