Author: duncan
Date: Thu Dec 7 10:43:15 2006
New Revision: 8702
Modified:
branches/rel-1/freevo/ChangeLog
branches/rel-1/freevo/src/tv/plugins/mplayer.py
Log:
[ 1610656 ] Patch to tv/plugins/mplayer.py to pause live TV
Patch by Philip Armstrong applied
Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog (original)
+++ branches/rel-1/freevo/ChangeLog Thu Dec 7 10:43:15 2006
@@ -36,6 +36,7 @@
* Updated imdb movie parsing to use BeautifulSoup (F#1590928)
* Updated multimail plug-in for Maildir support (F#1594915)
* Updated recordserver to allow automatic deleting of old recordings when low
on disk space (F#1594630)
+ * Updated tv mplayer plug-in to pause live tv and change channels without
stopping for dvb (F#1610656)
== Release 1.6.2 (2006-??-??) ==
--------------------------------
Modified: branches/rel-1/freevo/src/tv/plugins/mplayer.py
==============================================================================
--- branches/rel-1/freevo/src/tv/plugins/mplayer.py (original)
+++ branches/rel-1/freevo/src/tv/plugins/mplayer.py Thu Dec 7 10:43:15 2006
@@ -5,11 +5,11 @@
# $Id$
#
# Notes:
-# Todo:
+# Todo:
#
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
-# Copyright (C) 2002 Krister Lagerstrom, et al.
+# Copyright (C) 2002 Krister Lagerstrom, et al.
# Please see the file freevo/Docs/CREDITS for a complete list of authors.
#
# This program is free software; you can redistribute it and/or modify
@@ -69,7 +69,7 @@
__muted = 0
__igainvol = 0
-
+
def __init__(self):
self.tuner_chidx = 0 # Current channel, index into
config.TV_CHANNELS
self.app_mode = 'tv'
@@ -81,14 +81,14 @@
if not tuner_channel:
tuner_channel = self.fc.getChannel()
-
+
vg = self.current_vg = self.fc.getVideoGroup(tuner_channel, True)
# Convert to MPlayer TV setting strings
norm = 'norm=%s' % vg.tuner_norm
input = 'input=%s' % vg.input_num
device= 'device=%s' % vg.vdev
-
+
w, h = config.TV_VIEW_SIZE
outfmt = 'outfmt=%s' % config.TV_VIEW_OUTFMT
@@ -104,7 +104,7 @@
#ivtv_dev.print_settings()
ivtv_dev.close()
self.fc.chanSet(tuner_channel, True)
-
+
tvcmd = vg.vdev
if config.MPLAYER_ARGS.has_key('ivtv'):
@@ -128,7 +128,7 @@
tvcmd = ('tv:// -tv driver=%s:%s:freq=%s:%s:%s:'
'%s:width=%s:height=%s:%s %s' %
- (config.TV_DRIVER, vg.adev, tuner_freq, device,
input, norm,
+ (config.TV_DRIVER, vg.adev, tuner_freq, device,
input, norm,
w, h, outfmt, config.TV_OPTS))
if config.MPLAYER_ARGS.has_key('tv'):
@@ -140,7 +140,7 @@
tvcmd = ('tv:// -tv driver=%s:freq=%s:%s:%s:'
'%s:width=%s:height=%s:%s %s' %
- (config.TV_DRIVER, tuner_freq, device, input, norm,
+ (config.TV_DRIVER, tuner_freq, device, input, norm,
w, h, outfmt, config.TV_OPTS))
if config.MPLAYER_ARGS.has_key('tv'):
@@ -149,7 +149,7 @@
elif mode == 'vcr':
tvcmd = ('tv:// -tv driver=%s:%s:%s:'
'%s:width=%s:height=%s:%s %s' %
- (config.TV_DRIVER, device, input, norm,
+ (config.TV_DRIVER, device, input, norm,
w, h, outfmt, config.TV_OPTS))
if config.MPLAYER_ARGS.has_key('tv'):
@@ -172,7 +172,7 @@
# VCR is mic in
# btaudio (different dsp device) will be added later
mixer = plugin.getbyname('MIXER')
-
+
if mixer and config.MAJOR_AUDIO_CTRL == 'VOL':
mixer_vol = mixer.getMainVolume()
mixer.setMainVolume(0)
@@ -182,7 +182,7 @@
# Start up the TV task
self.app = childapp.ChildApp2(command)
-
+
self.prev_app = rc.app()
rc.app(self)
@@ -197,7 +197,7 @@
elif mixer:
mixer.setLineinVolume(config.TV_IN_VOLUME)
mixer.setIgainVolume(config.TV_IN_VOLUME)
-
+
if mixer and config.MAJOR_AUDIO_CTRL == 'VOL':
mixer.setMainVolume(mixer_vol)
elif mixer and config.MAJOR_AUDIO_CTRL == 'PCM':
@@ -231,6 +231,11 @@
rc.post_event(em.PLAY_END)
return TRUE
+ elif event == em.PAUSE or event == em.PLAY:
+ self.app.write('pause\n')
+ if DEBUG: print '%s: sending pause to mplayer' % (time.time())
+ return TRUE
+
elif event in [ em.TV_CHANNEL_UP, em.TV_CHANNEL_DOWN] or
s_event.startswith('INPUT_'):
if event == em.TV_CHANNEL_UP:
nextchan = self.fc.getNextChannel()
@@ -249,10 +254,12 @@
if self.mode == 'vcr':
return
-
+
elif self.current_vg.group_type == 'dvb':
- self.Stop(channel_change=1)
- self.Play('tv', nextchan)
+ if em.TV_CHANNEL_UP:
+ self.app.write('dvb_set_channel nextchan 0\n')
+ elif em.TV_CHANNEL_DOWN:
+ self.app.write('dvb_set_channel nextchan 0\n')
return TRUE
elif self.current_vg.group_type == 'ivtv':
@@ -282,6 +289,6 @@
cmd = 'osd_show_text "%s"\n' % msg
self.app.write(cmd)
return FALSE
-
+
return FALSE
-
+
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog