vdr-plugin-skindesigner/displayreplay.c

81 lines
1.9 KiB
C
Raw Normal View History

2014-09-27 09:25:14 +02:00
#include "displayreplay.h"
2016-01-26 18:32:38 +01:00
cSDDisplayReplay::cSDDisplayReplay(cViewReplay *replayView, bool ModeOnly) {
view = replayView;
ok = view->Init();
if (!ok)
esyslog("skindesigner: Error initiating displayreplay view - aborting");
view->SetModeOnly(ModeOnly);
2014-09-27 09:25:14 +02:00
}
cSDDisplayReplay::~cSDDisplayReplay() {
2016-01-26 18:32:38 +01:00
view->Close();
2014-09-27 09:25:14 +02:00
}
void cSDDisplayReplay::SetRecording(const cRecording *Recording) {
2016-01-26 18:32:38 +01:00
if (ok) {
view->SetRecording(Recording);
}
2014-09-27 09:25:14 +02:00
}
2015-02-01 14:45:33 +01:00
void cSDDisplayReplay::SetTitle(const char *Title) {
if (!ok)
return;
2016-01-26 18:32:38 +01:00
view->SetTitle(Title);
2015-02-01 14:45:33 +01:00
}
2014-09-27 09:25:14 +02:00
void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
2016-01-26 18:32:38 +01:00
if (!ok)
2014-09-27 09:25:14 +02:00
return;
if (!Play && Speed < 0) {
cControl *control = cControl::Control();
if (control) {
const cRecording *recording = control->GetRecording();
2016-01-26 18:32:38 +01:00
if (recording && recording->FileName()) {
view->StartOnPause(recording->FileName());
}
}
} else {
2016-01-26 18:32:38 +01:00
view->ClearOnPause();
}
2016-01-26 18:32:38 +01:00
view->SetControlIcons(Play, Forward, Speed);
2014-09-27 09:25:14 +02:00
}
void cSDDisplayReplay::SetProgress(int Current, int Total) {
2016-01-26 18:32:38 +01:00
if (ok) {
view->SetProgressbar(Current, Total);
if (marks)
view->SetMarks(marks, Current, Total);
view->SetTimeshiftTimes(Current, Total);
2016-01-26 18:32:38 +01:00
view->SetEndTime(Current, Total);
view->DelayOnPause();
2016-01-26 18:32:38 +01:00
}
2014-09-27 09:25:14 +02:00
}
void cSDDisplayReplay::SetCurrent(const char *Current) {
2016-01-26 18:32:38 +01:00
if (ok)
view->SetCurrent(Current);
2014-09-27 09:25:14 +02:00
}
void cSDDisplayReplay::SetTotal(const char *Total) {
2016-01-26 18:32:38 +01:00
if (ok)
view->SetTotal(Total);
2014-09-27 09:25:14 +02:00
}
void cSDDisplayReplay::SetJump(const char *Jump) {
2016-01-26 18:32:38 +01:00
if (ok)
view->SetJump(Jump);
2014-09-27 09:25:14 +02:00
}
void cSDDisplayReplay::SetMessage(eMessageType Type, const char *Text) {
2016-01-26 18:32:38 +01:00
if (ok)
view->SetMessage(Type, Text);
2014-09-27 09:25:14 +02:00
}
void cSDDisplayReplay::Flush(void) {
2016-01-26 18:32:38 +01:00
if (!ok)
2014-09-27 09:25:14 +02:00
return;
2016-07-22 15:21:09 +02:00
view->Flush();
2014-09-27 09:25:14 +02:00
}