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);
|
2015-05-16 07:57:14 +02:00
|
|
|
}
|
2014-09-27 09:25:14 +02:00
|
|
|
}
|
|
|
|
|
2015-02-01 14:45:33 +01:00
|
|
|
void cSDDisplayReplay::SetTitle(const char *Title) {
|
2021-02-01 13:31:08 +01:00
|
|
|
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;
|
2014-11-29 11:23:54 +01:00
|
|
|
if (!Play && Speed < 0) {
|
2015-03-19 16:31:39 +01:00
|
|
|
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());
|
|
|
|
}
|
2015-03-19 16:31:39 +01:00
|
|
|
}
|
2014-11-29 11:23:54 +01:00
|
|
|
} else {
|
2016-01-26 18:32:38 +01:00
|
|
|
view->ClearOnPause();
|
2014-11-29 11:23:54 +01:00
|
|
|
}
|
2015-07-25 14:19:32 +02:00
|
|
|
|
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);
|
2021-03-28 12:14:41 +02:00
|
|
|
if (marks)
|
|
|
|
view->SetMarks(marks, Current, Total);
|
2021-02-12 15:20:34 +01:00
|
|
|
view->SetTimeshiftTimes(Current, Total);
|
2016-01-26 18:32:38 +01:00
|
|
|
view->SetEndTime(Current, Total);
|
2016-03-22 16:55:46 +01:00
|
|
|
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
|
|
|
}
|