diff options
author | louis <louis.braun@gmx.de> | 2016-01-26 18:32:38 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2016-01-26 18:32:38 +0100 |
commit | 809fbda03c5014ba9cd361f5113d1d717cd41ea6 (patch) | |
tree | 264bbc5640375f1bcb165fc7f4a3e595adcc26ca /displayvolume.c | |
parent | 196dd7eb9965a405bb16b51dc870fbbb31aeef87 (diff) | |
download | vdr-plugin-skindesigner-809fbda03c5014ba9cd361f5113d1d717cd41ea6.tar.gz vdr-plugin-skindesigner-809fbda03c5014ba9cd361f5113d1d717cd41ea6.tar.bz2 |
Version 0.8.0 beta
Diffstat (limited to 'displayvolume.c')
-rw-r--r-- | displayvolume.c | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/displayvolume.c b/displayvolume.c index d50e470..02e61d5 100644 --- a/displayvolume.c +++ b/displayvolume.c @@ -1,44 +1,26 @@ #include "displayvolume.h" #include "config.h" -#include "libcore/helpers.h" -cSDDisplayVolume::cSDDisplayVolume(cTemplate *volumeTemplate) { - volumeView = NULL; - doOutput = true; - initial = true; - if (!volumeTemplate) { - doOutput = false; - esyslog("skindesigner: displayVolume no valid template - aborting"); - return; - } - volumeView = new cDisplayVolumeView(volumeTemplate->GetRootView()); - if (!volumeView->createOsd()) { - doOutput = false; - } else { - volumeView->DrawDebugGrid(); - volumeView->DrawBackground(); - } +cSDDisplayVolume::cSDDisplayVolume(cViewVolume *volumeView) { + view = volumeView; + ok = view->Init(); + if (!ok) + esyslog("skindesigner: Error initiating displayvolume view - aborting"); } cSDDisplayVolume::~cSDDisplayVolume() { - if (volumeView) - delete volumeView; + view->Close(); } void cSDDisplayVolume::SetVolume(int Current, int Total, bool Mute) { - if (!doOutput) + if (!ok) return; - volumeView->DrawVolume(Current, Total, Mute); + view->SetVolume(Current, Total, Mute); } void cSDDisplayVolume::Flush(void) { - if (!doOutput) + if (!ok) return; - if (initial) { - volumeView->DoFadeIn(); - initial = false; - } else { - volumeView->Flush(); - } + view->Flush(); } |