Package flumotion :: Package component :: Package producers :: Package videotest :: Module wizard_gtk
[hide private]

Source Code for Module flumotion.component.producers.videotest.wizard_gtk

 1  # -*- Mode: Python -*- 
 2  # vi:si:et:sw=4:sts=4:ts=4 
 3  # 
 4  # Flumotion - a streaming media server 
 5  # Copyright (C) 2008 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 gettext 
23  import os 
24   
25  import gtk 
26  from zope.interface import implements 
27   
28  from flumotion.wizard.basesteps import VideoProducerStep 
29  from flumotion.wizard.interfaces import IProducerPlugin 
30  from flumotion.wizard.models import VideoProducer 
31   
32  __version__ = "$Rev: 6765 $" 
33  _ = gettext.gettext 
34   
35   
36 -class TestVideoProducer(VideoProducer):
37 componentType = 'videotest-producer' 38
39 - def __init__(self):
40 super(TestVideoProducer, self).__init__() 41 42 self.properties.pattern = 0 43 self.properties.format = 'video/x-raw-yuv'
44 45
46 -class TestVideoProducerStep(VideoProducerStep):
47 name = 'Test Video Producer' 48 title = _('Test Video Producer') 49 icon = 'testsource.png' 50 gladeFile = os.path.join(os.path.dirname(os.path.abspath(__file__)), 51 'wizard.glade') 52 componentType = 'videotestsrc' 53 54 # WizardStep 55
56 - def setup(self):
57 self.pattern.data_type = int 58 self.format.data_type = str 59 self.framerate.data_type = float 60 61 self.pattern.prefill([ 62 (_('SMPTE Color bars'), 0), 63 (_('Random (television snow)'), 1), 64 (_('Totally black'), 2)]) 65 self.format.prefill([ 66 (_('YUV'), 'video/x-raw-yuv'), 67 (_('RGB'), 'video/x-raw-rgb')]) 68 69 self.add_proxy(self.model.properties, 70 ['pattern', 'width', 'height', 71 'framerate', 'format']) 72 73 sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL) 74 sizegroup.add_widget(self.width) 75 sizegroup.add_widget(self.height) 76 sizegroup.add_widget(self.framerate)
77
78 - def workerChanged(self, worker):
79 self.model.worker = worker 80 self.wizard.requireElements(worker, 'videotestsrc', 'level')
81 82
83 -class VideoTestWizardPlugin(object):
84 implements(IProducerPlugin)
85 - def __init__(self, wizard):
86 self.wizard = wizard 87 self.model = TestVideoProducer()
88
89 - def getProductionStep(self, type):
90 return TestVideoProducerStep(self.wizard, self.model)
91