added permashift support in displaychannel

This commit is contained in:
louis
2015-05-15 10:03:34 +02:00
parent 5a0155d1e9
commit 727f20617c
6 changed files with 34 additions and 1 deletions

View File

@@ -124,6 +124,15 @@ void cDisplayChannelView::DrawProgressBar(cString &start, cString &stop, int Cur
intTokens.insert(pair<string, int>("elapsed", Current));
intTokens.insert(pair<string, int>("remaining", Total - Current));
int liveBuffer = GetLiveBuffer();
if (liveBuffer >= 0) {
intTokens.insert(pair<string, int>("permashift", 1));
intTokens.insert(pair<string, int>("livebuffer", liveBuffer));
} else {
intTokens.insert(pair<string, int>("permashift", 0));
intTokens.insert(pair<string, int>("livebuffer", 0));
}
ClearProgressBar();
DrawViewElement(veProgressBar, &stringTokens, &intTokens);
}

View File

@@ -442,6 +442,18 @@ bool cViewHelpers::CheckNewMails(void) {
return false;
}
int cViewHelpers::GetLiveBuffer(void) {
static cPlugin *pPermashift = cPluginManager::GetPlugin("permashift");
if (!pPermashift) {
return -1;
}
int buffer = 0;
if (pPermashift->Service("Permashift-GetUsedBufferSecs-v1", &buffer)) {
return buffer;
}
return -1;
}
void cViewHelpers::SetScraperTokens(const cEvent *event, const cRecording *recording, stringmap &stringTokens, intmap &intTokens, map < string, vector<stringmap> > &loopTokens) {
static cPlugin *pScraper = GetScraperPlugin();
if (!pScraper || (!event && !recording)) {

View File

@@ -32,6 +32,7 @@ protected:
void InitDevices(void);
bool SetDevices(bool initial, bool light, intmap *intTokens, vector<stringmap> *devices);
bool CheckNewMails(void);
int GetLiveBuffer(void);
void SetScraperTokens(const cEvent *event, const cRecording *recording, stringmap &stringTokens, intmap &intTokens, map < string, vector<stringmap> > &loopTokens);
void SetPosterBanner(const cEvent *event, stringmap &stringTokens, intmap &intTokens);
void SetTimers(map<string,int> *intTokens, map<string,string> *stringTokens, vector<stringmap> *timers);