Update of /cvsroot/freevo/freevo/src/animation
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5467
Modified Files:
render.py
Log Message:
update to new callback handling in rc
Index: render.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/animation/render.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** render.py 25 Apr 2004 11:23:58 -0000 1.1
--- render.py 31 May 2004 10:46:18 -0000 1.2
***************
*** 18,21 ****
--- 18,24 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.2 2004/05/31 10:46:18 dischi
+ # update to new callback handling in rc
+ #
# Revision 1.1 2004/04/25 11:23:58 dischi
# Added support for animations. Most of the code is from Viggo Fredriksen
***************
*** 46,50 ****
# freevo modules
! import osd, config, util
# pygame modules
--- 49,53 ----
# freevo modules
! import osd, config, util, rc
# pygame modules
***************
*** 53,57 ****
# python modules
from time import sleep, time
!
_singleton = None
--- 56,60 ----
# python modules
from time import sleep, time
! import copy
_singleton = None
***************
*** 90,94 ****
suspended = [] # suspended animations
osd = None
- realtime = False # update as fast as possible
def __init__(self):
--- 93,96 ----
***************
*** 97,105 ****
! def set_realtime(self, realtime=False):
! self.realtime = realtime
!
!
! def update_wait(self, timer=0):
"""
This is used while starting freevo
--- 99,103 ----
! def update_wait(self):
"""
This is used while starting freevo
***************
*** 110,117 ****
if self.osd == None:
self.osd = osd.get_singleton()
self.update = self.update_enabled
! def update_enabled(self, timer=0):
"""
This is the draw method for animations
--- 108,117 ----
if self.osd == None:
self.osd = osd.get_singleton()
+ rc.unregister(self.update)
self.update = self.update_enabled
+ rc.register(self.update, True, 0)
! def update_enabled(self):
"""
This is the draw method for animations
***************
*** 122,130 ****
i = 0
! for a in self.animations:
# XXX something should be done to clean up the mess
if a.delete:
self.animations.remove(a)
continue
--- 122,135 ----
i = 0
! timer = pygame.time.get_ticks()
!
! for a in copy.copy(self.animations):
# XXX something should be done to clean up the mess
if a.delete:
self.animations.remove(a)
+ if len(self.animations) == 0:
+ # no more animations, unregister ourself to the main loop:
+ rc.unregister(self.update)
continue
***************
*** 169,172 ****
--- 174,180 ----
except:
pass
+ if len(self.animations) == 0:
+ # no more animations, unregister ourself to the main loop:
+ rc.unregister(self.update)
***************
*** 177,180 ****
--- 185,189 ----
for a in self.animations:
a.remove()
+ rc.unregister(self.update)
***************
*** 204,206 ****
"""
self.animations.append(anim_object)
!
--- 213,217 ----
"""
self.animations.append(anim_object)
! if len(self.animations) == 1:
! # first animation, register ourself to the main loop:
! rc.register(self.update, True, 0)
-------------------------------------------------------
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