]> _ Git - tortuga-home.git/commitdiff
.
authorVincent <vincent@enhydra.fr>
Sun, 25 Apr 2021 10:58:00 +0000 (12:58 +0200)
committerVincent <vincent@enhydra.fr>
Sun, 25 Apr 2021 10:58:00 +0000 (12:58 +0200)
.idea/workspace.xml
config/music.php
images/rooms/medium/salon.jpg
images/rooms/originaux/salon.jpg
images/rooms/small/salon.jpg
scripts/lib/scenes.php
scripts/lib/squeezebox.php
style/style.css
style/style.less

index 89359c969da13eae3ae2efa768ee90022a5bc9d2..26b3fbb5839e6179d6a6234dfaa2c3b6346184b3 100644 (file)
@@ -3,10 +3,14 @@
   <component name="ChangeListManager">
     <list default="true" id="352ce63a-b52a-41a2-979b-becda7920939" name="Default" comment=".">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/config/salon.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/salon.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/js/home.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/home.js" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/cron/cron.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/cron/cron.php" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/scripts/lib/router.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/router.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/config/music.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/music.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/images/rooms/medium/salon.jpg" beforeDir="false" afterPath="$PROJECT_DIR$/images/rooms/medium/salon.jpg" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/images/rooms/originaux/salon.jpg" beforeDir="false" afterPath="$PROJECT_DIR$/images/rooms/originaux/salon.jpg" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/images/rooms/small/salon.jpg" beforeDir="false" afterPath="$PROJECT_DIR$/images/rooms/small/salon.jpg" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/scenes.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/scenes.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/scripts/lib/squeezebox.php" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/lib/squeezebox.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/style/style.css" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.css" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/style/style.less" beforeDir="false" afterPath="$PROJECT_DIR$/style/style.less" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
         <option name="Make" enabled="true" />
       </method>
     </configuration>
+    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
+      <option name="arquillianRunConfiguration">
+        <value>
+          <option name="containerStateName" value="" />
+        </value>
+      </option>
+      <option name="TEST_OBJECT" value="class" />
+      <method v="2">
+        <option name="Make" enabled="true" />
+      </method>
+    </configuration>
     <configuration default="true" type="ArquillianTestNG" factoryName="">
       <option name="arquillianRunConfiguration">
         <value>
       <workItem from="1618740509693" duration="14198000" />
       <workItem from="1618947923152" duration="2016000" />
       <workItem from="1619079821781" duration="1188000" />
-      <workItem from="1619120393111" duration="2277000" />
-    </task>
-    <task id="LOCAL-00423" summary=".">
-      <created>1608196291044</created>
-      <option name="number" value="00423" />
-      <option name="presentableId" value="LOCAL-00423" />
-      <option name="project" value="LOCAL" />
-      <updated>1608196291044</updated>
+      <workItem from="1619120393111" duration="2877000" />
+      <workItem from="1619342303709" duration="4190000" />
     </task>
     <task id="LOCAL-00424" summary=".">
       <created>1608294905553</created>
       <option name="project" value="LOCAL" />
       <updated>1618989464530</updated>
     </task>
