diff --git a/packages/addons/service/multimedia/vdr-addon/changelog.txt b/packages/addons/service/multimedia/vdr-addon/changelog.txt index 91d851a813..f7725c4b77 100644 --- a/packages/addons/service/multimedia/vdr-addon/changelog.txt +++ b/packages/addons/service/multimedia/vdr-addon/changelog.txt @@ -1,3 +1,6 @@ +2.0.7 +- add possibilty to start / stop addon from addon manager with enable / disable + 2.0.6 - enable unloading/loading dvb modules on suspend/resume diff --git a/packages/addons/service/multimedia/vdr-addon/meta b/packages/addons/service/multimedia/vdr-addon/meta index 783e12d751..41b1c71158 100755 --- a/packages/addons/service/multimedia/vdr-addon/meta +++ b/packages/addons/service/multimedia/vdr-addon/meta @@ -21,7 +21,7 @@ PKG_NAME="vdr-addon" PKG_VERSION="2.0" -PKG_REV="6" +PKG_REV="7" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://www.openelec.tv" diff --git a/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.service b/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.start similarity index 100% rename from packages/addons/service/multimedia/vdr-addon/source/bin/vdr.service rename to packages/addons/service/multimedia/vdr-addon/source/bin/vdr.start diff --git a/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.stop b/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.stop new file mode 100755 index 0000000000..59d121cb37 --- /dev/null +++ b/packages/addons/service/multimedia/vdr-addon/source/bin/vdr.stop @@ -0,0 +1,28 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 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, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. /etc/profile + +if [ $(pidof vdr.bin) ];then + killall vdr.bin +fi + diff --git a/packages/addons/service/multimedia/vdr-addon/source/default.py b/packages/addons/service/multimedia/vdr-addon/source/default.py index af886007bc..ed45aecba0 100644 --- a/packages/addons/service/multimedia/vdr-addon/source/default.py +++ b/packages/addons/service/multimedia/vdr-addon/source/default.py @@ -21,12 +21,23 @@ import os import sys import xbmcaddon +import time +import subprocess __scriptname__ = "VDR Service" __author__ = "OpenELEC" __url__ = "http://www.openelec.tv" __settings__ = xbmcaddon.Addon(id='service.multimedia.vdr-addon') __cwd__ = __settings__.getAddonInfo('path') -__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "vdr.service") ) +__start__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "vdr.start") ) +__stop__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "vdr.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) diff --git a/packages/addons/service/multimedia/vdr-addon/source/sleep.d/modules.power b/packages/addons/service/multimedia/vdr-addon/source/sleep.d/modules.power index d475c9aee0..6961bca411 100644 --- a/packages/addons/service/multimedia/vdr-addon/source/sleep.d/modules.power +++ b/packages/addons/service/multimedia/vdr-addon/source/sleep.d/modules.power @@ -1,5 +1,25 @@ #!/bin/sh +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 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, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + . /etc/profile ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.multimedia.vdr-addon" @@ -11,19 +31,16 @@ if [ -f "$ADDON_CONFIG_DIR/vdr-sleep.conf" ]; then if [ ! "$REMOVE_MODULES" == "" ] ; then case "$1" in hibernate|suspend) - killall -9 vdr.bin - # xbmc-send -a "Notification(suspend,unloading modules...)" + vdr.stop for module in $REMOVE_MODULES ; do rmmod -w $module done ;; thaw|resume) - # xbmc-send -a "Notification(resume,loading modules...)" for module in $REMOVE_MODULES ; do modprobe $module done - # xbmc-send -a "Notification(resume,starting vdr service...)" - vdr.service + xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.vdr-addon)" & ;; *) exit $NA ;;