vdr-plugin-skindesigner/displayvolume.c

44 lines
998 B
C
Raw Normal View History

2014-09-27 09:25:14 +02:00
#include "displayvolume.h"
#include "config.h"
#include "libcore/helpers.h"
cSDDisplayVolume::cSDDisplayVolume(cTemplate *volumeTemplate) {
volumeView = NULL;
2014-09-27 09:25:14 +02:00
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->DrawBackground();
}
}
cSDDisplayVolume::~cSDDisplayVolume() {
if (volumeView)
delete volumeView;
2014-09-27 09:25:14 +02:00
}
void cSDDisplayVolume::SetVolume(int Current, int Total, bool Mute) {
if (!doOutput)
return;
volumeView->DrawVolume(Current, Total, Mute);
}
void cSDDisplayVolume::Flush(void) {
if (!doOutput)
return;
if (initial) {
volumeView->DoFadeIn();
initial = false;
} else {
volumeView->Flush();
}
}