From 60303c4b9fe6fcddaecb29830d099703a7b1a4d1 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Fri, 3 Jun 2022 17:59:34 +0200 Subject: Add a simple VolumeBox for DisplayChannel Adds a simpler volume box in DisplayChannel. An setup option is added to change the type of volume box. --- displaychannelview.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'displaychannelview.c') diff --git a/displaychannelview.c b/displaychannelview.c index 52bda78..929faa4 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -714,6 +714,8 @@ std::string cNopacityDisplayChannelView::GetChannelSep(const cChannel *channel, } void cNopacityDisplayChannelView::DrawSourceInfo(void) { + if (volumeBox && (config.GetValue("displayChannelVolume") == vbSimple)) + return; const cChannel *channel = cDevice::ActualDevice()->GetCurrentlyTunedTransponder(); const cSource *source = (channel) ? Sources.Get(channel->Source()) : NULL; cString channelInfo = ""; @@ -772,9 +774,18 @@ 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); + bool simple = false; + if (config.GetValue("displayChannelVolume") == vbSimple) { + ClearSourceInfo(); + simple = true; + } + volumeBox = new cNopacityVolumeBox(osd, + cRect(geoManager->channelVolumeLeft, + geoManager->channelVolumeTop, + geoManager->channelVolumeWidth, + geoManager->channelVolumeHeight), + simple ? fontManager->channelSourceInfo : fontManager->volumeText, + simple); } volumeBox->SetVolume(volume, MAXVOLUME, volume ? false : true); lastVolumeTime = time(NULL); -- cgit v1.2.3