| Trees | Indices | Help |
|---|
|
|
1 # -*- Mode: Python -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 # 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007 Fluendo, S.L. (www.fluendo.com). 6 # All rights reserved. 7 8 # This file may be distributed and/or modified under the terms of 9 # the GNU General Public License version 2 as published by 10 # the Free Software Foundation. 11 # This file is distributed without any warranty; without even the implied 12 # warranty of merchantability or fitness for a particular purpose. 13 # See "LICENSE.GPL" in the source distribution for more information. 14 15 # Licensees having purchased or holding a valid Flumotion Advanced 16 # Streaming Server license may use this file in accordance with the 17 # Flumotion Advanced Streaming Server Commercial License Agreement. 18 # See "LICENSE.Flumotion" in the source distribution for more information. 19 20 # Headers in this file shall remain intact. 21 22 import os 23 import gettext 24 25 import gst 26 27 from flumotion.component.base.admin_gtk import BaseAdminGtk 28 from flumotion.component.base.baseadminnode import BaseAdminGtkNode 29 from flumotion.ui.glade import GladeWidget 30 31 __version__ = "$Rev: 6784 $" 32 _ = gettext.gettext 33 3436 sec = value / gst.SECOND 37 mins = sec / 60 38 sec = sec % 60 39 hours = mins / 60 40 mins = mins % 60 41 return "%02d:%02d:%02d" % (hours, mins, sec)42 4345 gladeFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), 46 'flufileinfo.glade') 47 duration = 0 486150 self.locationlabel.set_text(location)51 5557 self.audiolabel.set_markup(audio or "<i>No audio</i>")5860 self.videolabel.set_markup(video or "<i>No video</i>")63 logCategory = 'looper' 64 65 uiStateHandlers = None 66 gladeFile = os.path.join('flumotion', 'component', 'producers', 67 'looper', 'looper.glade') 6812170 self.widget = self.wtree.get_widget('looper-widget') 71 self.fileinfowidget = self.wtree.get_widget('fileinfowidget') 72 self.numiterlabel = self.wtree.get_widget('iterationslabel') 73 self.curposlabel = self.wtree.get_widget('curposlabel') 74 self.positionbar = self.wtree.get_widget('positionbar') 75 self.restartbutton = self.wtree.get_widget('restartbutton') 76 self.restartbutton.set_sensitive(False)7779 BaseAdminGtkNode.setUIState(self, state) 80 if not self.uiStateHandlers: 81 self.uiStateHandlers = {'info-duration': 82 self.fileinfowidget.set_duration, 83 'info-location': 84 self.fileinfowidget.set_location, 85 'info-audio': 86 self.fileinfowidget.set_audio, 87 'info-video': 88 self.fileinfowidget.set_video, 89 'position': self.positionSet, 90 'num-iterations': self.numIterationsSet} 91 for k, handler in self.uiStateHandlers.items(): 92 handler(state.get(k))9395 self.log("got new position : %d" % newposition) 96 if self.fileinfowidget.duration: 97 percent = float(newposition % self.fileinfowidget.duration) / float(self.fileinfowidget.duration) 98 self.positionbar.set_fraction(percent) 99 self.positionbar.set_text(time_to_string(newposition % self.fileinfowidget.duration))100 103 106108 self.warning("Failure %s getting pattern: %s" % ( 109 failure.type, failure.getErrorMessage())) 110 return None111 116128 129 GUIClass = LooperAdminGtk 130124 looper = LooperNode(self.state, self.admin, title=_("Looper")) 125 self.nodes['Looper'] = looper 126 127 return BaseAdminGtk.setup(self)
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0.1 on Sat Jul 26 09:43:12 2008 | http://epydoc.sourceforge.net |