2014-09-27 09:25:14 +02:00
|
|
|
#include "displaymessage.h"
|
|
|
|
|
|
|
|
cSDDisplayMessage::cSDDisplayMessage(cTemplate *messageTemplate) {
|
2015-01-18 12:03:06 +01:00
|
|
|
messageView = NULL;
|
2014-09-27 09:25:14 +02:00
|
|
|
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;
|
|
|
|
}
|
2015-04-11 16:21:33 +02:00
|
|
|
messageView->DrawDebugGrid();
|
2014-09-27 09:25:14 +02:00
|
|
|
messageView->DrawBackground();
|
|
|
|
}
|
|
|
|
|
|
|
|
cSDDisplayMessage::~cSDDisplayMessage() {
|
2015-01-18 12:03:06 +01:00
|
|
|
if (messageView)
|
|
|
|
delete messageView;
|
2014-09-27 09:25:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) {
|
|
|
|
if (!doOutput)
|
|
|
|
return;
|
2014-11-21 19:19:59 +01:00
|
|
|
messageView->ClearMessage();
|
2014-11-18 18:33:27 +01:00
|
|
|
if (!Text) {
|
2014-09-27 09:25:14 +02:00
|
|
|
return;
|
2014-11-18 18:33:27 +01:00
|
|
|
}
|
2014-09-27 09:25:14 +02:00
|
|
|
messageView->DrawMessage(Type, Text);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void cSDDisplayMessage::Flush(void) {
|
|
|
|
if (!doOutput)
|
|
|
|
return;
|
|
|
|
if (initial) {
|
|
|
|
messageView->DoFadeIn();
|
|
|
|
initial = false;
|
|
|
|
} else {
|
|
|
|
messageView->Flush();
|
|
|
|
}
|
|
|
|
}
|