From 29d0b301814f679519b0c84bc73236a6de42078e Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 2 May 2021 13:17:03 +0200 Subject: [PATCH] . --- .idea/workspace.xml | 40 +++++++++++++++++++++++-------- config/balcon.php | 1 + config/bureau.php | 3 ++- config/chambre.php | 1 + config/cour.php | 1 + config/cuisine.php | 1 + config/entree.php | 1 + config/lit.php | 1 + config/litjerome.php | 1 + config/litvincent.php | 1 + config/music.php | 4 ++-- config/salon.php | 1 + config/sdb.php | 1 + config/wc.php | 1 + js/cordova.js | 7 ++++++ js/home.js | 10 ++++++++ scripts/domoticz_device_event.php | 8 +++---- scripts/lib/mediarasp.php | 4 ++-- scripts/volume.php | 16 +++++++++---- 19 files changed, 79 insertions(+), 24 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 2630907..b0a5a32 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,24 @@ - + + + + + + + + + + + + + + + + + + diff --git a/config/balcon.php b/config/balcon.php index 2f0f066..408fac6 100644 --- a/config/balcon.php +++ b/config/balcon.php @@ -4,6 +4,7 @@ config('ROOM', 'balcon'); config('SQUEEZEBOX_PLAYER', 'Salon'); config('VOLUME', 60); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); +config('VOLUME_STEP',5); config('HIDEMASK_TIMEOUT', 250); if (DISPLAYINTERFACE) { diff --git a/config/bureau.php b/config/bureau.php index fee1e10..6bf3440 100644 --- a/config/bureau.php +++ b/config/bureau.php @@ -4,6 +4,7 @@ config('ROOM', 'bureau'); config('SQUEEZEBOX_PLAYER', 'Bureau'); config('VIDEOPLAYER', 'mediarasp'); config('VOLUME_DEVICE', 'harmony'); +config('VOLUME_STEP', 2); config('SLEEPTYPE', 'screensaver'); config('SCREENSAVER', 'suncurve'); config('SLEEPSCREEN', 15); @@ -28,5 +29,5 @@ if (DISPLAYINTERFACE) { include "default.php"; include ROOT . "/config/media.php"; - $nav = ['home', 'lights', 'music', 'media', 'remote', 'switch','fan', 'settings', 'alert', 'off']; + $nav = ['home', 'lights', 'music', 'media', 'remote', 'switch', 'fan', 'settings', 'alert', 'off']; } diff --git a/config/chambre.php b/config/chambre.php index 6fa6207..3e1ddf0 100644 --- a/config/chambre.php +++ b/config/chambre.php @@ -7,6 +7,7 @@ config('SCREENSAVER_BRIGHTNESS', 100); config('SLEEPTYPE', 'screensaver'); config('SCREENSAVER', 'weatherstation'); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); +config('VOLUME_STEP',5); config('HIDEMASK_TIMEOUT', 250); config('THEME', '#5c4736'); diff --git a/config/cour.php b/config/cour.php index 5b41d28..a7d18d1 100644 --- a/config/cour.php +++ b/config/cour.php @@ -3,6 +3,7 @@ config('ROOM_NAME', 'Cour'); config('ROOM', 'cour'); config('SQUEEZEBOX_PLAYER', 'Cuisine'); config('VOLUME', 60); +config('VOLUME_STEP',5); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); config('HIDEMASK_TIMEOUT', 250); config('THEME','#2e623b'); diff --git a/config/cuisine.php b/config/cuisine.php index 33986aa..101b699 100644 --- a/config/cuisine.php +++ b/config/cuisine.php @@ -4,6 +4,7 @@ config('ROOM', 'cuisine'); config('SQUEEZEBOX_PLAYER', 'Cuisine'); config('HIDEMASK_TIMEOUT', 250); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); +config('VOLUME_STEP',5); config('THEME','#222222'); config('SLEEPSCREEN', 15); config('SCREENSAVER_BRIGHTNESS', 100); diff --git a/config/entree.php b/config/entree.php index 1993c04..ea40852 100644 --- a/config/entree.php +++ b/config/entree.php @@ -7,6 +7,7 @@ config('SCREENSAVER_BRIGHTNESS', 100); config('SLEEPTYPE', 'screensaver'); config('SCREENSAVER','weatherstation'); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); +config('VOLUME_STEP',5); config('HIDEMASK_TIMEOUT',250); config('THEME','#000000'); diff --git a/config/lit.php b/config/lit.php index 1dfc729..7ddb39b 100644 --- a/config/lit.php +++ b/config/lit.php @@ -4,6 +4,7 @@ config('ROOM', 'chambre'); config('VIDEOPLAYER', 'mediarasp-small'); config('TVPLAYER', 'mediarasp-small'); config('HIDEMASK_TIMEOUT', 250); +config('VOLUME_STEP',5); if (DISPLAYINTERFACE) { if (!isset($shortcuts)) { diff --git a/config/litjerome.php b/config/litjerome.php index 35487c5..b067cff 100644 --- a/config/litjerome.php +++ b/config/litjerome.php @@ -7,6 +7,7 @@ config('SCREENSAVER_BRIGHTNESS', 'auto'); config('SLEEPTYPE', 'screensaver'); config('SCREENSAVER', 'weatherstation'); config('VOLUME_DEVICE', 'RaspberryPi'); +config('VOLUME_STEP',5); config('HIDEMASK_TIMEOUT', 250); config('THEME','#086d89'); diff --git a/config/litvincent.php b/config/litvincent.php index f8d22fe..0c4c3b3 100644 --- a/config/litvincent.php +++ b/config/litvincent.php @@ -3,6 +3,7 @@ config('ROOM_NAME', 'Lit Vincent'); config('SQUEEZEBOX_PLAYER', 'Lit Vincent'); config('SQUEEZEBOX_AMBIANCE_PLAYER', 'Chambre'); config('VOLUME_DEVICE', 'RaspberryPi'); +config('VOLUME_STEP',5); config('SCREENSAVER_BRIGHTNESS', 'auto'); config('SLEEPTYPE', 'screensaver'); config('SCREENSAVER', 'weatherstation'); diff --git a/config/music.php b/config/music.php index 31fca75..52d40f7 100644 --- a/config/music.php +++ b/config/music.php @@ -108,8 +108,8 @@ function audioElement($subitem, $app = 'favorites') $shortcuts['music'] = [ - ['type' => 'volume', 'volume' => '3%', 'increase' => '+', 'label' => ''], - ['type' => 'volume', 'volume' => '3%', 'increase' => '-', 'label' => ''], + ['type' => 'volume', 'volume' => config('VOLUME_STEP'), 'increase' => '+', 'label' => ''], + ['type' => 'volume', 'volume' => config('VOLUME_STEP'), 'increase' => '-', 'label' => ''], ['type' => 'sub', 'label' => 'Synchro', 'sub' => 'synchro'], ['type' => 'sub', 'label' => 'Radios', 'sub' => 'radio'], ['type' => 'sub', 'label' => 'Musique', 'sub' => 'playlists'], diff --git a/config/salon.php b/config/salon.php index 9d9483c..97a1816 100644 --- a/config/salon.php +++ b/config/salon.php @@ -5,6 +5,7 @@ config('SQUEEZEBOX_PLAYER', 'Salon'); config('VIDEOPLAYER', 'shield'); config('TVPLAYER', 'shield'); config('VOLUME_DEVICE', 'DenonAVR'); +config('VOLUME_STEP',2); config('VIDEOPLAYER_DEVICE', 'salon'); config('HIDEMASK_TIMEOUT', 250); config('THEME','#d0a25b'); diff --git a/config/sdb.php b/config/sdb.php index fc5aea9..5215fbb 100644 --- a/config/sdb.php +++ b/config/sdb.php @@ -10,6 +10,7 @@ config('VIDEOPLAYER', 'mediarasp-small'); config('TVPLAYER', 'mediarasp-small'); config('VOLUME', 60); config('VOLUME_DEVICE', 'Squeezebox'); +config('VOLUME_STEP',5); config('HIDEMASK_TIMEOUT',250); config('THEME','#92475c'); diff --git a/config/wc.php b/config/wc.php index 7f21df8..58bc543 100644 --- a/config/wc.php +++ b/config/wc.php @@ -3,6 +3,7 @@ config('ROOM_NAME', 'WC'); config('ROOM', 'wc'); config('SQUEEZEBOX_PLAYER', 'WC'); config('VOLUME', 60); +config('VOLUME_STEP',5); config('VOLUME_DEVICE', 'SqueezeboxPlayer'); config('HIDEMASK_TIMEOUT',250); diff --git a/js/cordova.js b/js/cordova.js index ed5fc02..a24a0bb 100644 --- a/js/cordova.js +++ b/js/cordova.js @@ -51,4 +51,11 @@ function initCordova() { } catch (e) { console.log(e); } + + try { + document.addEventListener('volumedownbutton', volumeDown, false); + document.addEventListener('volumedownbutton', volumeUp, false); + } catch (e) { + + } } \ No newline at end of file diff --git a/js/home.js b/js/home.js index 467046c..7ac2a8f 100644 --- a/js/home.js +++ b/js/home.js @@ -413,6 +413,16 @@ $(function () { }, 1000); }); +function volumeDown(){ + + return false; +} + +function volumeUp(){ + + return false; +} + function remoteCmd(cmd) { $.get('scripts/remotecmd.php?cmd=' + cmd); diff --git a/scripts/domoticz_device_event.php b/scripts/domoticz_device_event.php index 3501903..93ce7fb 100644 --- a/scripts/domoticz_device_event.php +++ b/scripts/domoticz_device_event.php @@ -36,10 +36,10 @@ if ($_GET['device'] == 480) { _remoteCmd('pause', 'salon'); break; case 'Clock_Wise': - volume(2, '+'); + volume(config('VOLUME_STEP'), '+'); break; case 'Anti_Clock_Wise': - volume(2, '-'); + volume(config('VOLUME_STEP'), '-'); break; case 'Tap': squeezePlayByName('FIP', $squeezeboxPlayers['Salon']); @@ -90,10 +90,10 @@ if ($_GET['device'] == 480) { } break; case 'Clock_Wise': - volume(2, '+'); + volume(config('VOLUME_STEP'), '+'); break; case 'Anti_Clock_Wise': - volume(2, '-'); + volume(config('VOLUME_STEP'), '-'); break; case 'Tap': squeezeResume(); diff --git a/scripts/lib/mediarasp.php b/scripts/lib/mediarasp.php index aafdbe7..2b42cd6 100644 --- a/scripts/lib/mediarasp.php +++ b/scripts/lib/mediarasp.php @@ -24,10 +24,10 @@ function remoteCmd($cmd, $device) } if ($cmd == 'volume-up') { - volume(5, '+'); + volume(config('VOLUME_STEP'), '+'); return true; } elseif ($cmd == 'volume-down') { - volume(5, '-'); + volume(config('VOLUME_STEP'), '-'); return true; } diff --git a/scripts/volume.php b/scripts/volume.php index 4153359..97cad8c 100644 --- a/scripts/volume.php +++ b/scripts/volume.php @@ -1,9 +1,15 @@