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

Modified Files:
        mplayer.py 
Log Message:
Make it possible to change channels between those that have different
VideoGroups.  For example, on my setup channel 3 is my webcam, 4-50 is 
analog cable, and 200+ is my satellite system.  I can start on channel 3, 
see my webcam on the tv (security cam), channel+ and instantly view my 
cable channels and channel+ through to my satellite channels.


Index: mplayer.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/tv/plugins/mplayer.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** mplayer.py  27 Nov 2003 03:11:08 -0000      1.29
--- mplayer.py  31 Dec 2003 16:13:15 -0000      1.30
***************
*** 10,13 ****
--- 10,20 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.30  2003/12/31 16:13:15  rshortt
+ # Make it possible to change channels between those that have different
+ # VideoGroups.  For example, on my setup channel 3 is my webcam, 4-50 is
+ # analog cable, and 200+ is my satellite system.  I can start on channel 3,
+ # see my webcam on the tv (security cam), channel+ and instantly view my
+ # cable channels and channel+ through to my satellite channels.
+ #
  # Revision 1.29  2003/11/27 03:11:08  rshortt
  # Shuffle things around a little bit and add ivtv capabilities.  I intend to
***************
*** 149,159 ****
  
  
!     def Play(self, mode, tuner_channel=None, channel_change=0):
  
          if not tuner_channel:
              tuner_channel = self.fc.getChannel()
              
          vg = self.current_vg = self.fc.getVideoGroup(tuner_channel)
! 
  
          # Convert to MPlayer TV setting strings
--- 156,169 ----
  
  
!     def Play(self, mode, tuner_channel=None):
! 
!         print 'PLAY CHAN: %s' % tuner_channel
  
          if not tuner_channel:
              tuner_channel = self.fc.getChannel()
+             print 'PLAY CHAN: %s' % tuner_channel
              
          vg = self.current_vg = self.fc.getVideoGroup(tuner_channel)
!         print 'PLAY GROUP: %s' % vg.desc
  
          # Convert to MPlayer TV setting strings
***************
*** 173,176 ****
--- 183,187 ----
                  ivtv_dev = ivtv.IVTV(vg.vdev)
                  ivtv_dev.init_settings()
+                 ivtv_dev.setinput(vg.input_num)
                  ivtv_dev.print_settings()
                  self.fc.chanSet(tuner_channel)
***************
*** 181,184 ****
--- 192,202 ----
                      args += (config.MPLAYER_ARGS['ivtv'],)
  
+             elif vg.group_type == 'webcam':
+                 self.fc.chanSet(tuner_channel, app='mplayer')
+                 tvcmd = ''
+ 
+                 if config.MPLAYER_ARGS.has_key('webcam'):
+                     args += (config.MPLAYER_ARGS['webcam'],)
+ 
              else:
                  freq_khz = self.fc.chanSet(tuner_channel, app='mplayer')
***************
*** 255,261 ****
          
          
!     def Stop(self):
          mixer = plugin.getbyname('MIXER')
!         if mixer:
              mixer.setLineinVolume(0)
              mixer.setMicVolume(0)
--- 273,279 ----
          
          
!     def Stop(self, channel_change=0):
          mixer = plugin.getbyname('MIXER')
!         if mixer and not channel_change:
              mixer.setLineinVolume(0)
              mixer.setMicVolume(0)
***************
*** 265,269 ****
  
          rc.app(self.prev_app)
!         if osd.focused_app():
              osd.focused_app().show()
  
--- 283,287 ----
  
          rc.app(self.prev_app)
!         if osd.focused_app() and not channel_change:
              osd.focused_app().show()
  
***************
*** 280,285 ****
          
          elif event == em.TV_CHANNEL_UP or event == em.TV_CHANNEL_DOWN:
!             # XXX: channel Up/Down code will have to be reworked in order
!             #      to handle multiple VideoGroups between channels.
  
              if self.mode == 'vcr':
--- 298,316 ----
          
          elif event == em.TV_CHANNEL_UP or event == em.TV_CHANNEL_DOWN:
! 
!             if event == em.TV_CHANNEL_UP:
!                 nextchan = self.fc.getNextChannel()
!             else:
!                 nextchan = self.fc.getPrevChannel()
! 
!             print 'NEXT CHAN: %s' % nextchan
!             nextvg = self.fc.getVideoGroup(nextchan)
!             print 'NEXT GROUP: %s' % nextvg.desc
! 
!             if self.current_vg != nextvg:
!                 print 'NEW GROUP!'
!                 self.Stop(channel_change=1)
!                 self.Play('tv', nextchan)
!                 return TRUE
  
              if self.mode == 'vcr':
***************
*** 287,305 ****
              
              elif self.current_vg.group_type == 'ivtv':
!                 # Go to the prev/next channel in the list
!                 if event == em.TV_CHANNEL_UP:
!                     self.fc.chanUp()
!                 else:
!                     self.fc.chanDown()
!     
                  self.thread.app.write('seek 999999 0\n')
  
              else:
!                 # Go to the prev/next channel in the list
!                 if event == em.TV_CHANNEL_UP:
!                     freq_khz = self.fc.chanUp(app=self.thread.app)
!                 else:
!                     freq_khz = self.fc.chanDown(app=self.thread.app)
!     
                  new_freq = '%1.3f' % (freq_khz / 1000.0)
                  self.thread.app.write('tv_set_freq %s\n' % new_freq)
--- 318,326 ----
              
              elif self.current_vg.group_type == 'ivtv':
!                 self.fc.chanSet(nextchan)
                  self.thread.app.write('seek 999999 0\n')
  
              else:
!                 freq_khz = self.fc.chanSet(nextchan, app=self.thread.app)
                  new_freq = '%1.3f' % (freq_khz / 1000.0)
                  self.thread.app.write('tv_set_freq %s\n' % new_freq)




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to