]> git.plutz.net Git - viper/blobdiff - timeline.py
started basic frameset support
[viper] / timeline.py
index 1ed4d5ca1061ee91ea74c4320b6d73db0f257917..548280093ca38ad5b2010505b1a34bc1264a7476 100644 (file)
@@ -1,5 +1,5 @@
 #encoding: utf-8
-#Copyright 2009 - 2010 Paul Hänsch
+#Copyright 2009 - 2011 Paul Hänsch
 
 #This file is part of Viper.
 
@@ -18,6 +18,7 @@
 
 from Tkinter import *
 from vchunk import *
+from vframeset import *
 import Pmw
 
 class Timeline(Frame):
@@ -44,6 +45,7 @@ class Timeline(Frame):
         self.chunks = []
         self.mods = []    # list of chunk modifying objects (filter and effect dialogs)
         self.view = None  # viewer widget
+       self.basedir = None  #path of project directory, required for framesets
         self.animChunks = BooleanVar(value = True)
         tooltips = Pmw.Balloon(self)
 
@@ -109,9 +111,22 @@ class Timeline(Frame):
 
     def convert(self):
         """
-        Converts marked chunks to framesets (not yet implemented)
+        Converts marked chunks to framesets
         """
-        pass
+       for vc in self.chunks:
+            if vc.marked.get():
+                index = self.chunks.index(vc)
+                new = VFrameset(self.subgets['chunklist'].interior(),
+                                vurl = vc.videofile,
+                               )
+                new.played.set(value = vc.played.get())
+                new.marked.set(value = vc.marked.get())
+                new.play()
+                new.pack(before = vc, side=LEFT)
+                self.chunks.insert(index, new)
+                self.chunks.remove(vc)
+                vc.stop()
+                vc.destroy()
 
     def playall(self):
         """
@@ -219,3 +234,10 @@ class Timeline(Frame):
 
     def set_mods(self, mods):
         self.mods = mods
+
+    def set_basedir(self, basedir):
+       self.basedir = basedir
+       self.subgets['b_frameset'].config(state = 'normal')
+
+    def get_basedir(self):
+       return self.basedir