Skip to content
This repository has been archived by the owner on Sep 27, 2020. It is now read-only.

Use the sound settings from the configuration file #667

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Bumped virtualgamepads version - virtualkeyboard now available
- Add usb encoder 3H-Dual-Arcade, Mayflash dreamcast adapter
- Add support for smb and upnp protocols in Kodi
- Use the sound settings from the configuration file for the splash screen at boot


## [4.0.0-beta5] - 2016-08-13hs the ratio issue in mame.
Expand Down
56 changes: 53 additions & 3 deletions board/recalbox/fsoverlay/etc/init.d/S02splash
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,24 @@ do_start ()
omx_fnt=""
omx_opt="--no-keys --layer=10000 --aspect-mode=fill"
omx_srt="--no-ghost-box --lines=1 --align=left $omx_fnt --font-size=20 --subtitles=/recalbox/system/resources/splash/recalboxintro.srt"
/usr/bin/omxplayer.bin $omx_opt $omx_srt $video &

# Use the sound settings from the configuration file
audiovolume=`grep audio.volume= /boot/recalbox-boot.conf | cut -d "=" -f 2`
audiodevice=`grep audio.device= /boot/recalbox-boot.conf | cut -d "=" -f 2`

if [ "$audiodevice" == "jack" ]; then
omx_opt=$omx_opt" --adev local"
fi

if [ "$audiodevice" == "hdmi" ]; then
omx_opt=$omx_opt" --adev hdmi"
fi

if [ ! -z $audiovolume ]; then
omx_opt=$omx_opt" --vol $audiovolume"
fi

/usr/bin/omxplayer.bin $omx_opt $omx_srt $video &
PID=$!

# Stop the video when ready
Expand Down Expand Up @@ -62,14 +79,47 @@ do_start ()
test -e /dev/fb0 && fbv -f -i /recalbox/system/resources/splash/logo-version.png
}

do_stop ()
{

systemsetting="python /usr/lib/python2.7/site-packages/configgen/settings/recalboxSettings.pyc"

CONFIG=/boot/recalbox-boot.conf

function set_config(){

oldvalue=`grep $1= $CONFIG | cut -d "=" -f 2`
if [ -z $oldvalue ]; then
echo $1=$2 >> $CONFIG
else
cat $CONFIG | sed "s/^\($1\s*=\s*\).*\$/\1$2/" >$CONFIG.new
cp $CONFIG.new $CONFIG
rm $CONFIG.new
fi
}

audiovolume="`$systemsetting -command load -key audio.volume`"
audiodevice="`$systemsetting -command load -key audio.volume`"

if [ ! -z $audiovolume ]; then
set_config audio.volume ${audiovolume}
fi

if [ ! -z $audiodevice ]; then
set_config audio.device ${audiodevice}
fi

}

case "$1" in
start)
do_start &
;;
stop)
;;
do_stop &
;;
restart|reload)
;;
;;
*)
esac

Expand Down