From: Vincent Date: Mon, 2 Nov 2020 08:51:56 +0000 (+0100) Subject: . X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=d61f9b494956cecd6d659e44c862bdd40fef1a19;p=tortuga-home.git . --- diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 37ab502..f5d705b 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,14 +3,9 @@ - - - - - - - + + @@ -1287,10 +1282,10 @@ - + - + diff --git a/config/remote.php b/config/remote.php index a2e0adb..173414a 100644 --- a/config/remote.php +++ b/config/remote.php @@ -37,12 +37,12 @@ $bricksShield = ['type' => 'shield', 'width' => 4, 'height' => 4, 'bricks' => [ ['type' => 'remote-shield-ok', 'width' => 1, 'height' => 1, 'top' => 2, 'left' => 2], ]]; -$bricksShieldMedia = ['type' => 'shieldMedia', 'width' => 5, 'height' => 4, 'bricks' => [ +$bricksShieldMedia = ['type' => 'shieldmedia', 'width' => 5, 'height' => 4, 'bricks' => [ ['type' => 'remote-volume', 'width' => 1, 'height' => 3, 'top' => 1, 'left' => 0], ['type' => 'remote-rew', 'width' => 1, 'height' => 1, 'top' => 0, 'left' => 0], - ['type' => 'remote-playpause', 'width' => 2, 'height' => 1, 'top' => 0, 'left' => 1], + ['type' => 'remote-playpause', 'width' => 3, 'height' => 1, 'top' => 0, 'left' => 1], ['type' => 'remote-light-down', 'width' => 1, 'height' => 1, 'top' => 1, 'left' => 3], - ['type' => 'remote-fwd', 'width' => 1, 'height' => 1, 'top' => 0, 'left' => 3], + ['type' => 'remote-fwd', 'width' => 1, 'height' => 1, 'top' => 0, 'left' => 4], ['type' => 'remote-up', 'width' => 1, 'height' => 1, 'top' => 1, 'left' => 2], ['type' => 'remote-left', 'width' => 1, 'height' => 1, 'top' => 2, 'left' => 1], ['type' => 'remote-down', 'width' => 1, 'height' => 1, 'top' => 3, 'left' => 2], @@ -51,6 +51,7 @@ $bricksShieldMedia = ['type' => 'shieldMedia', 'width' => 5, 'height' => 4, 'bri ['type' => 'remote-shield-menu', 'width' => 1, 'height' => 1, 'top' => 1 + 2, 'left' => 1], ['type' => 'remote-shield-home', 'width' => 1, 'height' => 1, 'top' => 1 + 2, 'left' => 1 + 2], ['type' => 'remote-shield-ok', 'width' => 1, 'height' => 1, 'top' => 2, 'left' => 2], + ['type' => 'remote-subtitles', 'width' => 1, 'height' => 3, 'top' => 1, 'left' => 4], ]]; @@ -108,4 +109,5 @@ $shortcuts['remote-raspberrycast'] = [['type' => 'bricks', 'bricks' => $bricksRa $shortcuts['remote-mediarasp'] = [['type' => 'bricks', 'bricks' => $bricksMediarasp]]; $shortcuts['remote-freebox'] = [['type' => 'bricks', 'bricks' => $bricksFreebox]]; $shortcuts['remote-omxtv'] = [['type' => 'bricks', 'bricks' => $bricksOMXRaspTV]]; -$shortcuts['remote-shield'] = [['type' => 'bricks', 'bricks' => $bricksShield]]; \ No newline at end of file +$shortcuts['remote-shield'] = [['type' => 'bricks', 'bricks' => $bricksShield]]; +$shortcuts['remote-shieldmedia'] = [['type' => 'bricks', 'bricks' => $bricksShieldMedia]]; \ No newline at end of file diff --git a/scripts/lib/lib.php b/scripts/lib/lib.php index aa6b2d6..1f3477d 100644 --- a/scripts/lib/lib.php +++ b/scripts/lib/lib.php @@ -427,22 +427,29 @@ function volume($volume, $increase = '') $device = $e[1]; $d = $e[0]; } + $d = mb_strtolower($d); switch ($d) { - case 'Raspberry': - case 'RaspberryPi': + case 'shield': + if ($increase == '-') { + shieldKey('volume-down'); + } else { + shieldKey('volume-up'); + } + case 'raspberry': + case 'raspberrypi': $cmd = 'amixer -c 0 -M -- sset PCM playback ' . round(max(0, min(100, $volume))) . '%' . $increase; return sshCommand($cmd, $device); - case 'SqueezeboxPlayer': - case 'Squeezebox': + case 'squeezeboplayer': + case 'squeezebox': return squeezeVolume($volume, $increase, config('SQUEEZEBOX_PLAYER')); - case 'Harmony': + case 'harmony': if ($increase == '-') { return harmonyRequest('commands/volume-down', 'POST'); } else { return harmonyRequest('commands/volume-up', 'POST'); } - case 'VLC': + case 'vlc': return VLCCmd(['command' => 'volume', 'val' => $increase . '20'], $device); } } diff --git a/scripts/lib/remoteinfos.php b/scripts/lib/remoteinfos.php index 195ae14..829c73a 100644 --- a/scripts/lib/remoteinfos.php +++ b/scripts/lib/remoteinfos.php @@ -12,7 +12,7 @@ function remoteInfos() }else { if ($p == 'mediarasp') { if(config('VIDEOPLAYER')==='shield'){ - $res = ['type' => 'shield', 'can_seek' => false]; + $res = ['type' => 'shieldmedia', 'can_seek' => false]; }else { $res = mediaraspRemoteInfos(); } diff --git a/scripts/lib/shield.php b/scripts/lib/shield.php index 49bc2c5..fe423af 100644 --- a/scripts/lib/shield.php +++ b/scripts/lib/shield.php @@ -55,6 +55,13 @@ function shieldKey($keys, $device = true) 'volume-up' => 'KEYCODE_VOLUME_UP', 'volume-down' => 'KEYCODE_VOLUME_DOWN', 'volume-mute' => 'KEYCODE_VOLUME_MUTE', + 'subtitles-toggle' => 'KEYCODE_T', + 'subtitles-stream-next' => 'KEYCODE_Y', + 'subtitles-increase-delay' => 'KEYCODE_U', + //'subtitles-increase-delay-long' => 'subtitles-increase-delay-long', + 'subtitles-decrease-delay' => 'KEYCODE_I', + //'subtitles-decrease-delay-long' => 'subtitles-decrease-delay-long', + 'audio-track-next' => 'KEYCODE_A', ]; if (!is_array($keys)) { $keys = [$keys]; @@ -89,6 +96,9 @@ function shieldNetflix($id = null, $device = null) if ($id === 'home') { sleep(6); shieldKey(['ok', 'down']); + } else { + sleep(1); + shieldKey(['ok']); } }