-    <option name="localTasksCounter" value="472" />
+    <task id="LOCAL-00472" summary=".">
+      <created>1619248801662</created>
+      <option name="number" value="00472" />
+      <option name="presentableId" value="LOCAL-00472" />
+      <option name="project" value="LOCAL" />
+      <updated>1619248801663</updated>
+    </task>
+    <option name="localTasksCounter" value="473" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
index aee8a22aa5f3b5b0fa2df48fc727fae9ad918fca..31fca75d60c3380315b7a95fbec31276dd962510 100644 (file)
@@ -110,12 +110,22 @@ function audioElement($subitem, $app = 'favorites')
 $shortcuts['music'] = [
     ['type' => 'volume', 'volume' => '3%', 'increase' => '+', 'label' => '<i class="fa fa-volume-up"></i>'],
     ['type' => 'volume', 'volume' => '3%', 'increase' => '-', 'label' => '<i class="fa fa-volume-down"></i>'],
-    ['type' => 'light', 'scene' => 'home/music/synchro/soiree', 'label' => 'Synchro Soirée'],
+    ['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
index 5d92fc5817a3babab7b84fc5ca1bc10e761bfa0f..58ec7bc5bfd507fa20cae73d8fb64d3128d205bf 100644 (file)
Binary files a/images/rooms/medium/salon.jpg and b/images/rooms/medium/salon.jpg differ
index 5d92fc5817a3babab7b84fc5ca1bc10e761bfa0f..58ec7bc5bfd507fa20cae73d8fb64d3128d205bf 100644 (file)
Binary files a/images/rooms/originaux/salon.jpg and b/images/rooms/originaux/salon.jpg differ
index 5d92fc5817a3babab7b84fc5ca1bc10e761bfa0f..58ec7bc5bfd507fa20cae73d8fb64d3128d205bf 100644 (file)
Binary files a/images/rooms/small/salon.jpg and b/images/rooms/small/salon.jpg differ
index 8591f0d8d349eecd7983a2b42107ad2dfff57fce..3e0f9c324f802a785e958c72f7cc7ca04046ac56 100644 (file)
@@ -332,7 +332,22 @@ $scenes = [
         ['type' => 'ecomode', 'mode' => '1'],
     ],
     'home/music/synchro/soiree' => [
-        ['type' => 'function', 'function' => 'synchroSoiree'],
+        ['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]],
@@ -650,12 +665,6 @@ $scenes = [
     'home/hueoff' => [
         ['type' => 'hue', 'group' => 17, 'scene' => ['on' => false, 'brightness' => 0, 'effect' => 'none']],
     ],
-    'sdb/radio/sync/salon' => [
-        //['type' => 'function', 'function' => 'harmonyActivity', 'args' => ["musique"]],
-        ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['sync ' . $squeezeboxPlayers['Salon'], $squeezeboxPlayers['Salle de bains']], 'wait' => 1],
-        ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['power 1', $squeezeboxPlayers['Salon']]],
-        ['type' => 'function', 'function' => 'squeezeRequest', 'args' => ['play', $squeezeboxPlayers['Salon']]]
-    ],
     'wc/on' => [
         ['type' => 'function', 'function' => 'wcOn'],
     ],
index 0c82fefb148ff3495adbfe3ab9a26f8e2fa80ba8..20b488baad826f6a1aa6de13878f1ff74f85a509 100644 (file)
@@ -4,7 +4,7 @@ require_once ROOT . '/config/music.php';
 
 function stopSqueezeboxPlayer($player, $stopIfSync = true, $devices = true)
 {
-    if (!$stopIfSync && getState('syncsoiree') == '1') {
+    if (!$stopIfSync && isSynced($player)) {
         return;
     }
 
@@ -47,7 +47,7 @@ function stopAllSqueezebox()
     foreach ($squeezeboxPlayers as $squeezeboxPlayer) {
         stopSqueezebox($squeezeboxPlayer);
     }
-    setState('syncsoiree', '0');
+    squeezeEmptySynced();
 }
 
 
@@ -123,7 +123,7 @@ function _squeezeRequest($params, $player = '')
 function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = true)
 {
 
-    if (!$playIfSync && getState('syncsoiree') == '1') {
+    if (!$playIfSync && isSynced($player)) {
         echo 'sync enabled';
         return;
     }
@@ -140,18 +140,12 @@ function squeezePlayByName($musicName, $player, $volume = null, $playIfSync = tr
     }
 }
 
-
-function _squeezePlay($player = '', $volume = null)
+function squeezePlayerOn($player)
 {
     global $squeezeboxPlayers;
     $player = _player($player);
-    if (null === $player) {
-        echo 'player null';
-        return;
-    }
-
     if ($player == $squeezeboxPlayers['Salon']) {
-       denonAVROn('AUX');
+        denonAVROn('AUX');
     } else if ($player == $squeezeboxPlayers['Salle de bains']) {
         execScene('sdb/ampli/on');
     } else if ($player == $squeezeboxPlayers['Bureau']) {
@@ -161,6 +155,17 @@ function _squeezePlay($player = '', $volume = null)
     } else if ($player == $squeezeboxPlayers['Chambre']) {
         denon(true);
     }
+}
+
+function _squeezePlay($player = '', $volume = null)
+{
+
+    if (null === $player) {
+        echo 'player null';
+        return;
+    }
+
+    squeezePlayerOn($player);
 
     if (null !== $volume) {
         if (config('VOLUME_DEVICE') == 'SqueezeboxPlayer') {
@@ -207,20 +212,54 @@ function isMacAddress($mac)
 
 function synchroSoiree()
 {
-    harmonyActivity('musique');
+    syncMusic(['Salon', 'WC', 'Chambre', 'Bureau', 'Cuisine']);
+}
 
-    $devices = ['WC', 'Chambre', 'Bureau', 'Cuisine'];
-    $salon = _player('Salon');
-    foreach ($devices as $device) {
-        $player = _player($device);
-        squeezeRequest('sync ' . $player, $salon);
+
+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', 'salon');
+    squeezeRequest('play', $firstPlayer);
+}
 
-    setState('syncsoiree', '1');
+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)
 {
index ed44023f97d92db9d9c132b35c81481b6da84cd8..07fc0d20f4f584725d62d5d3f6c15e57614bb96f 100644 (file)
@@ -61,7 +61,8 @@ body #splash {
   bottom: 4.41vh;
   font-size: 5.39vh;
 }
-#mainnav a {
+#mainnav a,
+#mainnav div {
   text-align: center;
   display: block;
   z-index: 100;
@@ -69,18 +70,6 @@ body #splash {
   text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
   margin: 0.2em 0;
 }
-#mainnav a .fa-tv {
-  -webkit-transform: scaleX(0.85);
-  transform: scaleX(0.85);
-  -webkit-transform-origin: 0 0;
-  transform-origin: 0 0;
-}
-#mainnav a .fa-coffee {
-  -webkit-transform: scaleX(0.85);
-  transform: scaleX(0.85);
-  -webkit-transform-origin: 0 0;
-  transform-origin: 0 0;
-}
 .fit {
   transform-origin: 0 0;
   -webkit-transform-origin: 0 0;
index cd74470f457306ef233ce3ec7007763601342f56..d5904620272988bb5200d7de263b751343f6c4df 100644 (file)
@@ -78,29 +78,13 @@ body {
 
 #mainnav {
 
-  a {
+  a, div {
     text-align: center;
     display: block;
     z-index: 100;
     color: #fff;
     text-shadow: 1px 1px rgba(0, 0, 0, 0.5);
     margin: 0.2em 0;
-
-    .fa-tv {
-      -webkit-transform: scaleX(0.85);
-      transform: scaleX(0.85);
-
-      -webkit-transform-origin: 0 0;
-      transform-origin: 0 0;
-    }
-
-    .fa-coffee {
-      -webkit-transform: scaleX(0.85);
-      transform: scaleX(0.85);
-
-      -webkit-transform-origin: 0 0;
-      transform-origin: 0 0;
-    }
   }
 }
 
@@ -146,7 +130,7 @@ main {
   z-index: 1;
 }
 
-[data-remote-command]{
+[data-remote-command] {
   cursor: pointer;
 }
 
@@ -194,7 +178,7 @@ section {
       color: #fff;
       background-color: rgba(0, 0, 0, 0.5);
       height: 12.4em;
-      cursor:pointer;
+      cursor: pointer;
     }
 
     &.closed {