1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import gettext
23
24 from flumotion.admin.assistant.models import VideoConverter
25 from flumotion.common import documentation, messages
26 from flumotion.common.i18n import N_, gettexter, ngettext
27 from flumotion.admin.gtk.workerstep import WorkerWizardStep
28
29 __version__ = "$Rev: 6228 $"
30 T_ = gettexter()
31 _ = gettext.gettext
32
33
35 componentType = 'overlay-converter'
36
38 super(Overlay, self).__init__()
39 self._videoProducer = video_producer
40 self.can_overlay = False
41 self.show_logo = True
42 self.properties.show_text = True
43 self.properties.text = _("Flumotion")
44
45
46
48 if self.can_overlay:
49 if self.show_logo or self.properties.show_text:
50 return True
51 return False
52
53
54
65
66
68 name = 'Overlay'
69 title = _('Overlay')
70 section = _('Production')
71 gladeFile = 'overlay-wizard.glade'
72 icon = 'overlay.png'
73 componentType = 'overlay'
74 docSection = 'help-configuration-assistant-overlay'
75 docAnchor = ''
76 docVersion = 'local'
77
78 - def __init__(self, wizard, video_producer):
81
82
83
85 if self.model.hasOverlay():
86 return self.model
87
88
89
91 self.text.data_type = str
92
93 self.add_proxy(self.model, ['show_logo'])
94 self.add_proxy(self.model.properties, ['show_text', 'text'])
95
99
101 if self.wizard.getScenario().hasAudio(self.wizard):
102 return self.wizard.getStep('Production').getAudioStep()
103
104 return None
105
106
107
109 self.show_text.set_sensitive(sensitive)
110 self.show_logo.set_sensitive(sensitive)
111 self.text.set_sensitive(sensitive)
112
134
135 def checkImport(unused):
136 self.wizard.taskFinished()
137
138 self.model.can_overlay = True
139
140 def checkElements(elements):
141 if elements:
142 f = ngettext("Worker '%s' is missing GStreamer element '%s'.",
143 "Worker '%s' is missing GStreamer elements '%s'.",
144 len(elements))
145 message = messages.Warning(
146 T_(f, self.worker, "', '".join(elements)), mid='overlay')
147 message.add(
148 T_(
149 N_("\n\nClick \"Forward\" to proceed without overlay.")))
150 self.wizard.add_msg(message)
151 self.wizard.taskFinished()
152 self._setSensitive(False)
153 return
154 else:
155 self.wizard.clear_msg('overlay')
156
157
158 d = self.wizard.checkImport(self.worker, 'PIL')
159 d.addCallback(checkImport)
160 d.addErrback(importError)
161
162 self.wizard.waitForTask('overlay')
163
164 d = self.wizard.checkElements(
165 self.worker, 'ffmpegcolorspace', 'videomixer')
166 d.addCallback(checkElements)
167
168
169
170 - def on_show_text__toggled(self, button):
171 self.text.set_sensitive(button.get_active())
172