Update of /cvsroot/freevo/freevo/src/tv/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv7500

Modified Files:
        timeshift.py 
Log Message:
Some bugfixes and make it (almost) work with new events.


Index: timeshift.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/plugins/timeshift.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** timeshift.py        28 May 2003 23:31:52 -0000      1.1
--- timeshift.py        2 Jun 2003 03:33:53 -0000       1.2
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.2  2003/06/02 03:33:53  rshortt
+ # Some bugfixes and make it (almost) work with new events.
+ #
  # Revision 1.1  2003/05/28 23:31:52  rshortt
  # Timeshift plugin by Thomas Schueppel.  Still WIP.
***************
*** 45,49 ****
  import util    # Various utilities
  import osd     # The OSD class, used to communicate with the OSD daemon
! import rc      # The RemoteControl class.
  import childapp # Handle child applications
  import tv.epg_xmltv as epg # The Electronic Program Guide
--- 48,53 ----
  import util    # Various utilities
  import osd     # The OSD class, used to communicate with the OSD daemon
! import event as em
! import rc
  import childapp # Handle child applications
  import tv.epg_xmltv as epg # The Electronic Program Guide
***************
*** 59,64 ****
  FALSE = 0
  
  TIMESHIFT_READAHEAD = 4                       # Amount (in MB) of Data read before 
shifting is started 
! TIMESHIFT_INPUT = '/dev/video0'               # File to read from
  TIMESHIFT_CHUNKSIZE = 65536           # Amount to read repeatedly (in Bytes)
  
--- 63,71 ----
  FALSE = 0
  
+ (v_norm, v_input, v_clist, v_dev) = config.TV_SETTINGS.split()
+ # v_norm = string.upper(v_norm)
+ 
  TIMESHIFT_READAHEAD = 4                       # Amount (in MB) of Data read before 
shifting is started 
! TIMESHIFT_INPUT = v_dev               # File to read from
  TIMESHIFT_CHUNKSIZE = 65536           # Amount to read repeatedly (in Bytes)
  
***************
*** 140,143 ****
--- 147,152 ----
  
          if mode == 'tv':
+             # rc.set_context('tv')
+ 
              tuner_channel = self.TunerGetChannel()
  
***************
*** 263,284 ****
      def eventhandler(self, event):
          print '%s: %s app got %s event' % (time.time(), self.mode, event)
!         if (event == rc.MENU or event == rc.STOP or event == rc.EXIT or
!             event == rc.SELECT or event == rc.PLAY_END):
              self.Stop()
!             rc.post_event(rc.PLAY_END)
              return TRUE
          
!         elif event == rc.CHUP or event == rc.CHDOWN:
              if self.mode == 'vcr':
                  return
              
              # Go to the prev/next channel in the list
!             if event == rc.CHUP:
!                 self.TunerPrevChannel()
!             else:
                  self.TunerNextChannel()
              
              #pause mplayer
! #            self.thread.app.write('pause')
  
              new_channel = self.TunerGetChannel()
--- 272,295 ----
      def eventhandler(self, event):
          print '%s: %s app got %s event' % (time.time(), self.mode, event)
!         if event in (em.MENU_GOTO_MAINMENU, em.STOP, em.INPUT_EXIT,
!                      em.MENU_SELECT, em.PLAY_END):
              self.Stop()
!             rc.post_event(em.PLAY_END)
              return TRUE
          
!         # elif event == em.TV_CHANNEL_UP or event == em.TV_CHANNEL_DOWN:
!         elif event == em.MENU_PAGEUP or event == em.MENU_PAGEDOWN:
              if self.mode == 'vcr':
                  return
              
              # Go to the prev/next channel in the list
!             # if event == em.TV_CHANNEL_UP:
!             if event == em.MENU_PAGEUP:
                  self.TunerNextChannel()
+             else:
+                 self.TunerPrevChannel()
              
              #pause mplayer
!             self.thread.app.write('pause\n')
  
              new_channel = self.TunerGetChannel()
***************
*** 287,292 ****
              # TODO: Set MPlayer to start of timeshift
  
! #            self.thread.app.write('seek 0 0')
! #            self.thread.app.write('pause')
  
              # Display a channel changed message
--- 298,306 ----
              # TODO: Set MPlayer to start of timeshift
  
!             self.thread.app.write('seek 0 0\n')
!             self.thread.app.write('pause\n')
!             # self.thread.app.write('seek 0 type=2\n')
!             # self.thread.app.write('seek 98 type=1\n')
! 
  
              # Display a channel changed message
***************
*** 298,302 ****
              return TRUE
              
!         elif event == rc.DISPLAY:
              return FALSE
          
--- 312,316 ----
              return TRUE
              
!         elif event == em.TOGGLE_OSD:
              return FALSE
          
***************
*** 403,408 ****
                 
                  self.tsinput = os.popen(config.TIMESHIFT_ENCODE_CMD,'r')
!                 self.timeshift = 
pyshift.pyshift_init(config.TIMESHIFT_BUFFER,config.TIMESHIFT_BUFFER_SIZE * 1024*1024)
!                 pyshift.pyshift_write(self.timeshift,self.tsinput.read(1024*1024* 
TIMESHIFT_READAHEAD))
                  self.app = MPlayerApp(self.command)
                  
--- 417,424 ----
                 
                  self.tsinput = os.popen(config.TIMESHIFT_ENCODE_CMD,'r')
!                 self.timeshift = pyshift.pyshift_init(config.TIMESHIFT_BUFFER,
!                                        config.TIMESHIFT_BUFFER_SIZE * 1024*1024)
!                 pyshift.pyshift_write(self.timeshift,
!                               self.tsinput.read(1024*1024* TIMESHIFT_READAHEAD))
                  self.app = MPlayerApp(self.command)
                  
***************
*** 430,434 ****
                  if self.mode == 'play':
                      if DEBUG: print 'posting play_end'
!                     rc.post_event(rc.PLAY_END)
  
                  self.mode = 'idle'
--- 446,450 ----
                  if self.mode == 'play':
                      if DEBUG: print 'posting play_end'
!                     rc.post_event(em.PLAY_END)
  
                  self.mode = 'idle'




-------------------------------------------------------
This SF.net email is sponsored by: eBay
Get office equipment for less on eBay!
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to