Changeset - 4d500e6dc2f7
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 15 years ago 2010-06-14 06:31:05
drewp@bigasterisk.com
optimize static pics; save everything in homedir for now, not /tmp
Ignore-this: 73a1a99a7dd22b04e60fec355e470c1
3 files changed with 10 insertions and 5 deletions:
0 comments (0 inline, 0 general)
light9/vidref/main.py
Show inline comments
 
@@ -149,7 +149,7 @@ class Main(object):
 
        mainwin.show_all()
 
        self.liveVideoXid = wtree.get_object("vid3").window.xid
 

	
 
        self.setInput('dv')
 
        self.setInput('dv') # auto seems to not search for dv
 

	
 
        gobject.timeout_add(1000 // framerate, self.updateLoop)
 

	
light9/vidref/replay.py
Show inline comments
 
@@ -7,7 +7,8 @@ log = logging.getLogger()
 
framerate = 15
 

	
 
def songDir(song):
 
    return "/tmp/vidref/play-%s" % song.split('://')[-1].replace('/','_')
 
    safeUri = song.split('://')[-1].replace('/','_')
 
    return os.path.expanduser("~/light9-vidref/play-%s" % safeUri)
 

	
 
def takeDir(songDir, startTime):
 
    """
 
@@ -71,6 +72,7 @@ class ReplayView(object):
 
    def __init__(self, parent, replay):
 
        self.replay = replay
 
        self.enabled = True
 
        self.showingPic = None
 

	
 
        # this *should* be a composite widget from glade
 

	
 
@@ -155,7 +157,7 @@ class ReplayView(object):
 
        self.replayPanel.destroy()
 
        self.enabled = False
 
        
 
    def updatePic(self, position):
 
    def updatePic(self, position, lag=.2):
 

	
 
        # this should skip updating off-screen widgets! maybe that is
 
        # done by declaring the widget dirty and then reacting to a
 
@@ -164,13 +166,17 @@ class ReplayView(object):
 
        if not self.enabled:
 
            return
 
        
 
        inPic = self.replay.findClosestFrame(position['t']+.25)
 
        inPic = self.replay.findClosestFrame(position['t'] + lag)
 

	
 
        if inPic == self.showingPic:
 
            return
 
        with gtk.gdk.lock:
 
            self.picWidget.set_from_file(inPic)
 
            if 0:
 
                # force redraw of that widget
 
                self.picWidget.queue_draw_area(0,0,320,240)
 
                self.picWidget.get_window().process_updates(True)
 
        self.showingPic = inPic
 
    
 
class Replay(object):
 
    """
light9/vidref/vidref.glade
Show inline comments
 
@@ -86,7 +86,6 @@
 
                        <property name="height_request">25</property>
 
                        <property name="visible">True</property>
 
                        <property name="can_focus">True</property>
 
                        <property name="invisible_char">&#x25CF;</property>
 
                        <property name="numeric">True</property>
 
                      </object>
 
                      <packing>
0 comments (0 inline, 0 general)