vdr-plugin-skindesigner/coreengine/viewdisplayvolume.c

52 lines
1.4 KiB
C
Raw Normal View History

2016-02-06 09:55:15 +01:00
#include "viewdisplayvolume.h"
/************************************************************************************
* cViewVolume
************************************************************************************/
cViewVolume::cViewVolume(void) {
viewId = eViewType::DisplayVolume;
viewName = strdup("displayvolume");
numViewElements = (int)eVeDisplayVolume::count;
viewElements = new cViewElement*[numViewElements];
for (int i=0; i < numViewElements; i++) {
viewElements[i] = NULL;
}
SetViewElements();
ClearVariables();
veVolume = NULL;
}
cViewVolume::~cViewVolume() {
}
void cViewVolume::SetViewElements(void) {
viewElementNames.insert(pair<string, int>("background", (int)eVeDisplayVolume::background));
viewElementNames.insert(pair<string, int>("volume", (int)eVeDisplayVolume::volume));
}
void cViewVolume::SetViewElementObjects(void) {
if (!viewElements[(int)eVeDisplayVolume::volume])
return;
veVolume = dynamic_cast<cVeVolume*>(viewElements[(int)eVeDisplayVolume::volume]);
}
void cViewVolume::ClearVariables(void) {
init = true;
}
void cViewVolume::SetVolume(int current, int total, bool mute) {
if (veVolume)
veVolume->Set(current, total, mute);
}
2016-07-22 15:21:09 +02:00
void cViewVolume::Flush(void) {
2016-02-06 09:55:15 +01:00
if (init) {
Render((int)eVeDisplayVolume::background);
}
Render((int)eVeDisplayVolume::volume);
2016-07-22 15:21:09 +02:00
cView::Flush();
2016-02-06 09:55:15 +01:00
}