blob: d50e470cf23af69b3176e7846e81c8563e95765c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#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() {
if (volumeView)
delete volumeView;
}
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();
}
}
|