From 1ea5cecda52336274ba20b7041553da10600909a Mon Sep 17 00:00:00 2001 From: kamel5 Date: Sat, 4 Jun 2022 15:04:35 +0200 Subject: Add a simple VolumeBox for DisplayReplay Adds a simpler volume box in DisplayReplay. An setup option is added to change the type of volume box. --- config.c | 2 +- displayreplay.c | 11 ++++++++--- geometrymanager.c | 14 ++++++++++++++ geometrymanager.h | 2 ++ po/ca_ES.po | 8 +++++++- po/de_DE.po | 8 +++++++- po/it_IT.po | 8 +++++++- po/sk_SK.po | 8 +++++++- setup.c | 8 ++++++-- setup.h | 1 + 10 files changed, 60 insertions(+), 10 deletions(-) diff --git a/config.c b/config.c index e306f2a..f82367a 100644 --- a/config.c +++ b/config.c @@ -203,7 +203,7 @@ void cNopacityConfig::LoadDefaults(void) { conf.insert(std::pair("replayBorderBottom", 15)); conf.insert(std::pair("replayFadeTime", 300)); conf.insert(std::pair("replayFadeOutTime", 300)); - conf.insert(std::pair("displayReplayVolume", 1)); + conf.insert(std::pair("displayReplayVolume", 2)); conf.insert(std::pair("replayBorderVolumeBottom", 0)); conf.insert(std::pair("fontReplayHeader", 0)); conf.insert(std::pair("fontReplay", 0)); diff --git a/displayreplay.c b/displayreplay.c index 40e278f..2c1350f 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -476,9 +476,14 @@ void cNopacityDisplayReplay::DrawVolume(void) { int volume = statusMonitor->GetVolume(); if (volume != lastVolume) { if (!volumeBox) { - int left = (geoManager->replayWidth - geoManager->volumeWidth) / 2; - int top = geoManager->replayHeight - geoManager->volumeHeight - config.GetValue("replayBorderVolumeBottom"); - volumeBox = new cNopacityVolumeBox(osd, cRect(left, top, geoManager->volumeWidth, geoManager->volumeHeight), fontManager->volumeText); + bool simple = (config.GetValue("displayReplayVolume") == vbSimple) ? true : false; + volumeBox = new cNopacityVolumeBox(osd, + cRect(geoManager->replayVolumeLeft, + geoManager->replayVolumeTop, + geoManager->replayVolumeWidth, + geoManager->replayVolumeHeight), + simple ? fontManager->channelSourceInfo : fontManager->volumeText, + simple); } volumeBox->SetVolume(volume, MAXVOLUME, volume ? false : true); lastVolumeTime = time(NULL); diff --git a/geometrymanager.c b/geometrymanager.c index 91c8459..4ed5828 100644 --- a/geometrymanager.c +++ b/geometrymanager.c @@ -242,4 +242,18 @@ void cGeometryManager::SetGeometry(void) { volumeProgressBarHeight = 0.3 * volumeHeight; if (volumeProgressBarHeight % 2 != 0) volumeProgressBarHeight++; + + // Volume Sizes for Replay + if (config.GetValue("displayReplayVolume") == vbSimple) { + replayVolumeLeft = replayOsdWidth / 3; + replayVolumeTop = replayHeight - replayFooterHeight; + replayVolumeWidth = replayOsdWidth / 3; + replayVolumeHeight = replayFooterHeight; + } else { + replayVolumeLeft = (replayOsdWidth - volumeWidth) / 2; + replayVolumeTop = replayOsdHeight - volumeHeight - config.GetValue("replayBorderVolumeBottom"); + replayVolumeWidth = volumeWidth; + replayVolumeHeight = volumeHeight; + } + } diff --git a/geometrymanager.h b/geometrymanager.h index a8ce169..9b74f4b 100644 --- a/geometrymanager.h +++ b/geometrymanager.h @@ -101,6 +101,8 @@ class cGeometryManager { int replayJumpWidth, replayJumpHeight; int replayMessageY; int replayMessageWidth, replayMessageHeight; + int replayVolumeLeft, replayVolumeTop; + int replayVolumeWidth, replayVolumeHeight; //DisplayMessage Sizes int messageWidth; int messageHeight; diff --git a/po/ca_ES.po b/po/ca_ES.po index 2d588f9..5111f87 100644 --- a/po/ca_ES.po +++ b/po/ca_ES.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: skinnopacity 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-01 17:59+0200\n" +"POT-Creation-Date: 2022-06-06 15:32+0200\n" "PO-Revision-Date: 2013-03-19 22:56+0100\n" "Last-Translator: Gabychan \n" "Language-Team: \n" @@ -659,6 +659,12 @@ msgstr "Ajusta mida de la Font - Grup de canals" msgid "Adjust Font Size - Next/Prev Channel Group" msgstr "Ajusta mida de la Font - Post/Ant Grup Canals" +msgid "simple" +msgstr "" + +msgid "full" +msgstr "" + msgid "Height of Replay Display (Percent of OSD Height)" msgstr "Alçada Visualització Reproducció (% alcada OSD)" diff --git a/po/de_DE.po b/po/de_DE.po index 1a3f053..7109f03 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: skinnopacity 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-01 17:59+0200\n" +"POT-Creation-Date: 2022-06-06 15:32+0200\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -656,6 +656,12 @@ msgstr "Schriftgröße Anpassen - Kanalgruppen" msgid "Adjust Font Size - Next/Prev Channel Group" msgstr "Schriftgröße Anpassen - vorh./nächste Kanalgruppe" +msgid "simple" +msgstr "vereinfacht" + +msgid "full" +msgstr "vollständig" + msgid "Height of Replay Display (Percent of OSD Height)" msgstr "Höhe der Wiedergabe Anzeige (% der OSD Höhe)" diff --git a/po/it_IT.po b/po/it_IT.po index a41cf6c..b0a6c6f 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: skinnopacity 0.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-01 17:59+0200\n" +"POT-Creation-Date: 2022-06-06 15:32+0200\n" "PO-Revision-Date: 2013-03-19 22:56+0100\n" "Last-Translator: Diego Pierotto \n" "Language-Team: \n" @@ -659,6 +659,12 @@ msgstr "" msgid "Adjust Font Size - Next/Prev Channel Group" msgstr "" +msgid "simple" +msgstr "" + +msgid "full" +msgstr "" + msgid "Height of Replay Display (Percent of OSD Height)" msgstr "Altezza di Mostra riproduzione (% altezza OSD)" diff --git a/po/sk_SK.po b/po/sk_SK.po index 517a523..abaf169 100644 --- a/po/sk_SK.po +++ b/po/sk_SK.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinnopacity\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-01 17:59+0200\n" +"POT-Creation-Date: 2022-06-06 15:32+0200\n" "PO-Revision-Date: 2013-11-11 20:52+0100\n" "Last-Translator: Milan Hrala \n" "Language-Team: \n" @@ -656,6 +656,12 @@ msgstr "Nastavenie ve msgid "Adjust Font Size - Next/Prev Channel Group" msgstr "Nastavenie veµkosti písma - Predchádzajúca/nasledujúca skupina kanálu" +msgid "simple" +msgstr "" + +msgid "full" +msgstr "" + msgid "Height of Replay Display (Percent of OSD Height)" msgstr "Vý¹ka zobrazenia prehrávania (Percento s OSD vý¹ky)" diff --git a/setup.c b/setup.c index 289cd27..75bc559 100644 --- a/setup.c +++ b/setup.c @@ -464,6 +464,9 @@ void cNopacitySetupChannelDisplay::Set(void) { //-----ReplayDisplay------------------------------------------------------------------------------------------------------------- cNopacitySetupReplayDisplay::cNopacitySetupReplayDisplay(cNopacityConfig* data) : cMenuSetupSubMenu(tr("Replay"), data) { + displayVolume[0] = tr("no"); + displayVolume[1] = tr("simple"); + displayVolume[2] = tr("full"); Set(); } @@ -476,9 +479,10 @@ void cNopacitySetupReplayDisplay::Set(void) { Add(new cMenuEditIntItem(tr("Height of Replay Display (Percent of OSD Height)"), tmpConf->GetValueRef("replayHeight"), 15, 80)); Add(new cMenuEditIntItem(tr("Left & Right Border Width"), tmpConf->GetValueRef("replayBorderVertical"), 0, 300)); Add(new cMenuEditIntItem(tr("Bottom Border Height"), tmpConf->GetValueRef("replayBorderBottom"), 0, 300)); - Add(new cMenuEditBoolItem(tr("Display Volume"), tmpConf->GetValueRef("displayReplayVolume"))); - if (tmpConf->GetValue("displayReplayVolume")) + Add(new cMenuEditStraItem(tr("Display Volume"), tmpConf->GetValueRef("displayReplayVolume"), 3, displayVolume)); + if (tmpConf->GetValue("displayReplayVolume") == vbFull) { Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Bottom Volume Border Height")), tmpConf->GetValueRef("replayBorderVolumeBottom"), 0, 1000)); + } Add(new cMenuEditIntItem(tr("Adjust Font Size - Header"), tmpConf->GetValueRef("fontReplayHeader"), -20, 20)); Add(new cMenuEditIntItem(tr("Adjust Font Size - Text"), tmpConf->GetValueRef("fontReplay"), -20, 20)); diff --git a/setup.h b/setup.h index 27bc291..d05c5f0 100644 --- a/setup.h +++ b/setup.h @@ -107,6 +107,7 @@ class cNopacitySetupChannelDisplay : public cMenuSetupSubMenu { class cNopacitySetupReplayDisplay : public cMenuSetupSubMenu { protected: + const char *displayVolume[3]; void Set(void); public: cNopacitySetupReplayDisplay(cNopacityConfig *data); -- cgit v1.2.3