#!/bin/bash 

. startinscreen-functions.sh
mkdir tmp
export DISPLAY=:0

SNAME="transcode"

xset -dpms
screen -dmS sp$SNAME bash -c "sleep 20"
screen -S sp$SNAME -X screen screen -dR $SNAME
sleep 1 

screen -S $SNAME -X detach
screen -S $SNAME -X stuff htop

#does basedir do anything?
BASEDIR=/home/user/src/cpu

#if [ -z "$(pgrep jackd)" ]
#  then
#        killall pulseaudio
#    	  sins streaming none jackd ./ "jackd -d alsa -r 48000"
#  else
#    echo "jackd already running"
#fi
rm $SNAME.cmd.temp
rm $SNAME.pids.temp
rm bashrcfile.temp
mkdir /home/user/media/
mkdir /home/user/media/adm
sleep 3
#sins streaming 1 test1  snowmix/scripts/ "./skel2feed 1"
#sins streaming 1 test2  snowmix/scripts/ "./skel2feed 2"
#sins streaming 1 test3  snowmix/scripts/ "./skel2feed 3"
#sins streaming 1 test1  snowmix/scripts/ "./skel2feed 1"
sins $SNAME 1 icecast  snowmix/scripts/ "./jack_output2jpeg_hark transcode_ogg"
sins $SNAME 1 rtmp  snowmix/scripts/ "./jack_output2jpeg_hark transcode_rtmp"
sins $SNAME 1 rec  snowmix/scripts/ "./jack_output2jpeg_hark transcode_record"





#sins streaming 1 play  ./ "./play.sh"




#sleep 1

#screen -rS streaming -X screen -t output ./output2icecast

