From 7c6be7ff08ae07503d47da94ea8f51edb2ab9c8a Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 24 Jan 2020 10:40:06 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 36 +++++++++++++++++++++--------------- config/global.php | 2 +- scripts/lib/remoteinfos.php | 5 ++++- scripts/lib/scenes.php | 18 ------------------ scripts/lib/squeezebox.php | 4 ---- scripts/pcgames.php | 2 -- scripts/squeeze.php | 2 -- 7 files changed, 26 insertions(+), 43 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 4a4c0f4..ea91c5a 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -3,7 +3,12 @@ + + + + + @@ -1184,12 +1190,12 @@ - + - + @@ -1199,17 +1205,17 @@ - + - - + + - + diff --git a/config/global.php b/config/global.php index fef2bc2..5c7ec38 100644 --- a/config/global.php +++ b/config/global.php @@ -54,7 +54,7 @@ $directories = array('Séries TV' => array('dir' => 'Series', 'context' => 'tvsh 'X' => array('dir' => 'Z/X', 'context' => 'movie', 'id' => 'x') ); -$videoExt = ['mkv', 'mp4', 'avi', 'ogv', 'ts', 'm2ts', 'mpg', 'm4v', 'flv', 'f4v', 'mov', 'mpg', 'mpeg']; +$videoExt = ['mkv', 'mp4', 'avi', 'ogv', 'ts', 'm2ts', 'mpg', 'm4v', 'flv', 'f4v', 'mov', 'mpg', 'mpeg','divx']; profile('Set globals', __FILE__, __LINE__); diff --git a/scripts/lib/remoteinfos.php b/scripts/lib/remoteinfos.php index 827d071..70b67fb 100644 --- a/scripts/lib/remoteinfos.php +++ b/scripts/lib/remoteinfos.php @@ -47,10 +47,12 @@ function mediaraspRemoteInfos() $res['time'] = ''; $res['title'] = ''; $res['artwork'] = ''; + $res['status']=''; $d = getDevice(); $playlist = simplexml_load_string(VLCCmd(['query' => 'requests/playlist.xml'], $d)); - $status = simplexml_load_string(VLCCmd(['query' => 'requests/status.xml'], $d)); + $s = (string)VLCCmd(['query' => 'requests/status.xml'], $d); + $status = simplexml_load_string($s); $leaf = $playlist->xpath('//leaf[@current="current"]'); if (count($leaf) > 0) { @@ -62,6 +64,7 @@ function mediaraspRemoteInfos() $res['can_seek'] = true; $res['duration'] = intval((string)$status->xpath('//length')[0]); $res['time'] = intval((string)$status->xpath('//time')[0]); + $res['status'] = $s; $playing = getPlaying(); $e = explode(':', $playing, 3); diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 2c3207e..0eb5ec3 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -420,21 +420,12 @@ $scenes = [ ['type' => 'function', 'function' => 'sleepPC', 'args' => ['avion']], ], 'bureau/media/play' => [ - ['type' => 'function', 'function' => 'bureauMediaOn'], ['type' => 'scene', 'scene' => 'bureau/screen/down'], ['type' => 'scene', 'scene' => 'bureau/rideaux/close'], ['type' => 'scene', 'scene' => 'bureau/off'], ['type' => 'function', 'function' => 'bureauAuto', 'args' => [false]], ['type' => 'ir', 'room' => 'bureau', 'device' => 'Projector', 'command' => 'PowerOn'], ], - 'bureau/media/on' => [ - ['type' => 'insteon', 'command' => '0?1139=I=0=0'], - ['type' => 'domoticz', 'device' => '559', 'command' => true, 'priority' => true], - ], - 'bureau/media/off' => [ - ['type' => 'insteon', 'command' => '0?1339=I=0=0'], - ['type' => 'domoticz', 'device' => '559', 'command' => false, 'priority' => true], - ], 'bureau/screen/down' => [ ['type' => 'domoticz', 'device' => '1', 'command' => true, 'priority' => true], ], @@ -549,7 +540,6 @@ $scenes = [ ['type' => 'domoticz', 'device' => '478', 'command' => false, 'priority' => true], ], 'ecomode/basic' => [ - ['type' => 'scene', 'scene' => 'bureau/media/off'],// Media bureau ['type' => 'scene', 'scene' => 'salon/freebox/off'], ['type' => 'scene', 'scene' => 'sdb/ampli/off'], ['type' => 'scene', 'scene' => 'chambre/raspberry/off'], @@ -904,12 +894,4 @@ function _wcVMCOff($timeout) if (getState('wcTimeout') == $rand) { insteonCommand('0?1334=I=0=0'); } -} - -function bureauMediaOn() -{ - execScene('bureau/media/on'); - if (!isAlive('bureau')) { - sleep(60); - } } \ No newline at end of file diff --git a/scripts/lib/squeezebox.php b/scripts/lib/squeezebox.php index 1f06675..4b1932e 100644 --- a/scripts/lib/squeezebox.php +++ b/scripts/lib/squeezebox.php @@ -87,10 +87,6 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr if ($player == $squeezeboxPlayers['Salle de bains']) { execScene('sdb/ampli/on'); } - if ($player == $squeezeboxPlayers['Bureau']) { - bureauMediaOn(); - } - squeezeRequest('pause', $player); if (null !== $volume) { if (config('VOLUME_DEVICE') == 'SqueezeboxPlayer') { diff --git a/scripts/pcgames.php b/scripts/pcgames.php index 69cf55d..856df2c 100644 --- a/scripts/pcgames.php +++ b/scripts/pcgames.php @@ -3,8 +3,6 @@ require_once "import.php"; if (config('DEVICE') == 'salon') { harmonyActivity('media'); -} else if (config('DEVICE') == 'bureau') { - bureauMediaOn(); } sshCommand('killall fbi', null, false, true); diff --git a/scripts/squeeze.php b/scripts/squeeze.php index a8abfeb..897941e 100644 --- a/scripts/squeeze.php +++ b/scripts/squeeze.php @@ -11,8 +11,6 @@ if (!in_array('stop', $requests) || isset($_GET['name'])) { print_r(harmonyActivity("musique-radio")); } elseif ($_GET['player'] == 'Salle de bains') { execScene('sdb/ampli/on'); - } else if ($_GET['player'] == 'Bureau') { - bureauMediaOn(); } setPlaying('squeezebox'); } else { -- 2.39.5