summaryrefslogtreecommitdiff
path: root/messagebox.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-05-20 11:37:37 +0200
committerlouis <louis.braun@gmx.de>2013-05-20 11:37:37 +0200
commitc611e004582067640111ef2f023410025201157d (patch)
tree3a71e9893bffa4bf9d38c49389dad5f43d046ec3 /messagebox.c
parent063094f442c0ac3c592d2e5bb5c416d6820d2602 (diff)
downloadvdr-plugin-tvguide-c611e004582067640111ef2f023410025201157d.tar.gz
vdr-plugin-tvguide-c611e004582067640111ef2f023410025201157d.tar.bz2
rewrote epg grid handling and scrolling, added status header
Diffstat (limited to 'messagebox.c')
-rw-r--r--messagebox.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/messagebox.c b/messagebox.c
index 3f727d4..b399924 100644
--- a/messagebox.c
+++ b/messagebox.c
@@ -8,7 +8,9 @@ cMessageBoxThread::cMessageBoxThread(cPixmap *content, int displayTime) {
}
cMessageBoxThread::~cMessageBoxThread(void) {
- Cancel(0);
+ Cancel(-1);
+ while (Active())
+ cCondWait::SleepMs(10);
}
void cMessageBoxThread::Action(void) {
@@ -18,7 +20,7 @@ void cMessageBoxThread::Action(void) {
cPixmap::Lock();
double t = min(double(Now - Start) / FadeTime, 1.0);
int Alpha = t * ALPHA_OPAQUE;
- if (content) {
+ if (Running() && content) {
content->SetAlpha(Alpha);
osdManager.flush();
}
@@ -36,7 +38,7 @@ void cMessageBoxThread::Action(void) {
cPixmap::Lock();
double t = min(double(Now - Start) / FadeTime, 1.0);
int Alpha = (1-t) * ALPHA_OPAQUE;
- if (content) {
+ if (Running() && content) {
content->SetAlpha(Alpha);
osdManager.flush();
}
@@ -51,19 +53,16 @@ void cMessageBoxThread::Action(void) {
}
//--cMessageBox-------------------------------------------------------------
-cMutex cMessageBox::mutex;
cMessageBoxThread *cMessageBox::msgboxThread = NULL;
cPixmap *cMessageBox::content = NULL;
bool cMessageBox::Start(int displayTime, cString msg) {
- cMutexLock MutexLock(&mutex);
int width = (tvguideConfig.osdWidth - 600)/2;
if (!content) {
int height = 400;
content = osdManager.requestPixmap(5, cRect((tvguideConfig.osdWidth - width)/2,
(tvguideConfig.osdHeight- height)/2,
- width, height),
- cRect::Null, "msgbox");
+ width, height));
}
if (msgboxThread) {
delete msgboxThread;
@@ -94,7 +93,6 @@ bool cMessageBox::Start(int displayTime, cString msg) {
}
void cMessageBox::Stop(void) {
- cMutexLock MutexLock(&mutex);
if (msgboxThread) {
delete msgboxThread;
msgboxThread = NULL;
@@ -102,13 +100,12 @@ void cMessageBox::Stop(void) {
}
void cMessageBox::Destroy(void) {
- cMutexLock MutexLock(&mutex);
if (msgboxThread) {
delete msgboxThread;
msgboxThread = NULL;
}
if (content) {
- osdManager.releasePixmap(content, "msgboxDestroy");
+ osdManager.releasePixmap(content);
content = NULL;
}
}