mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
Fixed an error in displayreplay if no recording information are available
This commit is contained in:
parent
6aeaf41467
commit
1c393e23a5
@ -191,6 +191,8 @@ void cViewReplay::GetTimers(void) {
|
|||||||
|
|
||||||
void cViewReplay::SetTimeShiftValues(const cRecording *recording) {
|
void cViewReplay::SetTimeShiftValues(const cRecording *recording) {
|
||||||
//check for instant recording
|
//check for instant recording
|
||||||
|
if (!recording)
|
||||||
|
return;
|
||||||
const char *recName = recording->Name();
|
const char *recName = recording->Name();
|
||||||
if (recName && *recName == '@')
|
if (recName && *recName == '@')
|
||||||
return;
|
return;
|
||||||
@ -224,6 +226,12 @@ void cViewReplay::SetTitle(const char *title) {
|
|||||||
if (veRecTitle) {
|
if (veRecTitle) {
|
||||||
veRecTitle->Set(title);
|
veRecTitle->Set(title);
|
||||||
}
|
}
|
||||||
|
if (veRecInfo) {
|
||||||
|
veRecInfo->Set(NULL);
|
||||||
|
}
|
||||||
|
if (veScraperContent) {
|
||||||
|
veScraperContent->Set(NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cViewReplay::SetCurrent(const char *current) {
|
void cViewReplay::SetCurrent(const char *current) {
|
||||||
@ -239,7 +247,7 @@ void cViewReplay::SetTotal(const char *total) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cViewReplay::SetEndTime(int current, int total) {
|
void cViewReplay::SetEndTime(int current, int total) {
|
||||||
if (!veEndTime)
|
if (!veEndTime || reclength == 0)
|
||||||
return;
|
return;
|
||||||
int totalLength = total;
|
int totalLength = total;
|
||||||
int recordingLength = reclength;
|
int recordingLength = reclength;
|
||||||
@ -248,7 +256,7 @@ void cViewReplay::SetEndTime(int current, int total) {
|
|||||||
recordingLength = timeShiftLength;
|
recordingLength = timeShiftLength;
|
||||||
}
|
}
|
||||||
double rest = (double)(totalLength - current) / (double)totalLength;
|
double rest = (double)(totalLength - current) / (double)totalLength;
|
||||||
time_t end = time(0) + rest*recordingLength;
|
time_t end = time(0) + rest * recordingLength;
|
||||||
veEndTime->Set(TimeString(end));
|
veEndTime->Set(TimeString(end));
|
||||||
Render((int)eVeDisplayReplay::endtime);
|
Render((int)eVeDisplayReplay::endtime);
|
||||||
}
|
}
|
||||||
|
@ -25,10 +25,24 @@ void cVeDrRecTitle::SetTokenContainer(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cVeDrRecTitle::Set(const cRecording *recording) {
|
void cVeDrRecTitle::Set(const cRecording *recording) {
|
||||||
|
if (this->title) {
|
||||||
|
free(this->title);
|
||||||
|
this->title = NULL;
|
||||||
|
}
|
||||||
|
if (this->recording)
|
||||||
|
this->recording = NULL;
|
||||||
|
if (!recording)
|
||||||
|
return;
|
||||||
this->recording = recording;
|
this->recording = recording;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cVeDrRecTitle::Set(const char *title) {
|
void cVeDrRecTitle::Set(const char *title) {
|
||||||
|
if (this->title) {
|
||||||
|
free(this->title);
|
||||||
|
this->title = NULL;
|
||||||
|
}
|
||||||
|
if (this->recording)
|
||||||
|
this->recording = NULL;
|
||||||
if (!title)
|
if (!title)
|
||||||
return;
|
return;
|
||||||
free(this->title);
|
free(this->title);
|
||||||
@ -52,9 +66,9 @@ bool cVeDrRecTitle::Parse(bool force) {
|
|||||||
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, recName);
|
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, recName);
|
||||||
tokenContainer->AddStringToken((int)eDRRecTitleST::recsubtitle, recInfo ? recInfo->ShortText() : "");
|
tokenContainer->AddStringToken((int)eDRRecTitleST::recsubtitle, recInfo ? recInfo->ShortText() : "");
|
||||||
tokenContainer->AddStringToken((int)eDRRecTitleST::recdate, *ShortDateString(recording->Start()));
|
tokenContainer->AddStringToken((int)eDRRecTitleST::recdate, *ShortDateString(recording->Start()));
|
||||||
tokenContainer->AddStringToken((int)eDRRecTitleST::rectime, *TimeString(recording->Start()));
|
tokenContainer->AddStringToken((int)eDRRecTitleST::rectime, *TimeString(recording->Start()));
|
||||||
} else if (title) {
|
} else if (title) {
|
||||||
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, title);
|
tokenContainer->AddStringToken((int)eDRRecTitleST::rectitle, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetDirty();
|
SetDirty();
|
||||||
|
@ -25,7 +25,14 @@ void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cSDDisplayReplay::SetTitle(const char *Title) {
|
void cSDDisplayReplay::SetTitle(const char *Title) {
|
||||||
|
if (!ok)
|
||||||
|
return;
|
||||||
view->SetTitle(Title);
|
view->SetTitle(Title);
|
||||||
|
if (init) {
|
||||||
|
view->SetRecordingLength(0);
|
||||||
|
view->SetTimeShiftValues(NULL);
|
||||||
|
init = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
|
void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user