chiark / gitweb /
Network play support for scripts/setup.
authorRichard Kettlewell <rjk@greenend.org.uk>
Tue, 22 Apr 2008 19:51:19 +0000 (20:51 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Tue, 22 Apr 2008 19:51:19 +0000 (20:51 +0100)
CHANGES
README.streams
scripts/setup.in

diff --git a/CHANGES b/CHANGES
index fa3a14419afe0e8a19be842765413e751ff21493..b4c0a22ef5083ef3db637e1a226674dad61ec99a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -26,7 +26,8 @@ remote_userman to 'yes'.
 
 ** Miscellaneous
 
 
 ** Miscellaneous
 
-scripts/setup now honors command line options.
+scripts/setup now honors command line options, and can set up network
+play as well as the local default sound device.
 
 * Changes up to version 3.0.2
 
 
 * Changes up to version 3.0.2
 
index 8fbe6c7ce566ec5cfaaea906d61d8df0151d815b..24756d079413a8d9247dd28e7e7b316c6dcb0a53 100644 (file)
@@ -5,7 +5,7 @@ get called 'streams'.
 
 * RTP Streaming
 
 
 * RTP Streaming
 
-DisOrder is capable to transmitting RTP streams over a suitable network.
+DisOrder is capable of transmitting RTP streams over a suitable network.
 
 ** Server Setup
 
 
 ** Server Setup
 
@@ -32,6 +32,8 @@ instance:
 (The destination can also be a unicast address but that's not a tested
 configuration.)
 
 (The destination can also be a unicast address but that's not a tested
 configuration.)
 
+scripts/setup now knows how to do basic setup for network play.
+
 ** Playing The Stream
 
 To play, use the disorder-playrtp client.  If the destination address was a
 ** Playing The Stream
 
 To play, use the disorder-playrtp client.  If the destination address was a
index e89ddb4f78e641dbd4795c20822083e4f318d4ae..3bc0b45ae8d3b56b79b885abee76ba58ab499c12 100755 (executable)
@@ -27,6 +27,7 @@ while [ $# -gt 0 ]; do
   case "$opt" in
   -h | --help )
     cat  <<EOF
   case "$opt" in
   -h | --help )
     cat  <<EOF
+
 Usage:
   scripts/setup [OPTIONS]
 
 Usage:
   scripts/setup [OPTIONS]
 
@@ -37,10 +38,20 @@ Options:
   --smtp-server HOSTNAME  SMTP server
   --email ADDRESS         Origin email address
   --register y|n          Enable/disable online registration
   --smtp-server HOSTNAME  SMTP server
   --email ADDRESS         Origin email address
   --register y|n          Enable/disable online registration
+  --play local|network    Choose local or network play
+  --mcast ADDRESS PORT    Set multicast address and port for --play network
   -h, --help              Display this message
   -h, --help              Display this message
+
+Sets up a basic DisOrder installation.  You must have run 'make install'
+first.  Use scripts/teardown to stop the server and deconfigure.
+
 EOF
     exit 0
     ;;
 EOF
     exit 0
     ;;
+  --version | -V )
+    echo "DisOrder scripts/setup _version_"
+    exit 0
+    ;;
   --root )
     roots="$roots $1"
     shift
   --root )
     roots="$roots $1"
     shift
@@ -65,6 +76,17 @@ EOF
     register="$1"
     shift
     ;;
     register="$1"
     shift
     ;;
+  --play )
+    play="$1"
+    shift
+    ;;
+  --mcast )
+    play=network
+    mcast_address="$1"
+    shift
+    mcast_port="$1"
+    shift
+    ;;
   * )
     echo >&2 "ERROR: unknown option '$opt'"
     exit 1
   * )
     echo >&2 "ERROR: unknown option '$opt'"
     exit 1
@@ -169,6 +191,52 @@ if [ -z "$port" ]; then
   done
 fi
 
   done
 fi
 
+if [ -z "$play" ]; then
+  while :; do
+    echo
+    echo "How do you want to play sound?  Enter 'local' to use a local sound"
+    echo "device or 'network' to multicast sound across your network."
+    read -r play
+    case $play in
+    'local' | network )
+      break
+      ;;
+    * )
+      echo "Enter 'local' or 'network'"
+      continue
+      ;;
+    esac
+  done
+fi
+
+if [ "x$play" = xnetwork ]; then
+  if [ -z "$mcast_address" ]; then
+    echo
+    echo "Enter destination address for network transmission"
+    echo "(e.g. a multicast address)"
+    read -r mcast_address
+  fi
+  if [ -z "$mcast_port" ]; then
+    while :; do
+      echo
+      echo "Enter destination port for network transmission"
+      read -r mcast_port
+      case $mcast_port in
+      none )
+       break
+       ;;
+      [^0-9] )
+       echo "'$mcast_port' is not a valid port number"
+       continue
+       ;;
+      * )
+       break
+       ;;
+      esac
+    done
+  fi
+fi
+
 if [ -z "$smtp_server" ]; then
   echo
   echo "What host should DisOrder use as an SMTP server?"
 if [ -z "$smtp_server" ]; then
   echo
   echo "What host should DisOrder use as an SMTP server?"
@@ -215,6 +283,9 @@ fi
 echo " SMTP Server:           $smtp_server"
 echo " Sender address:        $mail_sender"
 echo " Online registration:   $register"
 echo " SMTP Server:           $smtp_server"
 echo " Sender address:        $mail_sender"
 echo " Online registration:   $register"
+if [ $play = network ]; then
+  echo " Send sound to:         $mcast_address port $mcast_port"
+fi
 
 echo "Is this OK?  (Enter 'y' or 'n')"
 read -r ok
 
 echo "Is this OK?  (Enter 'y' or 'n')"
 read -r ok
@@ -241,6 +312,9 @@ echo "user $user" >> pkgconfdir/config.new
 if [ $port != none ]; then
   echo "listen 0.0.0.0 $port" >> pkgconfdir/config.new
 fi
 if [ $port != none ]; then
   echo "listen 0.0.0.0 $port" >> pkgconfdir/config.new
 fi
+if [ $play = network ]; then
+  echo "broadcast $mcast_address $mcast_port" >> pkgconfdir/config.new
+fi
 echo "smtp_server $smtp_server" >> pkgconfdir/config.new
 echo "mail_sender $mail_sender" >> pkgconfdir/config.new
 
 echo "smtp_server $smtp_server" >> pkgconfdir/config.new
 echo "mail_sender $mail_sender" >> pkgconfdir/config.new