Merge branch 'master' of github.com:OpenELEC/OpenELEC.tv

This commit is contained in:
Stephan Raue 2012-03-15 13:22:41 +01:00
commit 7e0b6998f1
6 changed files with 121 additions and 24 deletions

View File

@ -1,3 +1,7 @@
2.0.5
- add possibilty to start / stop addon from addon manager with enable / disable
- restart boblightd on sleep / resume
2.0.4 2.0.4
- Fixed so that boblightd will not start it's already running - Fixed so that boblightd will not start it's already running

View File

@ -19,8 +19,8 @@
################################################################################ ################################################################################
PKG_NAME="boblightd" PKG_NAME="boblightd"
PKG_VERSION="2.0.4" PKG_VERSION="2.0.5"
PKG_REV="4" PKG_REV="5"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_SITE="http://code.google.com/p/boblight" PKG_SITE="http://code.google.com/p/boblight"

View File

@ -37,30 +37,41 @@ BOBLIGHT_CONFIG="$ADDON_HOME/boblight.conf"
# Flag file to start boblight-x11 daemon # Flag file to start boblight-x11 daemon
BOBLIGHT_X11="$ADDON_HOME/boblight.X11" BOBLIGHT_X11="$ADDON_HOME/boblight.X11"
LOCKDIR="/var/lock/"
LOCKFILE="boblightd.disabled"
export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH"
cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1 cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1
if [ ! "$(pidof boblightd)" ]; then if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
if [ -e $BOBLIGHT_CONFIG ]; then rm -rf "$LOCKDIR/$LOCKFILE"
# Make sure the xserver has started up
wait_for_xorg
# Start the boblight daemon
boblightd -c $BOBLIGHT_CONFIG -f >> $LOG_FILE 2>&1
fi
fi fi
if [ ! "$(pidof boblight-X11)" ]; then if [ -f "$BOBLIGHT_CONFIG" ] ; then
if [ -e $BOBLIGHT_X11 ]; then if [ ! "$(pidof boblightd)" ]; then
while [ true ] ; do
# Make sure the xserver has started up if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
wait_for_xorg break
fi
# Start the boblight daemon # Make sure the xserver has started up
boblight-X11 -f >> $LOG_FILE 2>&1 wait_for_xorg
# Start the boblight daemon
fi boblightd -c $BOBLIGHT_CONFIG >> $LOG_FILE 2>&1
done &
fi
if [ -e $BOBLIGHT_X11 ]; then
if [ ! "$(pidof boblight-X11)" ]; then
while [ true ] ; do
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
break
fi
# Make sure the xserver has started up
wait_for_xorg
# Start the boblight daemon
boblight-X11 >> $LOG_FILE 2>&1
done &
fi
fi
fi fi

View File

@ -0,0 +1,37 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
LOCKDIR="/var/lock/"
LOCKFILE="boblightd.disabled"
mkdir -p "$LOCKDIR"
touch "$LOCKDIR/$LOCKFILE"
if [ "$(pidof boblightd)" ];then
killall -9 boblightd
fi
if [ "$(pidof boblight-X11)" ];then
killall -9 boblight-X11
fi

View File

@ -21,12 +21,23 @@
import os import os
import sys import sys
import xbmcaddon import xbmcaddon
import time
import subprocess
__scriptname__ = "Boblightd" __scriptname__ = "Boblightd"
__author__ = "OpenELEC" __author__ = "OpenELEC"
__url__ = "http://www.openelec.tv" __url__ = "http://www.openelec.tv"
__settings__ = xbmcaddon.Addon(id='service.multimedia.boblightd') __settings__ = xbmcaddon.Addon(id='service.multimedia.boblightd')
__cwd__ = __settings__.getAddonInfo('path') __cwd__ = __settings__.getAddonInfo('path')
__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd.service") ) __start__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd.start") )
__stop__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd.stop") )
os.system(__path__) #make binary files executable in adson bin folder
subprocess.Popen("chmod -R +x " + __cwd__ + "/bin/*" , shell=True, close_fds=True)
subprocess.Popen(__start__, shell=True, close_fds=True)
while (not xbmc.abortRequested):
time.sleep(0.250)
subprocess.Popen(__stop__, shell=True, close_fds=True)

View File

@ -0,0 +1,34 @@
#!/bin/sh
################################################################################
# This file is part of OpenELEC - http://www.openelec.tv
# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv)
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This Program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenELEC.tv; see the file COPYING. If not, write to
# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA.
# http://www.gnu.org/copyleft/gpl.html
################################################################################
. /etc/profile
case "$1" in
hibernate|suspend)
boblightd.stop
;;
thaw|resume)
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.boblightd)" &
;;
*) exit $NA
;;
esac