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

Modified Files:
        tvtime.py 
Log Message:
make better use of freevo channels. getting better video group support slowly

Index: tvtime.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/plugins/tvtime.py,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** tvtime.py   22 Mar 2004 01:24:40 -0000      1.34
--- tvtime.py   29 May 2004 23:01:03 -0000      1.35
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.35  2004/05/29 23:01:03  mikeruelle
+ # make better use of freevo channels. getting better video group support slowly
+ #
  # Revision 1.34  2004/03/22 01:24:40  mikeruelle
  # tv channel padding so that the big number in tvtime is what us cable channel it 
is. channels must be in order to use this
***************
*** 431,435 ****
      
      def __init__(self):
-         self.tuner_chidx = 0    # Current channel, index into config.TV_CHANNELS
          self.app_mode = 'tv'
        self.fc = FreevoChannels()
--- 434,437 ----
***************
*** 440,489 ****
              channel = config.TV_CHANNELS[pos]
              if channel[2] == tuner_channel:
!                 self.tuner_chidx = pos
!                 return
          print 'ERROR: Cannot find tuner channel "%s" in the TV channel listing' % 
tuner_channel
!         self.tuner_chidx = 0
! 
  
      def TunerGetChannelInfo(self):
!         '''Get program info for the current channel'''
!         
!         tuner_id = config.TV_CHANNELS[self.tuner_chidx][2]
!         chan_name = config.TV_CHANNELS[self.tuner_chidx][1]
!         chan_id = config.TV_CHANNELS[self.tuner_chidx][0]
! 
!         channels = epg.get_guide().GetPrograms(start=time.time(),
!                                                stop=time.time(), chanids=[chan_id])
! 
!         if channels and channels[0] and channels[0].programs:
!             start_s = time.strftime('%H:%M', 
time.localtime(channels[0].programs[0].start))
!             stop_s = time.strftime('%H:%M', 
time.localtime(channels[0].programs[0].stop))
!             ts = '(%s-%s)' % (start_s, stop_s)
!             prog_info = '%s %s' % (ts, channels[0].programs[0].title)
!         else:
!             prog_info = 'No info'
!             
!         return tuner_id, chan_name, prog_info
! 
  
      def TunerGetChannel(self):
!         return config.TV_CHANNELS[self.tuner_chidx][2]
! 
! 
!     def TunerNextChannel(self):
!         self.tuner_chidx = (self.tuner_chidx+1) % len(config.TV_CHANNELS)
! 
! 
!     def TunerPrevChannel(self):
!         self.tuner_chidx = (self.tuner_chidx-1) % len(config.TV_CHANNELS)
  
-         
      def Play(self, mode, tuner_channel=None, channel_change=0):
  
-         if tuner_channel != None:
-             try:
-                 self.TunerSetChannel(tuner_channel)
-             except ValueError:
-                 pass
          if not tuner_channel:
              tuner_channel = self.fc.getChannel()
--- 442,457 ----
              channel = config.TV_CHANNELS[pos]
              if channel[2] == tuner_channel:
!                 return pos
          print 'ERROR: Cannot find tuner channel "%s" in the TV channel listing' % 
tuner_channel
!         return 0
  
      def TunerGetChannelInfo(self):
!         return self.fc.getChannelInfo()
  
      def TunerGetChannel(self):
!         return self.fc.getChannel()
  
      def Play(self, mode, tuner_channel=None, channel_change=0):
  
          if not tuner_channel:
              tuner_channel = self.fc.getChannel()
***************
*** 516,523 ****
                    cf_input = config.TV_VCR_INPUT_NUM
  
              if hasattr(config, 'TV_PAD_CHAN_NUMBERS') and config.TV_PAD_CHAN_NUMBERS:
                mychan = tuner_channel
              else:
!               mychan = self.tuner_chidx
  
              command = '%s -D %s -k -I %s -n %s -d %s -f %s -c %s -i %s' % 
(config.TVTIME_CMD,
--- 484,495 ----
                    cf_input = config.TV_VCR_INPUT_NUM
  
+             self.fc.chan_index = self.TunerSetChannel(tuner_channel)
+ 
              if hasattr(config, 'TV_PAD_CHAN_NUMBERS') and config.TV_PAD_CHAN_NUMBERS:
                mychan = tuner_channel
              else:
!               mychan = self.fc.chan_index
! 
!             _debug_('starting channel is %s' % mychan)
  
              command = '%s -D %s -k -I %s -n %s -d %s -f %s -c %s -i %s' % 
(config.TVTIME_CMD,
***************
*** 599,612 ****
                  return
               
!           # XXX hazardous to your health. don't use tvtime with anything
!           # other than one normal video_group.
!           # we lose track of the channel index at some points and
!           # chaos ensues
!             #if event == em.TV_CHANNEL_UP:
!             #    nextchan = self.fc.getNextChannel()
!             #elif event == em.TV_CHANNEL_DOWN:
!             #    nextchan = self.fc.getPrevChannel()
!             #nextvg = self.fc.getVideoGroup(nextchan)
!                                                                                 
              #if self.current_vg != nextvg:
              #    self.Stop(channel_change=1)
--- 571,585 ----
                  return
               
!             if event == em.TV_CHANNEL_UP:
!                 nextchan = self.fc.getNextChannel()
!             elif event == em.TV_CHANNEL_DOWN:
!                 nextchan = self.fc.getPrevChannel()
!             nextvg = self.fc.getVideoGroup(nextchan)
!             _debug_("nextchan is %s" % nextchan)
! 
!             # XXX hazardous to your health. don't use tvtime with anything
!             # other than one normal video_group.
!             # we lose track of the channel index at some points and
!             # chaos ensues
              #if self.current_vg != nextvg:
              #    self.Stop(channel_change=1)
***************
*** 614,627 ****
              #    return TRUE
  
              # Go to the prev/next channel in the list
              if event == em.TV_CHANNEL_UP:
!                 self.TunerPrevChannel()
!                 self.app.setchannel('UP')
              else:
!                 self.TunerNextChannel()
!                 self.app.setchannel('DOWN')
!           
!           #self.fc.chanSet(nextchan, app=self.app)
!           #self.current_vg = self.fc.getVideoGroup(self.fc.getChannel())
  
              return True
--- 587,598 ----
              #    return TRUE
  
+           self.fc.chanSet(nextchan, app=self.app)
+           #self.current_vg = self.fc.getVideoGroup(self.fc.getChannel())
+ 
              # Go to the prev/next channel in the list
              if event == em.TV_CHANNEL_UP:
!                 self.app.write('CHANNEL_UP\n')
              else:
!                 self.app.write('CHANNEL_DOWN\n')
  
              return True
***************
*** 741,745 ****
                  pass # File closed
  
-     def setchannel(self, channelno):
-         cmd = 'CHANNEL_%s\n' % channelno
-         self.write(cmd)
--- 712,713 ----



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to