forked from shawaj/ifi-tidal-release
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Playback Device Selection during and POST installation.
- Loading branch information
Showing
12 changed files
with
128 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
Docker/.env | ||
Docker/docker-compose.yml | ||
./CONFIG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Docker/.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/sh | ||
|
||
CONFIG_FILE=./CONFIG | ||
|
||
ARRAY_DEVICES=() | ||
DEVICES=$(docker exec -ti tidal_connect /app/ifi-tidal-release/bin/ifi-pa-devs-get 2>/dev/null | grep device#) | ||
|
||
echo "" | ||
echo "Found output devices..." | ||
echo "" | ||
#make newlines the only separator | ||
IFS=$'\n' | ||
re_parse="^device#([0-9])+=(.*)$" | ||
for line in $DEVICES | ||
do | ||
if [[ $line =~ $re_parse ]] | ||
then | ||
device_num="${BASH_REMATCH[1]}" | ||
device_name="${BASH_REMATCH[2]}" | ||
|
||
echo "${device_num}=${device_name}" | ||
ARRAY_DEVICES+=( ${device_name} ) | ||
fi | ||
done | ||
|
||
while :; do | ||
read -ep 'Choose your output Device (0-9): ' number | ||
[[ $number =~ ^[[:digit:]]+$ ]] || continue | ||
(( ( (number=(10#$number)) <= 9999 ) && number >= 0 )) || continue | ||
# Here I'm sure that number is a valid number in the range 0..9999 | ||
# So let's break the infinite loop! | ||
break | ||
done | ||
|
||
export PLAYBACK_DEVICE="${ARRAY_DEVICES[$number]}" | ||
echo "" | ||
echo "Playback device is set to: ${PLAYBACK_DEVICE}" | ||
|
||
CONFIG_FILE=./CONFIG | ||
if test -f "$CONFIG_FILE"; then | ||
sed -i -e "s/^PLAYBACK_DEVICE.*$/PLAYBACK_DEVICE\=${PLAYBACK_DEVICE}/g" Docker/.env | ||
echo "Updated config file..." | ||
echo "" | ||
echo "Please restart TIDAL Service for changes to take effect." | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo "Shows Audio Controller UI started within a running Tidal Container" | ||
docker exec -ti tidal_connect /usr/bin/tmux a -t speaker_controller_application |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
# Stop if already running | ||
if pgrep -f ^/app/ifi-tidal-release/bin/speaker_controller_application >/dev/null 2>&1 | ||
then | ||
./stop-audio-controller.sh | ||
fi | ||
|
||
|
||
echo "Starting Speaker Controller Application..." | ||
docker exec -ti tidal_connect /usr/bin/tmux new-session -d -s speaker_controller_application '/app/ifi-tidal-release/bin/speaker_controller_application' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
echo "Stopping Speaker Controller Application..." | ||
docker exec -ti tidal_connect /usr/bin/tmux kill-session -t speaker_controller_application | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
version: '2.2' | ||
services: | ||
tidal-connect: | ||
container_name: tidal_connect | ||
env_file: | ||
- .env | ||
image: ${DOCKER_IMAGE} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters