X-Git-Url: http://git.plutz.net/?p=viper;a=blobdiff_plain;f=timeline.py;h=548280093ca38ad5b2010505b1a34bc1264a7476;hp=1ed4d5ca1061ee91ea74c4320b6d73db0f257917;hb=db783db5f7aadaaab3d8cb63f099c82cd411c20b;hpb=4ed6691dc76e77a0fdf5f69711e8d2387c058dd6 diff --git a/timeline.py b/timeline.py index 1ed4d5c..5482800 100644 --- a/timeline.py +++ b/timeline.py @@ -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