Update of /cvsroot/freevo/freevo/src/tv/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9146/src/tv/plugins

Modified Files:
        xine.py 
Log Message:
Further vdr-xine for DVB and df_xine tweaks, still planning on smoothing things
over and also add ivtv (input_pvr) support.


Index: xine.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/plugins/xine.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** xine.py     20 Nov 2004 18:23:04 -0000      1.9
--- xine.py     28 Dec 2004 00:35:19 -0000      1.10
***************
*** 14,17 ****
--- 14,21 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.10  2004/12/28 00:35:19  rshortt
+ # Further vdr-xine for DVB and df_xine tweaks, still planning on smoothing 
things
+ # over and also add ivtv (input_pvr) support.
+ #
  # Revision 1.9  2004/11/20 18:23:04  dischi
  # use python logger module for debug
***************
*** 69,73 ****
  
  import config     # Configuration handler. reads config file.
! import childapp   # Handle child applications
  import util
  import plugin
--- 73,77 ----
  
  import config     # Configuration handler. reads config file.
! from util.popen import Process
  import util
  import plugin
***************
*** 76,79 ****
--- 80,86 ----
  from tv.player import TVPlayer
  
+ import pyepg
+ from vdr.vdr import VDR
+ 
  import logging
  log = logging.getLogger('tv')
***************
*** 115,118 ****
--- 122,127 ----
                  self.reason = "'fbxine' version too old"
                  return
+         elif config.XINE_COMMAND.find('df_xine') >= 0:
+             type = 'df'
          else:
              type = 'X'
***************
*** 138,141 ****
--- 147,151 ----
          self.version   = version
          self.app       = None
+         self.device    = None
          self.command = config.XINE_COMMAND.split(' ') + \
                         [ '--stdctl', '-V', config.XINE_VO_DEV,
***************
*** 143,160 ****
                         config.XINE_ARGS_DEF.split(' ')
  
  
!     def rate(self, channel, device, freq):
          """
          xine can only play dvb
          """
          if device.startswith('dvb'):
              return 2
          return 0
  
      
!     def play(self, channel, device, freq):
          """
          play with xine
          """
          if plugin.getbyname('MIXER'):
              plugin.getbyname('MIXER').reset()
--- 153,186 ----
                         config.XINE_ARGS_DEF.split(' ')
  
+         if config.XINE_USE_VDR:
+             self.vdr = VDR(host=config.VDR_HOST, 
+                            port=config.VDR_PORT, 
+                            videopath=config.VDR_DIR, 
+                            channelsfile=config.VDR_CHANNELS, 
+                            epgfile=config.VDR_EPG,
+                            close_connection=1)
+             self.vdr.getsvdrp()
  
! 
!     def rate(self, channel, device, uri):
          """
          xine can only play dvb
          """
+         log.debug('xine tv asked to rate: %s %s %s' % (channel, device, uri))
          if device.startswith('dvb'):
              return 2
+         elif device.startswith('ivtv'):
+             return 2
+ 
          return 0
  
      
!     def play(self, channel, device, uri):
          """
          play with xine
          """
+         self.channel = channel
+         self.device  = device
+ 
          if plugin.getbyname('MIXER'):
              plugin.getbyname('MIXER').reset()
***************
*** 170,179 ****
              command.append('--no-lirc')
  
!         command.append('dvb://' + freq)
              
          log.info('Xine.play(): Starting cmd=%s' % command)
  
          self.show()
!         self.app = childapp.Instance( command, prio = config.MPLAYER_NICE )
      
  
--- 196,213 ----
              command.append('--no-lirc')
  
!         if device.startswith('dvb'):
!             if config.XINE_USE_VDR:
!                 command.append('vdr://tmp/vdr-xine/stream#demux:mpeg_pes')
!                 log.debug('want to play %s' % uri)
!                 self.vdr.svdrp.chan(String(uri))
!             else:
!                 command.append('dvb://' + uri)
!         elif device.startswith('ivtv'):
!             command.append('pvr://' + uri)
              
          log.info('Xine.play(): Starting cmd=%s' % command)
  
          self.show()
!         self.app = Process( command )
      
  
***************
*** 195,198 ****
--- 229,238 ----
              return True
          
+         # OSD_MESSAGE to vdr-xine is hanging VDR on me, investigating
+         #if event == OSD_MESSAGE:
+         #    if config.XINE_USE_VDR:
+         #        self.vdr.svdrp.osd_message(String(event.arg))
+         #        return True
+         
          if event == PAUSE or event == PLAY:
              self.app.write('pause\n')
***************
*** 207,210 ****
--- 247,269 ----
              return True
  
+         if event == TV_CHANNEL_UP:
+             if config.XINE_USE_VDR:
+                 self.channel = pyepg.get_channel(self.channel, 1)
+                 uri = self.channel.get_uri(self.channel, self.device)
+                 self.vdr.svdrp.chan(String(uri))
+                 return True
+ 
+         if event == TV_CHANNEL_DOWN:
+             if config.XINE_USE_VDR:
+                 self.channel = pyepg.get_channel(self.channel, -1)
+                 uri = self.channel.get_uri(self.channel, self.device)
+                 self.vdr.svdrp.chan(String(uri))
+                 return True
+ 
+         if event in INPUT_ALL_NUMBERS:
+             digit = str(event).split('_')[1]
+             self.vdr.svdrp.hitk(digit)
+             log.debug('xine: user pressed digit %s' % digit)
+ 
          # nothing found
          return False



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to