Update of /cvsroot/freevo/freevo/WIP/Ruelle
In directory sc8-pr-cvs1:/tmp/cvs-serv23318

Modified Files:
        tvtime.py 
Log Message:
new thread test

Index: tvtime.py
===================================================================
RCS file: /cvsroot/freevo/freevo/WIP/Ruelle/tvtime.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tvtime.py   17 Sep 2003 17:05:58 -0000      1.5
--- tvtime.py   21 Sep 2003 01:06:52 -0000      1.6
***************
*** 10,15 ****
  # -----------------------------------------------------------------------
  # $Log$
! # Revision 1.5  2003/09/17 17:05:58  mikeruelle
! # ok we need to think about autoscan now
  #
  # Revision 1.17  2003/09/03 17:54:38  dischi
--- 10,15 ----
  # -----------------------------------------------------------------------
  # $Log$
! # Revision 1.6  2003/09/21 01:06:52  mikeruelle
! # new thread test
  #
  # Revision 1.17  2003/09/03 17:54:38  dischi
***************
*** 58,62 ****
  
  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
--- 58,61 ----
***************
*** 69,78 ****
  DEBUG = config.DEBUG or 3
  
- TRUE = 1
- FALSE = 0
- 
- # Create the OSD object
- osd = osd.get_singleton()
- 
  class PluginInterface(plugin.Plugin):
      """
--- 68,71 ----
***************
*** 161,166 ****
        fp.close()
  
-     # BUG: fix the default band from the static US Cable
-     # INFO: for custom freq ' band="Custom" channel="55.25MHz" '
      def writeStationListXML(self):
          print "writing new stationlist.xml"
--- 154,157 ----
***************
*** 242,248 ****
      
      def __init__(self):
!         self.thread = TVTime_Thread()
!         self.thread.setDaemon(1)
!         self.thread.start()
          self.tuner_chidx = 0    # Current channel, index into config.TV_CHANNELS
          self.app_mode = 'tv'
--- 233,241 ----
      
      def __init__(self):
!         self.thread = childapp.ChildThread()
!         self.thread.stop_osd = True
! #        self.thread = TVTime_Thread()
! #        self.thread.setDaemon(1)
! #        self.thread.start()
          self.tuner_chidx = 0    # Current channel, index into config.TV_CHANNELS
          self.app_mode = 'tv'
***************
*** 348,355 ****
                                                                     'freevo',
                                                                     self.tuner_chidx)
-             if osd.get_fullscreen() == 1:
-                 command += ' -m'
-             else:
-                 command += ' -M'
  
          else:
--- 341,344 ----
***************
*** 373,385 ****
  
          # Start up the TV task
!         self.thread.mode = 'play'
!         self.thread.command = command
!         self.thread.mode_flag.set()
!         
!         self.prev_app = rc.app()
!         rc.app(self)
  
!         if osd.focused_app():
!             osd.focused_app().hide()
  
          # Suppress annoying audio clicks
--- 362,369 ----
  
          # Start up the TV task
!         self.thread.start(TVTimeApp, (command))        
  
!         self.prev_app = rc.app() # ???
!         rc.app(self)
  
          # Suppress annoying audio clicks
***************
*** 407,421 ****
              mixer.setIgainVolume(0) # Input on emu10k cards.
  
!         self.thread.mode = 'stop'
!         self.thread.mode_flag.set()
! 
          rc.app(self.prev_app)
-         if osd.focused_app():
-             osd.focused_app().show()
- 
-         while self.thread.mode == 'stop':
-             time.sleep(0.05)
-         print 'stopped %s app' % self.mode
- 
  
      def eventhandler(self, event, menuw=None):
--- 391,396 ----
              mixer.setIgainVolume(0) # Input on emu10k cards.
  
!         self.thread.stop('quit\n')
          rc.app(self.prev_app)
  
      def eventhandler(self, event, menuw=None):
***************
*** 454,458 ****
      """
  
!     def __init__(self, app):
          if config.MPLAYER_DEBUG:
              fname_out = os.path.join(config.LOGDIR, 'tvtime_stdout.log')
--- 429,433 ----
      """
  
!     def __init__(self, (app)):
          if config.MPLAYER_DEBUG:
              fname_out = os.path.join(config.LOGDIR, 'tvtime_stdout.log')
***************
*** 513,520 ****
              print 'TVTIME screenshot!'
              self.write('screenshot\n')
-         elif line == 'z':
-             print 'TVTIME fullscreen toggle!'
-             self.write('toggle_fullscreen\n')
-             osd.toggle_fullscreen()
          else:
              event = events.get(line, None)
--- 488,491 ----
***************
*** 544,600 ****
          self.write('enter\n')
  
-         
- # ======================================================================
- class TVTime_Thread(threading.Thread):
- 
-     def __init__(self):
-         threading.Thread.__init__(self)
-         
-         self.mode = 'idle'
-         self.mode_flag = threading.Event()
-         self.command  = ''
-         self.app = None
-         self.fifo = None
-         self.audioinfo = None              # Added to enable update of GUI
- 
-     def run(self):
-         while 1:
-             if self.mode == 'idle':
-                 self.mode_flag.wait()
-                 self.mode_flag.clear()
-                 
-             elif self.mode == 'play':
-                 # X11 cannot handle two fullscreen windows, so shut down the window.
-                 if config.CONF.display == 'x11': 
-                     if DEBUG:
-                         print "Stopping Display for tvtime/x11"
-                     osd.stopdisplay()                 
-                 if DEBUG:
-                     print 'TVTime_Thread.run(): Started, cmd=%s' % self.command
-                     
-                 self.app = TVTimeApp(self.command)
-                 
-                 while self.mode == 'play' and self.app.isAlive():
-                     if self.audioinfo: 
-                         if not self.audioinfo.pause:
-                             self.audioinfo.draw()        
-                     time.sleep(0.1)
- 
-                 self.app.kill()
- 
-                 # Ok, we can use the OSD again.
-                 if config.CONF.display == 'x11':
-                     if DEBUG:
-                         print "Display now back online"
-                     osd.restartdisplay()
-                 osd.update()
- 
-                 if self.mode == 'play':
-                     if DEBUG: print 'posting play_end'
-                     rc.post_event(em.PLAY_END)
- 
-                 self.mode = 'idle'
-                 
-             else:
-                 self.mode = 'idle'
  
--- 515,517 ----




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to