summaryrefslogtreecommitdiff
path: root/displaychannelview.c
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2022-06-03 11:12:35 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2022-06-09 13:46:58 +0200
commit20a614b36949b34c43ceff2581ac31b71d2be656 (patch)
tree41e1c4ee9f59b98f73ff57f8940547ca729c6649 /displaychannelview.c
parentaec9a6edcab49be159391dffbcbd4259e356d43f (diff)
downloadskin-nopacity-20a614b36949b34c43ceff2581ac31b71d2be656.tar.gz
skin-nopacity-20a614b36949b34c43ceff2581ac31b71d2be656.tar.bz2
Use VolumeBox for DisplayChannel
Shows the volume box in DisplayChannel. An setup option is added to activate the volume box.
Diffstat (limited to 'displaychannelview.c')
-rw-r--r--displaychannelview.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/displaychannelview.c b/displaychannelview.c
index 3e5c759..9f20953 100644
--- a/displaychannelview.c
+++ b/displaychannelview.c
@@ -5,6 +5,7 @@
#include "fontmanager.h"
#include "geometrymanager.h"
#include "imageloader.h"
+#include "status.h"
#include <vdr/menu.h>
cNopacityDisplayChannelView::cNopacityDisplayChannelView(cOsd *osd) {
@@ -25,6 +26,9 @@ cNopacityDisplayChannelView::cNopacityDisplayChannelView(cOsd *osd) {
pixmapSignalLabel = NULL;
pixmapPoster = NULL;
messageBox = NULL;
+ volumeBox = NULL;
+ lastVolume = statusMonitor->GetVolume();
+ lastVolumeTime = time(NULL);
CreatePixmaps();
DrawBackground();
if (config.GetValue("displaySignalStrength")) {
@@ -55,6 +59,7 @@ cNopacityDisplayChannelView::~cNopacityDisplayChannelView(void) {
if (pixmapPoster)
osd->DestroyPixmap(pixmapPoster);
delete messageBox;
+ delete volumeBox;
}
void cNopacityDisplayChannelView::CreatePixmaps(void) {
@@ -171,6 +176,8 @@ void cNopacityDisplayChannelView::SetAlpha(int alpha) {
pixmapSignalLabel->SetAlpha(alpha);
if (pixmapPoster)
pixmapPoster->SetAlpha(alpha);
+ if (volumeBox)
+ volumeBox->SetAlpha(alpha);
}
void cNopacityDisplayChannelView::DrawBackground(void) {
@@ -771,3 +778,21 @@ void cNopacityDisplayChannelView::DisplayMessage(eMessageType Type, const char *
geoManager->messageWidth, geoManager->messageHeight),
Type, Text);
}
+
+void cNopacityDisplayChannelView::DrawVolume(void) {
+ int volume = statusMonitor->GetVolume();
+ if (volume != lastVolume) {
+ if (!volumeBox) {
+ int left = (geoManager->channelOsdWidth - geoManager->volumeWidth) / 2;
+ int top = geoManager->channelOsdHeight - geoManager->volumeHeight - config.GetValue("channelBorderVolumeBottom");
+ volumeBox = new cNopacityVolumeBox(osd, cRect(left, top, geoManager->volumeWidth, geoManager->volumeHeight), fontManager->volumeText);
+ }
+ volumeBox->SetVolume(volume, MAXVOLUME, volume ? false : true);
+ lastVolumeTime = time(NULL);
+ lastVolume = volume;
+ }
+ else {
+ if (volumeBox && (time(NULL) - lastVolumeTime > 2))
+ DELETENULL(volumeBox);
+ }
+}