From f84d38501b35659ffed0a4150bfd6e7a49681d3b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 25 Mar 2026 11:27:07 +0100 Subject: [PATCH] . --- .idea/workspace.xml | 15 ++++-------- config/music.php | 11 --------- scripts/lib/scenes.php | 18 -------------- scripts/lib/squeezebox.php | 49 -------------------------------------- 4 files changed, 4 insertions(+), 89 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 414ff14..6df3d85 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,17 +5,10 @@ - - - - - - - + - - + diff --git a/config/music.php b/config/music.php index 52d40f7..27c1de2 100644 --- a/config/music.php +++ b/config/music.php @@ -110,22 +110,11 @@ function audioElement($subitem, $app = 'favorites') $shortcuts['music'] = [ ['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'], ['type' => 'sub', 'label' => 'Ambiance', 'sub' => 'ambiance'], ]; -$shortcuts['sub-synchro'] = [ - ['type' => 'back', 'label' => 'Synchro'], - ['type' => 'light', 'scene' => 'home/music/synchro/soiree', 'label' => 'Soirée'], - ['type' => 'light', 'scene' => 'home/music/synchro/salon-cuisine', 'label' => 'Salon Cuisine'], - ['type' => 'light', 'scene' => 'home/music/synchro/chambre-sdb', 'label' => 'Chambre SDB'], - ['type' => 'light', 'scene' => 'home/music/synchro/all', 'label' => 'Tout'], - ['type' => 'light', 'scene' => 'home/music/synchro/bureau-wc', 'label' => 'Bureau WC'], - ['type' => 'light', 'scene' => 'home/music/synchro/off', 'label' => 'Off'], -]; - if ($podcasts !== false) { $shortcuts['music'][] = ['type' => 'sub', 'label' => 'Podcasts', 'sub' => 'podcasts']; } \ No newline at end of file diff --git a/scripts/lib/scenes.php b/scripts/lib/scenes.php index 2042546..3d26a45 100644 --- a/scripts/lib/scenes.php +++ b/scripts/lib/scenes.php @@ -290,24 +290,6 @@ $scenes = [ ['type' => 'ecomode', 'mode' => '1'], ['type' => 'scene', 'scene' => 'sdb/hotwater/auto'], ], - 'home/music/synchro/soiree' => [ - ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine', 'Bureau', 'WC']]], - ], - 'home/music/synchro/salon-cuisine' => [ - ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine']]], - ], - 'home/music/synchro/all' => [ - ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Salon', 'Cuisine', 'Bureau', 'WC', 'Chambre', 'SDB']]], - ], - 'home/music/synchro/chambre-sdb' => [ - ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Chambre', 'SDB']]], - ], - 'home/music/synchro/bureau-wc' => [ - ['type' => 'function', 'function' => 'syncMusic', 'args' => [['Bureau', 'WC']]], - ], - 'home/music/synchro/off' => [ - ['type' => 'function', 'function' => 'stopAllSqueezebox'], - ], 'salon/projector/on' => [ ['type' => 'function', 'function' => 'epson', 'args' => [true, true]], ], diff --git a/scripts/lib/squeezebox.php b/scripts/lib/squeezebox.php index 21c782e..f2e6464 100644 --- a/scripts/lib/squeezebox.php +++ b/scripts/lib/squeezebox.php @@ -267,56 +267,7 @@ function isMacAddress($mac) return (preg_match('/([a-fA-F0-9]{2}[:|\-]?){6}/', $mac) == 1); } -function synchroSoiree() -{ - syncMusic(['Salon', 'WC', 'Chambre', 'Bureau', 'Cuisine']); -} - - -function syncMusic($players) -{ - global $squeezeboxPlayers; - $first = true; - - foreach ($players as $player) { - $player = _player($player); - if ($player === $squeezeboxPlayers['WC']) { - - } - squeezePlayerOn($player); - if ($first) { - $firstPlayer = $player; - $first = false; - continue; - } - squeezeRequest('sync ' . $player, $firstPlayer); - squeezeRequest('power 1', $player); - squeezeAddSynced($player); - } - squeezeRequest('play', $firstPlayer); -} -function squeezeAddSynced($player) -{ - $player = _player($player); - $synced = getState('squeezesynced', []); - if (!in_array($player, $synced)) { - $synced[] = $player; - } - setState('squeezesynced', $synced); -} - -function squeezeEmptySynced() -{ - setState('squeezesynced', []); -} - -function isSynced($player) -{ - $player = _player($player); - $synced = getState('squeezesynced', []); - return in_array($player, $synced); -} function getSqueezeFavorites($root = 0, $app = 'favorites', $level = 0) { -- 2.39.5