mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
46 lines
1.0 KiB
C
46 lines
1.0 KiB
C
#include "displaymessage.h"
|
|
|
|
cSDDisplayMessage::cSDDisplayMessage(cTemplate *messageTemplate) {
|
|
messageView = NULL;
|
|
doOutput = true;
|
|
initial = true;
|
|
if (!messageTemplate) {
|
|
doOutput = false;
|
|
esyslog("skindesigner: displayMessage no valid template - aborting");
|
|
return;
|
|
}
|
|
messageView = new cDisplayMessageView(messageTemplate->GetRootView());
|
|
if (!messageView->createOsd()) {
|
|
doOutput = false;
|
|
return;
|
|
}
|
|
messageView->DrawBackground();
|
|
}
|
|
|
|
cSDDisplayMessage::~cSDDisplayMessage() {
|
|
if (messageView)
|
|
delete messageView;
|
|
}
|
|
|
|
void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) {
|
|
if (!doOutput)
|
|
return;
|
|
messageView->ClearMessage();
|
|
if (!Text) {
|
|
return;
|
|
}
|
|
messageView->DrawMessage(Type, Text);
|
|
}
|
|
|
|
|
|
void cSDDisplayMessage::Flush(void) {
|
|
if (!doOutput)
|
|
return;
|
|
if (initial) {
|
|
messageView->DoFadeIn();
|
|
initial = false;
|
|
} else {
|
|
messageView->Flush();
|
|
}
|
|
}
|