mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
moved access to cControl to main thread to avoid crash in onpauseview
This commit is contained in:
parent
19dfd1af7b
commit
db54050b5e
@ -1,4 +1,5 @@
|
|||||||
#define __STL_CONFIG_H
|
#define __STL_CONFIG_H
|
||||||
|
#include <vdr/player.h>
|
||||||
#include "displayreplay.h"
|
#include "displayreplay.h"
|
||||||
|
|
||||||
cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) {
|
cSDDisplayReplay::cSDDisplayReplay(cTemplate *replayTemplate, bool ModeOnly) {
|
||||||
@ -41,7 +42,14 @@ void cSDDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
|
|||||||
if (!doOutput)
|
if (!doOutput)
|
||||||
return;
|
return;
|
||||||
if (!Play && Speed < 0) {
|
if (!Play && Speed < 0) {
|
||||||
replayView->DrawOnPause(modeOnly);
|
string recFileName = "";
|
||||||
|
cControl *control = cControl::Control();
|
||||||
|
if (control) {
|
||||||
|
const cRecording *recording = control->GetRecording();
|
||||||
|
if (recording && recording->FileName())
|
||||||
|
recFileName = recording->FileName();
|
||||||
|
}
|
||||||
|
replayView->DrawOnPause(recFileName, modeOnly);
|
||||||
} else {
|
} else {
|
||||||
replayView->ClearOnPause();
|
replayView->ClearOnPause();
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#define __STL_CONFIG_H
|
#define __STL_CONFIG_H
|
||||||
#include <vdr/player.h>
|
|
||||||
#include "displayreplayonpauseview.h"
|
#include "displayreplayonpauseview.h"
|
||||||
|
|
||||||
cDisplayReplayOnPauseView::cDisplayReplayOnPauseView(cTemplateViewElement *tmplViewElement) : cView(tmplViewElement) {
|
cDisplayReplayOnPauseView::cDisplayReplayOnPauseView(string recFileName, cTemplateViewElement *tmplViewElement) : cView(tmplViewElement) {
|
||||||
|
this->recFileName = recFileName;
|
||||||
tmplViewElement->SetPixOffset(0);
|
tmplViewElement->SetPixOffset(0);
|
||||||
delay = tmplViewElement->GetNumericParameter(ptDelay) * 1000;
|
delay = tmplViewElement->GetNumericParameter(ptDelay) * 1000;
|
||||||
SetFadeTime(tmplViewElement->GetNumericParameter(ptFadeTime));
|
SetFadeTime(tmplViewElement->GetNumericParameter(ptFadeTime));
|
||||||
@ -18,11 +18,10 @@ void cDisplayReplayOnPauseView::Render(void) {
|
|||||||
map < string, string > stringTokens;
|
map < string, string > stringTokens;
|
||||||
map < string, int > intTokens;
|
map < string, int > intTokens;
|
||||||
map < string, vector< map< string, string > > > loopTokens;
|
map < string, vector< map< string, string > > > loopTokens;
|
||||||
const cRecording *recording = NULL;
|
if (recFileName.size() == 0)
|
||||||
cControl *control = cControl::Control();
|
return;
|
||||||
if (control) {
|
const cRecording *recording = new cRecording(recFileName.c_str());
|
||||||
recording = control->GetRecording();
|
|
||||||
}
|
|
||||||
if (recording) {
|
if (recording) {
|
||||||
string name = recording->Name() ? recording->Name() : "";
|
string name = recording->Name() ? recording->Name() : "";
|
||||||
stringTokens.insert(pair<string,string>("name", name));
|
stringTokens.insert(pair<string,string>("name", name));
|
||||||
@ -81,6 +80,8 @@ void cDisplayReplayOnPauseView::Render(void) {
|
|||||||
}
|
}
|
||||||
SetScraperTokens(NULL, recording, stringTokens, intTokens, loopTokens);
|
SetScraperTokens(NULL, recording, stringTokens, intTokens, loopTokens);
|
||||||
DrawViewElement(veOnPause, &stringTokens, &intTokens, &loopTokens);
|
DrawViewElement(veOnPause, &stringTokens, &intTokens, &loopTokens);
|
||||||
|
if (recording)
|
||||||
|
delete recording;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cDisplayReplayOnPauseView::Action(void) {
|
void cDisplayReplayOnPauseView::Action(void) {
|
||||||
|
@ -9,9 +9,10 @@ class cDisplayReplayOnPauseView : public cView, public cViewHelpers {
|
|||||||
private:
|
private:
|
||||||
int delay;
|
int delay;
|
||||||
bool resetSleep;
|
bool resetSleep;
|
||||||
|
string recFileName;
|
||||||
virtual void Action(void);
|
virtual void Action(void);
|
||||||
public:
|
public:
|
||||||
cDisplayReplayOnPauseView(cTemplateViewElement *tmplViewElement);
|
cDisplayReplayOnPauseView(string recFileName, cTemplateViewElement *tmplViewElement);
|
||||||
virtual ~cDisplayReplayOnPauseView();
|
virtual ~cDisplayReplayOnPauseView();
|
||||||
void ResetSleep(void) { resetSleep = true; };
|
void ResetSleep(void) { resetSleep = true; };
|
||||||
void Render(void);
|
void Render(void);
|
||||||
|
@ -376,12 +376,12 @@ void cDisplayReplayView::DrawMessage(eMessageType type, const char *text) {
|
|||||||
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
DrawViewElement(veMessage, &stringTokens, &intTokens);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cDisplayReplayView::DrawOnPause(bool modeOnly) {
|
void cDisplayReplayView::DrawOnPause(string recFileName, bool modeOnly) {
|
||||||
eViewElement veTmplOnPause = modeOnly ? veOnPauseModeOnly : veOnPause;
|
eViewElement veTmplOnPause = modeOnly ? veOnPauseModeOnly : veOnPause;
|
||||||
cTemplateViewElement *tmplOnPause = tmplView->GetViewElement(veTmplOnPause);
|
cTemplateViewElement *tmplOnPause = tmplView->GetViewElement(veTmplOnPause);
|
||||||
if (!tmplOnPause)
|
if (!tmplOnPause)
|
||||||
return;
|
return;
|
||||||
onPauseView = new cDisplayReplayOnPauseView(tmplOnPause);
|
onPauseView = new cDisplayReplayOnPauseView(recFileName, tmplOnPause);
|
||||||
onPauseView->Start();
|
onPauseView->Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public:
|
|||||||
void DrawControlIcons(bool play, bool forward, int speed, bool modeOnly);
|
void DrawControlIcons(bool play, bool forward, int speed, bool modeOnly);
|
||||||
void DrawJump(const char *jump);
|
void DrawJump(const char *jump);
|
||||||
void DrawMessage(eMessageType type, const char *text);
|
void DrawMessage(eMessageType type, const char *text);
|
||||||
void DrawOnPause(bool modeOnly);
|
void DrawOnPause(string recFileName, bool modeOnly);
|
||||||
void ClearOnPause(void);
|
void ClearOnPause(void);
|
||||||
void DelayOnPause(void);
|
void DelayOnPause(void);
|
||||||
void DrawCustomTokens(void);
|
void DrawCustomTokens(void);
|
||||||
|
Loading…
Reference in New Issue
Block a user