2016-02-06 09:55:15 +01:00
|
|
|
#include "viewelementsdisplayreplay.h"
|
|
|
|
#include "../config.h"
|
|
|
|
#include "../extensions/helpers.h"
|
|
|
|
#include "../services/scraper2vdr.h"
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrRecTitle
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrRecTitle::cVeDrRecTitle(void) {
|
|
|
|
recording = NULL;
|
2021-02-11 16:45:08 +01:00
|
|
|
event = NULL;
|
2016-02-06 09:55:15 +01:00
|
|
|
title = NULL;
|
2021-03-04 16:30:10 +01:00
|
|
|
timeShiftActive = NoRec;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrRecTitle::~cVeDrRecTitle(void) {
|
|
|
|
free(title);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrRecTitle::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{rectitle}", (int)eDRRecTitleST::rectitle);
|
|
|
|
tokenContainer->DefineStringToken("{recsubtitle}", (int)eDRRecTitleST::recsubtitle);
|
|
|
|
tokenContainer->DefineStringToken("{recdate}", (int)eDRRecTitleST::recdate);
|
|
|
|
tokenContainer->DefineStringToken("{rectime}", (int)eDRRecTitleST::rectime);
|
2021-02-12 15:20:34 +01:00
|
|
|
tokenContainer->DefineStringToken("{eventstart}", (int)eDRRecTitleST::eventstart);
|
|
|
|
tokenContainer->DefineStringToken("{eventstop}", (int)eDRRecTitleST::eventstop);
|
|
|
|
tokenContainer->DefineIntToken("{timeshift}", (int)eDRRecTitleIT::timeshift);
|
2016-02-06 09:55:15 +01:00
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
2021-03-04 16:30:10 +01:00
|
|
|
void cVeDrRecTitle::Set(const cRecording *recording, const cEvent *event, eRecType_t timeShiftActive) {
|
|
|
|
this->timeShiftActive = timeShiftActive;
|
2021-02-01 13:31:08 +01:00
|
|
|
if (this->title) {
|
|
|
|
free(this->title);
|
|
|
|
this->title = NULL;
|
|
|
|
}
|
|
|
|
if (this->recording)
|
|
|
|
this->recording = NULL;
|
2021-02-11 16:45:08 +01:00
|
|
|
if (this->event)
|
|
|
|
this->event = NULL;
|
2021-02-01 13:31:08 +01:00
|
|
|
if (!recording)
|
|
|
|
return;
|
2016-02-06 09:55:15 +01:00
|
|
|
this->recording = recording;
|
2021-02-11 16:45:08 +01:00
|
|
|
if (event)
|
|
|
|
this->event = event;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrRecTitle::Set(const char *title) {
|
2021-02-01 13:31:08 +01:00
|
|
|
if (this->title) {
|
|
|
|
free(this->title);
|
|
|
|
this->title = NULL;
|
|
|
|
}
|
|
|
|
if (this->recording)
|
|
|
|
this->recording = NULL;
|
2021-02-11 16:45:08 +01:00
|
|
|
if (this->event)
|
|
|
|
this->event = NULL;
|
2016-02-06 09:55:15 +01:00
|
|
|
if (!title)
|
|
|
|
return;
|
|
|
|
free(this->title);
|
|
|
|
this->title = strdup(title);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrRecTitle::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force))
|
|
|
|
return false;
|
|
|
|
if (!recording && !title)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
tokenContainer->Clear();
|
|
|
|
if (recording) {
|
|
|
|
const char *recName = NULL;
|
2021-02-11 16:45:08 +01:00
|
|
|
const char *recShortText = NULL;
|
2016-02-06 09:55:15 +01:00
|
|
|
const cRecordingInfo *recInfo = recording->Info();
|
2021-02-11 16:45:08 +01:00
|
|
|
if (event) {
|
|
|
|
recName = event->Title();
|
|
|
|
recShortText = event->ShortText();
|
|
|
|
} else if (recInfo) {
|
2016-02-06 09:55:15 +01:00
|
|
|
recName = recInfo->Title();
|
2021-02-11 16:45:08 +01:00
|
|
|
recShortText = recInfo->ShortText();
|
|
|
|
}
|
|
|
|
if (!recName) {
|
2016-02-06 09:55:15 +01:00
|
|
|
recName = recording->Name();
|
2021-02-11 16:45:08 +01:00
|
|
|
recShortText = "";
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, recName);
|
2021-02-11 16:45:08 +01:00
|
|
|
tokenContainer->AddStringToken((int)eDRRecTitleST::recsubtitle, recShortText);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddStringToken((int)eDRRecTitleST::recdate, *ShortDateString(recording->Start()));
|
2021-02-01 13:31:08 +01:00
|
|
|
tokenContainer->AddStringToken((int)eDRRecTitleST::rectime, *TimeString(recording->Start()));
|
2021-03-04 16:30:10 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRRecTitleIT::timeshift, timeShiftActive);
|
2021-02-12 15:20:34 +01:00
|
|
|
if (event) {
|
|
|
|
tokenContainer->AddStringToken((int)eDRRecTitleST::eventstart, *TimeString(event->StartTime()));
|
|
|
|
tokenContainer->AddStringToken((int)eDRRecTitleST::eventstop, *TimeString(event->EndTime()));
|
|
|
|
}
|
2016-02-06 09:55:15 +01:00
|
|
|
} else if (title) {
|
2021-02-01 13:31:08 +01:00
|
|
|
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, title);
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
SetDirty();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrRecInfo
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrRecInfo::cVeDrRecInfo(void) {
|
|
|
|
recording = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrRecInfo::~cVeDrRecInfo(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrRecInfo::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{resolution}", (int)eDRRecInfoST::resolution);
|
|
|
|
tokenContainer->DefineStringToken("{aspect}", (int)eDRRecInfoST::aspect);
|
|
|
|
tokenContainer->DefineIntToken("{screenwidth}", (int)eDRRecInfoIT::screenwidth);
|
|
|
|
tokenContainer->DefineIntToken("{screenheight}", (int)eDRRecInfoIT::screenheight);
|
|
|
|
tokenContainer->DefineIntToken("{isHD}", (int)eDRRecInfoIT::isHD);
|
2021-01-21 07:49:35 +01:00
|
|
|
tokenContainer->DefineIntToken("{isUHD}", (int)eDRRecInfoIT::isUHD);
|
2021-02-05 08:44:00 +01:00
|
|
|
tokenContainer->DefineIntToken("{isRecording}", (int)eDRRecInfoIT::isRecording);
|
2021-05-03 07:01:04 +02:00
|
|
|
tokenContainer->DefineIntToken("{isInUse}", (int)eDRRecInfoIT::isInUse);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->DefineIntToken("{isWideScreen}", (int)eDRRecInfoIT::isWideScreen);
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrRecInfo::Set(const cRecording *recording) {
|
|
|
|
this->recording = recording;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrRecInfo::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force))
|
|
|
|
return false;
|
|
|
|
if (!recording)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
int screenWidth = 0;
|
|
|
|
int screenHeight = 0;
|
|
|
|
double aspect = 0;
|
|
|
|
cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect);
|
|
|
|
bool isHD = false;
|
2021-01-21 07:49:35 +01:00
|
|
|
bool isUHD = false;
|
|
|
|
string resName = GetScreenResolutionString(screenWidth, screenHeight, &isHD, &isUHD);
|
2016-02-06 09:55:15 +01:00
|
|
|
bool isWideScreen = false;
|
|
|
|
string aspectName = GetScreenAspectString(aspect, &isWideScreen);
|
|
|
|
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddIntToken((int)eDRRecInfoIT::screenwidth, screenWidth);
|
|
|
|
tokenContainer->AddIntToken((int)eDRRecInfoIT::screenheight, screenHeight);
|
|
|
|
tokenContainer->AddIntToken((int)eDRRecInfoIT::isHD, isHD);
|
2021-01-21 07:49:35 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRRecInfoIT::isUHD, isUHD);
|
2021-02-05 08:44:00 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRRecInfoIT::isRecording, recording->IsInUse() & ruTimer);
|
2021-05-03 07:01:04 +02:00
|
|
|
tokenContainer->AddIntToken((int)eDRRecInfoIT::isInUse, recording->IsInUse());
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRRecInfoIT::isWideScreen, isWideScreen);
|
|
|
|
tokenContainer->AddStringToken((int)eDRRecInfoST::resolution, resName.c_str());
|
|
|
|
tokenContainer->AddStringToken((int)eDRRecInfoST::aspect, aspectName.c_str());
|
|
|
|
|
|
|
|
SetDirty();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrCurrentTime
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrCurrentTime::cVeDrCurrentTime(void) {
|
|
|
|
changed = true;
|
|
|
|
current = NULL;
|
2021-03-04 16:30:10 +01:00
|
|
|
timeShiftActive = NoRec;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrCurrentTime::~cVeDrCurrentTime(void) {
|
|
|
|
free(current);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrCurrentTime::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{reccurrent}", (int)eDRCurrentTimeST::reccurrent);
|
2021-02-12 15:20:34 +01:00
|
|
|
tokenContainer->DefineIntToken("{timeshift}", (int)eDRCurrentTimeIT::timeshift);
|
2016-02-06 09:55:15 +01:00
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
2021-03-04 16:30:10 +01:00
|
|
|
void cVeDrCurrentTime::Set(const char *current, eRecType_t timeShiftActive) {
|
2016-02-06 09:55:15 +01:00
|
|
|
if (!current)
|
|
|
|
return;
|
|
|
|
free(this->current);
|
|
|
|
this->current = strdup(current);
|
2021-03-04 16:30:10 +01:00
|
|
|
this->timeShiftActive = timeShiftActive;
|
2016-02-06 09:55:15 +01:00
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrCurrentTime::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddStringToken((int)eDRCurrentTimeST::reccurrent, current);
|
2021-03-04 16:30:10 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRCurrentTimeIT::timeshift, timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
SetDirty();
|
|
|
|
changed = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrTotalTime
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrTotalTime::cVeDrTotalTime(void) {
|
|
|
|
changed = true;
|
|
|
|
total = NULL;
|
|
|
|
timeshiftDuration = NULL;
|
2021-03-04 16:30:10 +01:00
|
|
|
timeShiftActive = NoRec;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrTotalTime::~cVeDrTotalTime(void) {
|
|
|
|
free(total);
|
|
|
|
free(timeshiftDuration);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrTotalTime::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{rectotal}", (int)eDRTotalTimeST::rectotal);
|
|
|
|
tokenContainer->DefineStringToken("{timeshifttotal}", (int)eDRTotalTimeST::timeshifttotal);
|
|
|
|
tokenContainer->DefineIntToken("{timeshift}", (int)eDRTotalTimeIT::timeshift);
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
2021-03-04 16:30:10 +01:00
|
|
|
void cVeDrTotalTime::Set(const char *total, const char *timeshiftDuration, eRecType_t timeShiftActive) {
|
2016-02-06 09:55:15 +01:00
|
|
|
if (!total)
|
|
|
|
return;
|
|
|
|
free(this->total);
|
|
|
|
this->total = strdup(total);
|
2021-03-04 16:30:10 +01:00
|
|
|
this->timeShiftActive = timeShiftActive;
|
2016-02-06 09:55:15 +01:00
|
|
|
free(this->timeshiftDuration);
|
|
|
|
this->timeshiftDuration = NULL;
|
|
|
|
if (timeshiftDuration)
|
|
|
|
this->timeshiftDuration = strdup(timeshiftDuration);
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrTotalTime::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddStringToken((int)eDRTotalTimeST::rectotal, total);
|
|
|
|
tokenContainer->AddStringToken((int)eDRTotalTimeST::timeshifttotal, timeshiftDuration);
|
2021-03-04 16:30:10 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRTotalTimeIT::timeshift, timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
SetDirty();
|
|
|
|
changed = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-02-12 15:20:34 +01:00
|
|
|
/******************************************************************
|
|
|
|
* cVeDrTimeshiftTimes
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrTimeshiftTimes::cVeDrTimeshiftTimes(void) {
|
|
|
|
changed = true;
|
|
|
|
start = "";
|
|
|
|
playbacktime = "";
|
|
|
|
timeshiftrest = "";
|
2021-03-04 16:30:10 +01:00
|
|
|
timeShiftActive = NoRec;
|
2021-02-12 15:20:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrTimeshiftTimes::~cVeDrTimeshiftTimes(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrTimeshiftTimes::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{recstart}", (int)eDRTimeshiftTimesST::recstart);
|
|
|
|
tokenContainer->DefineStringToken("{playbacktime}", (int)eDRTimeshiftTimesST::playbacktime);
|
|
|
|
tokenContainer->DefineStringToken("{timeshiftrest}", (int)eDRTimeshiftTimesST::timeshiftrest);
|
|
|
|
tokenContainer->DefineIntToken("{timeshift}", (int)eDRTimeshiftTimesIT::timeshift);
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
2021-03-04 16:30:10 +01:00
|
|
|
void cVeDrTimeshiftTimes::Set(cString start, cString playbacktime, cString timeshiftrest, eRecType_t timeShiftActive) {
|
|
|
|
this->timeShiftActive = timeShiftActive;
|
2021-02-12 15:20:34 +01:00
|
|
|
if (strcmp(*this->start, *start) || strcmp(*this->playbacktime, *playbacktime) || strcmp(*this->timeshiftrest, *timeshiftrest)) {
|
|
|
|
this->start = start;
|
|
|
|
this->playbacktime = playbacktime;
|
|
|
|
this->timeshiftrest = timeshiftrest;
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrTimeshiftTimes::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::recstart, *start);
|
|
|
|
tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::playbacktime, *playbacktime);
|
|
|
|
tokenContainer->AddStringToken((int)eDRTimeshiftTimesST::timeshiftrest, *timeshiftrest);
|
2021-03-04 16:30:10 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRTimeshiftTimesIT::timeshift, timeShiftActive);
|
2021-02-12 15:20:34 +01:00
|
|
|
SetDirty();
|
|
|
|
changed = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
/******************************************************************
|
|
|
|
* cVeDrEndTime
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrEndTime::cVeDrEndTime(void) {
|
2021-02-12 15:20:34 +01:00
|
|
|
changed = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
end = "";
|
2021-03-04 16:30:10 +01:00
|
|
|
timeShiftActive = NoRec;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrEndTime::~cVeDrEndTime(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrEndTime::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{recend}", (int)eDREndTimeST::recend);
|
2021-02-12 15:20:34 +01:00
|
|
|
tokenContainer->DefineIntToken("{timeshift}", (int)eDREndTimeIT::timeshift);
|
2016-02-06 09:55:15 +01:00
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
2021-03-04 16:30:10 +01:00
|
|
|
void cVeDrEndTime::Set(cString end, eRecType_t timeShiftActive) {
|
|
|
|
this->timeShiftActive = timeShiftActive;
|
2016-02-06 09:55:15 +01:00
|
|
|
if (strcmp(*this->end, *end)) {
|
|
|
|
this->end = end;
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrEndTime::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddStringToken((int)eDREndTimeST::recend, *end);
|
2021-03-04 16:30:10 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDREndTimeIT::timeshift, timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
SetDirty();
|
|
|
|
changed = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrProgressBar
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrProgressBar::cVeDrProgressBar(void) {
|
|
|
|
current = -1;
|
|
|
|
total = -1;
|
|
|
|
timeshiftTotal = -1;
|
2021-03-04 16:30:10 +01:00
|
|
|
timeShiftActive = NoRec;
|
2016-02-06 09:55:15 +01:00
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrProgressBar::~cVeDrProgressBar(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrProgressBar::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineIntToken("{current}", (int)eDRProgressbarIT::current);
|
|
|
|
tokenContainer->DefineIntToken("{total}", (int)eDRProgressbarIT::total);
|
|
|
|
tokenContainer->DefineIntToken("{timeshift}", (int)eDRProgressbarIT::timeshift);
|
|
|
|
tokenContainer->DefineIntToken("{timeshifttotal}", (int)eDRProgressbarIT::timeshifttotal);
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
2021-03-04 16:30:10 +01:00
|
|
|
void cVeDrProgressBar::Set(int current, int total, eRecType_t timeShiftActive, int timeshiftTotal) {
|
2021-02-08 15:22:40 +01:00
|
|
|
if (!(this->current != current || this->total != total))
|
2016-02-06 09:55:15 +01:00
|
|
|
return;
|
|
|
|
this->current = current;
|
|
|
|
this->total = total;
|
2021-03-04 16:30:10 +01:00
|
|
|
this->timeShiftActive = timeShiftActive;
|
2016-02-06 09:55:15 +01:00
|
|
|
this->timeshiftTotal = timeshiftTotal;
|
2021-02-12 15:20:34 +01:00
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrProgressBar::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddIntToken((int)eDRProgressbarIT::current, current);
|
|
|
|
tokenContainer->AddIntToken((int)eDRProgressbarIT::total, total);
|
2021-03-04 16:30:10 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRProgressbarIT::timeshift, timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRProgressbarIT::timeshifttotal, timeshiftTotal);
|
|
|
|
|
|
|
|
SetDirty();
|
2021-03-15 14:10:18 +01:00
|
|
|
changed = false;
|
2016-02-06 09:55:15 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrCutMarks
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrCutMarks::cVeDrCutMarks(void) {
|
|
|
|
cutmarksIndex = -1;
|
2021-03-15 14:10:18 +01:00
|
|
|
changed = true;
|
|
|
|
marks = NULL;
|
|
|
|
current = -1;
|
|
|
|
total = -1;
|
|
|
|
numMarksLast = 0;
|
2021-03-04 16:30:10 +01:00
|
|
|
timeShiftActive = NoRec;
|
2021-03-15 14:10:18 +01:00
|
|
|
timeshiftTotal = -1;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrCutMarks::~cVeDrCutMarks(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrCutMarks::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineIntToken("{timeshift}", (int)eDRCutmarksIT::timeshift);
|
|
|
|
tokenContainer->DefineLoopToken("{marks[position]}", (int)eDRCutmarksLT::position);
|
|
|
|
tokenContainer->DefineLoopToken("{marks[endposition]}", (int)eDRCutmarksLT::endposition);
|
|
|
|
tokenContainer->DefineLoopToken("{marks[total]}", (int)eDRCutmarksLT::total);
|
|
|
|
tokenContainer->DefineLoopToken("{marks[timeshifttotal]}", (int)eDRCutmarksLT::timeshifttotal);
|
|
|
|
tokenContainer->DefineLoopToken("{marks[active]}", (int)eDRCutmarksLT::active);
|
|
|
|
tokenContainer->DefineLoopToken("{marks[startmark]}", (int)eDRCutmarksLT::startmark);
|
|
|
|
cutmarksIndex = tokenContainer->LoopIndex("marks");
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
2021-03-04 16:30:10 +01:00
|
|
|
void cVeDrCutMarks::Set(const cMarks *marks, int current, int total, eRecType_t timeShiftActive, int timeshiftTotal) {
|
2021-03-15 14:10:18 +01:00
|
|
|
int numMarks = marks->Count();
|
|
|
|
if (!(this->current != current || this->total != total || this->marks != marks || numMarksLast != numMarks))
|
|
|
|
return;
|
2016-02-06 09:55:15 +01:00
|
|
|
this->marks = marks;
|
2021-03-15 14:10:18 +01:00
|
|
|
numMarksLast = numMarks;
|
2016-02-06 09:55:15 +01:00
|
|
|
this->current = current;
|
|
|
|
this->total = total;
|
2021-03-04 16:30:10 +01:00
|
|
|
this->timeShiftActive = timeShiftActive;
|
2016-02-06 09:55:15 +01:00
|
|
|
this->timeshiftTotal = timeshiftTotal;
|
|
|
|
|
2021-03-15 14:10:18 +01:00
|
|
|
changed = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrCutMarks::Parse(bool force) {
|
2021-03-15 14:10:18 +01:00
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
2016-02-06 09:55:15 +01:00
|
|
|
return false;
|
|
|
|
tokenContainer->Clear();
|
2021-03-04 16:30:10 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRCutmarksIT::timeshift, timeShiftActive);
|
2016-02-06 09:55:15 +01:00
|
|
|
int numMarks = marks->Count();
|
|
|
|
vector<int> cutmarksInfo;
|
|
|
|
cutmarksInfo.push_back(numMarks);
|
|
|
|
tokenContainer->CreateLoopTokenContainer(&cutmarksInfo);
|
|
|
|
cString tot = cString::sprintf("%d", total);
|
|
|
|
cString timeshifttot = cString::sprintf("%d",timeshiftTotal);
|
|
|
|
int i = 0;
|
|
|
|
bool isStartMark = true;
|
|
|
|
for (const cMark *m = marks->First(); m; m = marks->Next(m)) {
|
|
|
|
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::position, *cString::sprintf("%d", m->Position()));
|
|
|
|
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::total, *tot);
|
2021-03-04 16:30:10 +01:00
|
|
|
if (timeShiftActive) {
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::timeshifttotal, *timeshifttot);
|
|
|
|
}
|
|
|
|
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::startmark, isStartMark ? "1" : "0");
|
|
|
|
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::active, (m->Position() == current) ? "1" : "0");
|
|
|
|
const cMark *m2 = marks->Next(m);
|
|
|
|
if (m2) {
|
|
|
|
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::endposition, *cString::sprintf("%d", m2->Position()));
|
|
|
|
} else {
|
|
|
|
tokenContainer->AddLoopToken(cutmarksIndex, i, (int)eDRCutmarksLT::endposition, *tot);
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
isStartMark = !isStartMark;
|
|
|
|
}
|
|
|
|
SetDirty();
|
2021-03-15 14:10:18 +01:00
|
|
|
changed = false;
|
2016-02-06 09:55:15 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrControlIcons
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrControlIcons::cVeDrControlIcons(void) {
|
|
|
|
play = false;
|
|
|
|
forward = false;
|
|
|
|
speed = 0;
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrControlIcons::~cVeDrControlIcons(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrControlIcons::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineIntToken("{play}", (int)eDRControlIconsIT::play);
|
|
|
|
tokenContainer->DefineIntToken("{pause}", (int)eDRControlIconsIT::pause);
|
|
|
|
tokenContainer->DefineIntToken("{forward}", (int)eDRControlIconsIT::forward);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->DefineIntToken("{slowforward}", (int)eDRControlIconsIT::slowforward);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->DefineIntToken("{forward1x}", (int)eDRControlIconsIT::forward1x);
|
|
|
|
tokenContainer->DefineIntToken("{forward2x}", (int)eDRControlIconsIT::forward2x);
|
|
|
|
tokenContainer->DefineIntToken("{forward3x}", (int)eDRControlIconsIT::forward3x);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->DefineIntToken("{slowforward1x}", (int)eDRControlIconsIT::slowforward1x);
|
|
|
|
tokenContainer->DefineIntToken("{slowforward2x}", (int)eDRControlIconsIT::slowforward2x);
|
|
|
|
tokenContainer->DefineIntToken("{slowforward3x}", (int)eDRControlIconsIT::slowforward3x);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->DefineIntToken("{rewind}", (int)eDRControlIconsIT::rewind);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->DefineIntToken("{slowrewind}", (int)eDRControlIconsIT::slowrewind);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->DefineIntToken("{rewind1x}", (int)eDRControlIconsIT::rewind1x);
|
|
|
|
tokenContainer->DefineIntToken("{rewind2x}", (int)eDRControlIconsIT::rewind2x);
|
|
|
|
tokenContainer->DefineIntToken("{rewind3x}", (int)eDRControlIconsIT::rewind3x);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->DefineIntToken("{slowrewind1x}", (int)eDRControlIconsIT::slowrewind1x);
|
|
|
|
tokenContainer->DefineIntToken("{slowrewind2x}", (int)eDRControlIconsIT::slowrewind2x);
|
|
|
|
tokenContainer->DefineIntToken("{slowrewind3x}", (int)eDRControlIconsIT::slowrewind3x);
|
2016-02-06 09:55:15 +01:00
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrControlIcons::Set(bool play, bool forward, int speed) {
|
|
|
|
this->play = play;
|
|
|
|
this->forward = forward;
|
|
|
|
this->speed = speed;
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrControlIcons::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
bool isPlay = false;
|
|
|
|
bool isPause = false;
|
|
|
|
bool isFF = false;
|
2016-09-24 15:19:03 +02:00
|
|
|
bool isSlowFF = false;
|
2016-02-06 09:55:15 +01:00
|
|
|
bool isFF1x = false;
|
|
|
|
bool isFF2x = false;
|
|
|
|
bool isFF3x = false;
|
2016-09-24 15:19:03 +02:00
|
|
|
bool isSlowFF1x = false;
|
|
|
|
bool isSlowFF2x = false;
|
|
|
|
bool isSlowFF3x = false;
|
2016-02-06 09:55:15 +01:00
|
|
|
bool isRew = false;
|
2016-09-24 15:19:03 +02:00
|
|
|
bool isSlowRew = false;
|
2016-02-06 09:55:15 +01:00
|
|
|
bool isRew1x = false;
|
|
|
|
bool isRew2x = false;
|
|
|
|
bool isRew3x = false;
|
2016-09-24 15:19:03 +02:00
|
|
|
bool isSlowRew1x = false;
|
|
|
|
bool isSlowRew2x = false;
|
|
|
|
bool isSlowRew3x = false;
|
2016-02-06 09:55:15 +01:00
|
|
|
|
|
|
|
if (speed == -1) {
|
|
|
|
if (play) {
|
|
|
|
isPlay = true;
|
|
|
|
} else {
|
|
|
|
isPause = true;
|
|
|
|
}
|
|
|
|
} else if (forward) {
|
|
|
|
if (speed == 1) {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isFF1x = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowFF1x = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
} else if (speed == 2) {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isFF2x = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowFF2x = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
} else if (speed == 3) {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isFF3x = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowFF3x = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
} else {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isFF = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowFF = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (speed == 1) {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isRew1x = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowRew1x = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
} else if (speed == 2) {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isRew2x = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowRew2x = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
} else if (speed == 3) {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isRew3x = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowRew3x = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
} else {
|
2016-10-03 15:20:36 +02:00
|
|
|
if (play)
|
|
|
|
isRew = true;
|
|
|
|
else
|
2016-09-24 15:19:03 +02:00
|
|
|
isSlowRew = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::play, isPlay);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::pause, isPause);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward, isFF);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward, isSlowFF);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward1x, isFF1x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward2x, isFF2x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::forward3x, isFF3x);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward1x, isSlowFF1x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward2x, isSlowFF2x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowforward3x, isSlowFF3x);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind, isRew);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind, isSlowRew);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind1x, isRew1x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind2x, isRew2x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::rewind3x, isRew3x);
|
2016-09-24 15:19:03 +02:00
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind1x, isSlowRew1x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind2x, isSlowRew2x);
|
|
|
|
tokenContainer->AddIntToken((int)eDRControlIconsIT::slowrewind3x, isSlowRew3x);
|
2016-02-06 09:55:15 +01:00
|
|
|
SetDirty();
|
|
|
|
changed = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrProgressModeonly
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrProgressModeonly::cVeDrProgressModeonly(void) {
|
|
|
|
fps = 0.0f;
|
|
|
|
current = 0;
|
|
|
|
total = 0;
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrProgressModeonly::~cVeDrProgressModeonly(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrProgressModeonly::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineIntToken("{current}", (int)eDRProgressModeonlyIT::current);
|
|
|
|
tokenContainer->DefineIntToken("{total}", (int)eDRProgressModeonlyIT::total);
|
|
|
|
tokenContainer->DefineStringToken("{timecurrent}", (int)eDRProgressModeonlyST::timecurrent);
|
|
|
|
tokenContainer->DefineStringToken("{timetotal}", (int)eDRProgressModeonlyST::timetotal);
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrProgressModeonly::Set(double fps, int current, int total) {
|
2021-02-08 15:22:40 +01:00
|
|
|
if (!(this->current != current || this->total != total))
|
2016-02-06 09:55:15 +01:00
|
|
|
return;
|
|
|
|
this->fps = fps;
|
|
|
|
this->current = current;
|
|
|
|
this->total = total;
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrProgressModeonly::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
string cur = GetTimeString((double)current / fps);
|
|
|
|
string tot = GetTimeString((double)total / fps);
|
|
|
|
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddIntToken((int)eDRProgressModeonlyIT::current, current);
|
|
|
|
tokenContainer->AddIntToken((int)eDRProgressModeonlyIT::total, total);
|
|
|
|
tokenContainer->AddStringToken((int)eDRProgressModeonlyST::timecurrent, cur.c_str());
|
|
|
|
tokenContainer->AddStringToken((int)eDRProgressModeonlyST::timetotal, tot.c_str());
|
|
|
|
|
|
|
|
SetDirty();
|
|
|
|
changed = false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrJump
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrJump::cVeDrJump(void) {
|
|
|
|
jump = NULL;
|
|
|
|
changed = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrJump::~cVeDrJump(void) {
|
|
|
|
free(jump);
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrJump::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{jump}", (int)eDRJumpST::jump);
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrJump::Set(const char *jump) {
|
|
|
|
if (!jump)
|
|
|
|
return;
|
|
|
|
free(this->jump);
|
|
|
|
this->jump = strdup(jump);
|
|
|
|
changed = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrJump::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force) || !changed)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddStringToken((int)eDRJumpST::jump, jump);
|
|
|
|
changed = false;
|
|
|
|
SetDirty();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************
|
|
|
|
* cVeDrOnPause
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrOnPause::cVeDrOnPause(void) {
|
2016-03-22 16:55:46 +01:00
|
|
|
started = false;
|
2016-02-06 09:55:15 +01:00
|
|
|
actorsIndex = -1;
|
|
|
|
recfilename = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrOnPause::~cVeDrOnPause(void) {
|
|
|
|
free(recfilename);
|
|
|
|
}
|
|
|
|
|
2016-03-22 16:55:46 +01:00
|
|
|
void cVeDrOnPause::Close(void) {
|
|
|
|
started = false;
|
|
|
|
cViewElement::Close();
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
void cVeDrOnPause::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{name}", (int)eDROnpauseST::name);
|
|
|
|
tokenContainer->DefineStringToken("{shorttext}", (int)eDROnpauseST::shorttext);
|
|
|
|
tokenContainer->DefineStringToken("{description}", (int)eDROnpauseST::description);
|
|
|
|
tokenContainer->DefineStringToken("{date}", (int)eDROnpauseST::date);
|
|
|
|
tokenContainer->DefineStringToken("{time}", (int)eDROnpauseST::time);
|
|
|
|
tokenContainer->DefineStringToken("{durationminutes}", (int)eDROnpauseST::durationminutes);
|
|
|
|
tokenContainer->DefineStringToken("{durationeventminutes}", (int)eDROnpauseST::durationeventminutes);
|
|
|
|
tokenContainer->DefineIntToken("{daynumeric}", (int)eDROnpauseIT::daynumeric);
|
|
|
|
tokenContainer->DefineIntToken("{month}", (int)eDROnpauseIT::month);
|
|
|
|
tokenContainer->DefineIntToken("{year}", (int)eDROnpauseIT::year);
|
|
|
|
tokenContainer->DefineIntToken("{duration}", (int)eDROnpauseIT::duration);
|
|
|
|
tokenContainer->DefineIntToken("{durationhours}", (int)eDROnpauseIT::durationhours);
|
|
|
|
tokenContainer->DefineIntToken("{durationevent}", (int)eDROnpauseIT::durationevent);
|
|
|
|
tokenContainer->DefineIntToken("{durationeventhours}", (int)eDROnpauseIT::durationeventhours);
|
|
|
|
tokenContainer->DefineStringToken("{movietitle}", (int)eScraperST::movietitle);
|
|
|
|
tokenContainer->DefineStringToken("{movieoriginalTitle}", (int)eScraperST::movieoriginalTitle);
|
|
|
|
tokenContainer->DefineStringToken("{movietagline}", (int)eScraperST::movietagline);
|
|
|
|
tokenContainer->DefineStringToken("{movieoverview}", (int)eScraperST::movieoverview);
|
|
|
|
tokenContainer->DefineStringToken("{moviegenres}", (int)eScraperST::moviegenres);
|
|
|
|
tokenContainer->DefineStringToken("{moviehomepage}", (int)eScraperST::moviehomepage);
|
|
|
|
tokenContainer->DefineStringToken("{moviereleasedate}", (int)eScraperST::moviereleasedate);
|
|
|
|
tokenContainer->DefineStringToken("{moviepopularity}", (int)eScraperST::moviepopularity);
|
|
|
|
tokenContainer->DefineStringToken("{movievoteaverage}", (int)eScraperST::movievoteaverage);
|
|
|
|
tokenContainer->DefineStringToken("{posterpath}", (int)eScraperST::posterpath);
|
|
|
|
tokenContainer->DefineStringToken("{fanartpath}", (int)eScraperST::fanartpath);
|
|
|
|
tokenContainer->DefineStringToken("{moviecollectionName}", (int)eScraperST::moviecollectionName);
|
|
|
|
tokenContainer->DefineStringToken("{collectionposterpath}", (int)eScraperST::collectionposterpath);
|
|
|
|
tokenContainer->DefineStringToken("{collectionfanartpath}", (int)eScraperST::collectionfanartpath);
|
|
|
|
tokenContainer->DefineStringToken("{seriesname}", (int)eScraperST::seriesname);
|
|
|
|
tokenContainer->DefineStringToken("{seriesoverview}", (int)eScraperST::seriesoverview);
|
|
|
|
tokenContainer->DefineStringToken("{seriesfirstaired}", (int)eScraperST::seriesfirstaired);
|
|
|
|
tokenContainer->DefineStringToken("{seriesnetwork}", (int)eScraperST::seriesnetwork);
|
|
|
|
tokenContainer->DefineStringToken("{seriesgenre}", (int)eScraperST::seriesgenre);
|
|
|
|
tokenContainer->DefineStringToken("{seriesrating}", (int)eScraperST::seriesrating);
|
|
|
|
tokenContainer->DefineStringToken("{seriesstatus}", (int)eScraperST::seriesstatus);
|
|
|
|
tokenContainer->DefineStringToken("{episodetitle}", (int)eScraperST::episodetitle);
|
|
|
|
tokenContainer->DefineStringToken("{episodefirstaired}", (int)eScraperST::episodefirstaired);
|
|
|
|
tokenContainer->DefineStringToken("{episodegueststars}", (int)eScraperST::episodegueststars);
|
|
|
|
tokenContainer->DefineStringToken("{episodeoverview}", (int)eScraperST::episodeoverview);
|
|
|
|
tokenContainer->DefineStringToken("{episoderating}", (int)eScraperST::episoderating);
|
|
|
|
tokenContainer->DefineStringToken("{episodeimagepath}", (int)eScraperST::episodeimagepath);
|
|
|
|
tokenContainer->DefineStringToken("{seasonposterpath}", (int)eScraperST::seasonposterpath);
|
|
|
|
tokenContainer->DefineStringToken("{seriesposter1path}", (int)eScraperST::seriesposter1path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesposter2path}", (int)eScraperST::seriesposter2path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesposter3path}", (int)eScraperST::seriesposter3path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesfanart1path}", (int)eScraperST::seriesfanart1path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesfanart2path}", (int)eScraperST::seriesfanart2path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesfanart3path}", (int)eScraperST::seriesfanart3path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesbanner1path}", (int)eScraperST::seriesbanner1path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesbanner2path}", (int)eScraperST::seriesbanner2path);
|
|
|
|
tokenContainer->DefineStringToken("{seriesbanner3path}", (int)eScraperST::seriesbanner3path);
|
|
|
|
tokenContainer->DefineIntToken("{ismovie}", (int)eScraperIT::ismovie);
|
|
|
|
tokenContainer->DefineIntToken("{moviebudget}", (int)eScraperIT::moviebudget);
|
|
|
|
tokenContainer->DefineIntToken("{movierevenue}", (int)eScraperIT::movierevenue);
|
|
|
|
tokenContainer->DefineIntToken("{movieadult}", (int)eScraperIT::movieadult);
|
|
|
|
tokenContainer->DefineIntToken("{movieruntime}", (int)eScraperIT::movieruntime);
|
|
|
|
tokenContainer->DefineIntToken("{isseries}", (int)eScraperIT::isseries);
|
|
|
|
tokenContainer->DefineIntToken("{posterwidth}", (int)eScraperIT::posterwidth);
|
|
|
|
tokenContainer->DefineIntToken("{posterheight}", (int)eScraperIT::posterheight);
|
|
|
|
tokenContainer->DefineIntToken("{fanartwidth}", (int)eScraperIT::fanartwidth);
|
|
|
|
tokenContainer->DefineIntToken("{fanartheight}", (int)eScraperIT::fanartheight);
|
|
|
|
tokenContainer->DefineIntToken("{movieiscollection}", (int)eScraperIT::movieiscollection);
|
|
|
|
tokenContainer->DefineIntToken("{collectionposterwidth}", (int)eScraperIT::collectionposterwidth);
|
|
|
|
tokenContainer->DefineIntToken("{collectionposterheight}", (int)eScraperIT::collectionposterheight);
|
|
|
|
tokenContainer->DefineIntToken("{collectionfanartwidth}", (int)eScraperIT::collectionfanartwidth);
|
|
|
|
tokenContainer->DefineIntToken("{collectionfanartheight}", (int)eScraperIT::collectionfanartheight);
|
|
|
|
tokenContainer->DefineIntToken("{epgpicavailable}", (int)eScraperIT::epgpicavailable);
|
|
|
|
tokenContainer->DefineIntToken("{episodenumber}", (int)eScraperIT::episodenumber);
|
|
|
|
tokenContainer->DefineIntToken("{episodeseason}", (int)eScraperIT::episodeseason);
|
|
|
|
tokenContainer->DefineIntToken("{episodeimagewidth}", (int)eScraperIT::episodeimagewidth);
|
|
|
|
tokenContainer->DefineIntToken("{episodeimageheight}", (int)eScraperIT::episodeimageheight);
|
|
|
|
tokenContainer->DefineIntToken("{seasonposterwidth}", (int)eScraperIT::seasonposterwidth);
|
|
|
|
tokenContainer->DefineIntToken("{seasonposterheight}", (int)eScraperIT::seasonposterheight);
|
|
|
|
tokenContainer->DefineIntToken("{seriesposter1width}", (int)eScraperIT::seriesposter1width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesposter1height}", (int)eScraperIT::seriesposter1height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesposter2width}", (int)eScraperIT::seriesposter2width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesposter2height}", (int)eScraperIT::seriesposter2height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesposter3width}", (int)eScraperIT::seriesposter3width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesposter3height}", (int)eScraperIT::seriesposter3height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesfanart1width}", (int)eScraperIT::seriesfanart1width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesfanart1height}", (int)eScraperIT::seriesfanart1height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesfanart2width}", (int)eScraperIT::seriesfanart2width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesfanart2height}", (int)eScraperIT::seriesfanart2height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesfanart3width}", (int)eScraperIT::seriesfanart3width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesfanart3height}", (int)eScraperIT::seriesfanart3height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesbanner1width}", (int)eScraperIT::seriesbanner1width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesbanner1height}", (int)eScraperIT::seriesbanner1height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesbanner2width}", (int)eScraperIT::seriesbanner2width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesbanner2height}", (int)eScraperIT::seriesbanner2height);
|
|
|
|
tokenContainer->DefineIntToken("{seriesbanner3width}", (int)eScraperIT::seriesbanner3width);
|
|
|
|
tokenContainer->DefineIntToken("{seriesbanner3height}", (int)eScraperIT::seriesbanner3height);
|
|
|
|
tokenContainer->DefineLoopToken("{actors[name]}", (int)eScraperLT::name);
|
|
|
|
tokenContainer->DefineLoopToken("{actors[role]}", (int)eScraperLT::role);
|
|
|
|
tokenContainer->DefineLoopToken("{actors[thumb]}", (int)eScraperLT::thumb);
|
|
|
|
tokenContainer->DefineLoopToken("{actors[thumbwidth]}", (int)eScraperLT::thumbwidth);
|
|
|
|
tokenContainer->DefineLoopToken("{actors[thumbheight]}", (int)eScraperLT::thumbheight);
|
|
|
|
actorsIndex = tokenContainer->LoopIndex("actors");
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrOnPause::Set(const char *recfilename) {
|
|
|
|
if (!recfilename)
|
|
|
|
return;
|
|
|
|
free(this->recfilename);
|
|
|
|
this->recfilename = strdup(recfilename);
|
2016-03-22 16:55:46 +01:00
|
|
|
started = true;
|
2016-02-06 09:55:15 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrOnPause::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force))
|
|
|
|
return false;
|
|
|
|
if (!recfilename)
|
|
|
|
return false;
|
|
|
|
const cRecording *recording = new cRecording(recfilename);
|
|
|
|
if (!recording)
|
|
|
|
return false;
|
|
|
|
tokenContainer->Clear();
|
|
|
|
tokenContainer->AddStringToken((int)eDROnpauseST::name, recording->Name());
|
|
|
|
const cRecordingInfo *info = recording->Info();
|
|
|
|
if (info) {
|
|
|
|
tokenContainer->AddStringToken((int)eDROnpauseST::shorttext, info->ShortText());
|
|
|
|
tokenContainer->AddStringToken((int)eDROnpauseST::description, info->Description());
|
|
|
|
const cEvent *event = info->GetEvent();
|
|
|
|
if (event) {
|
|
|
|
string recDate = *(event->GetDateString());
|
|
|
|
string recTime = *(event->GetTimeString());
|
|
|
|
if (recDate.find("1970") != string::npos) {
|
|
|
|
time_t start = recording->Start();
|
|
|
|
recDate = *DateString(start);
|
|
|
|
recTime = *TimeString(start);
|
|
|
|
}
|
|
|
|
tokenContainer->AddStringToken((int)eDROnpauseST::date, recDate.c_str());
|
|
|
|
tokenContainer->AddStringToken((int)eDROnpauseST::time, recTime.c_str());
|
|
|
|
time_t startTime = event->StartTime();
|
|
|
|
struct tm * sStartTime = localtime(&startTime);
|
|
|
|
tokenContainer->AddIntToken((int)eDROnpauseIT::year, sStartTime->tm_year + 1900);
|
|
|
|
tokenContainer->AddIntToken((int)eDROnpauseIT::daynumeric, sStartTime->tm_mday);
|
|
|
|
tokenContainer->AddIntToken((int)eDROnpauseIT::month, sStartTime->tm_mon+1);
|
|
|
|
int duration = event->Duration() / 60;
|
|
|
|
int recDuration = recording->LengthInSeconds();
|
|
|
|
recDuration = (recDuration>0)?(recDuration / 60):0;
|
|
|
|
tokenContainer->AddIntToken((int)eDROnpauseIT::duration, recDuration);
|
|
|
|
tokenContainer->AddIntToken((int)eDROnpauseIT::durationhours, recDuration / 60);
|
|
|
|
tokenContainer->AddStringToken((int)eDROnpauseST::durationminutes, *cString::sprintf("%.2d", recDuration%60));
|
|
|
|
tokenContainer->AddIntToken((int)eDROnpauseIT::durationevent, duration);
|
|
|
|
tokenContainer->AddIntToken((int)eDROnpauseIT::durationeventhours, duration / 60);
|
|
|
|
tokenContainer->AddStringToken((int)eDROnpauseST::durationeventminutes, *cString::sprintf("%.2d", duration%60));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
vector<int> loopInfo;
|
|
|
|
bool scrapInfoAvailable = LoadFullScrapInfo(NULL, recording);
|
|
|
|
int numActors = NumActors();
|
|
|
|
loopInfo.push_back(numActors);
|
|
|
|
tokenContainer->CreateLoopTokenContainer(&loopInfo);
|
|
|
|
if (scrapInfoAvailable) {
|
|
|
|
SetFullScrapInfo(tokenContainer, actorsIndex);
|
|
|
|
}
|
|
|
|
|
|
|
|
SetDirty();
|
|
|
|
delete recording;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-03-22 16:55:46 +01:00
|
|
|
void cVeDrOnPause::ResetSleep(void) {
|
|
|
|
if (!detacher)
|
|
|
|
return;
|
|
|
|
detacher->ResetSleep();
|
|
|
|
}
|
|
|
|
|
2016-02-06 09:55:15 +01:00
|
|
|
/******************************************************************
|
|
|
|
* cVeDrScraperContent
|
|
|
|
******************************************************************/
|
|
|
|
cVeDrScraperContent::cVeDrScraperContent(void) {
|
|
|
|
recording = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
cVeDrScraperContent::~cVeDrScraperContent(void) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrScraperContent::SetTokenContainer(void) {
|
|
|
|
tokenContainer = new skindesignerapi::cTokenContainer();
|
|
|
|
tokenContainer->DefineStringToken("{posterpath}", (int)eScraperPosterBannerST::posterpath);
|
|
|
|
tokenContainer->DefineStringToken("{bannerpath}", (int)eScraperPosterBannerST::bannerpath);
|
|
|
|
tokenContainer->DefineStringToken("{mediapath}", (int)eScraperPosterBannerST::mediapath);
|
|
|
|
tokenContainer->DefineIntToken("{posterwidth}", (int)eScraperPosterBannerIT::posterwidth);
|
|
|
|
tokenContainer->DefineIntToken("{posterheight}", (int)eScraperPosterBannerIT::posterheight);
|
2016-03-30 00:28:31 +02:00
|
|
|
tokenContainer->DefineIntToken("{hasposter}", (int)eScraperPosterBannerIT::hasposter);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->DefineIntToken("{bannerwidth}", (int)eScraperPosterBannerIT::bannerwidth);
|
|
|
|
tokenContainer->DefineIntToken("{bannerheight}", (int)eScraperPosterBannerIT::bannerheight);
|
2016-03-30 00:28:31 +02:00
|
|
|
tokenContainer->DefineIntToken("{hasbanner}", (int)eScraperPosterBannerIT::hasbanner);
|
2016-02-06 09:55:15 +01:00
|
|
|
tokenContainer->DefineIntToken("{mediawidth}", (int)eScraperPosterBannerIT::mediawidth);
|
|
|
|
tokenContainer->DefineIntToken("{mediaheight}", (int)eScraperPosterBannerIT::mediaheight);
|
|
|
|
tokenContainer->DefineIntToken("{isbanner}", (int)eScraperPosterBannerIT::isbanner);
|
|
|
|
InheritTokenContainer();
|
|
|
|
}
|
|
|
|
|
|
|
|
void cVeDrScraperContent::Set(const cRecording *recording) {
|
|
|
|
this->recording = recording;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool cVeDrScraperContent::Parse(bool force) {
|
|
|
|
if (!cViewElement::Parse(force))
|
|
|
|
return false;
|
|
|
|
if (!recording)
|
|
|
|
return false;
|
|
|
|
SetPosterBanner(tokenContainer, NULL, recording);
|
|
|
|
SetDirty();
|
|
|
|
return true;
|
|
|
|
}
|