vdr-plugin-skindesigner/displayreplay.c

88 lines
2.0 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) {
init = true;
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);
if (init) {
view->SetRecordingLength(Recording->LengthInSeconds());
init = false;
}
}
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);
if (init) {
view->SetRecordingLength(0);
init = false;
}
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);
view->SetMarks(marks, Current, Total);
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
}