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
62
63
65 name = 'Overlay'
66 title = _('Overlay')
67 section = _('Production')
68 gladeFile = 'overlay-wizard.glade'
69 icon = 'overlay.png'
70 componentType = 'overlay'
71 docSection = 'help-configuration-assistant-overlay'
72 docAnchor = ''
73 docVersion = 'local'
74
75 - def __init__(self, wizard, video_producer):
78
79
80
82 if self.model.hasOverlay():
83 return self.model
84
85
86
88 self.text.data_type = str
89
90 self.add_proxy(self.model, ['show_logo'])
91 self.add_proxy(self.model.properties, ['show_text', 'text'])
92
96
98 if self.wizard.getScenario().hasAudio(self.wizard):
99 return self.wizard.getStep('Production').getAudioStep()
100
101 return None
102
103
104
106 self.show_text.set_sensitive(sensitive)
107 self.show_logo.set_sensitive(sensitive)
108 self.text.set_sensitive(sensitive)
109
131
132 def checkImport(unused):
133 self.wizard.taskFinished()
134
135 self.model.can_overlay = True
136
137 def checkElements(elements):
138 if elements:
139 f = ngettext("Worker '%s' is missing GStreamer element '%s'.",
140 "Worker '%s' is missing GStreamer elements '%s'.",
141 len(elements))
142 message = messages.Warning(
143 T_(f, self.worker, "', '".join(elements)), mid='overlay')
144 message.add(
145 T_(
146 N_("\n\nClick \"Forward\" to proceed without overlay.")))
147 self.wizard.add_msg(message)
148 self.wizard.taskFinished()
149 self._setSensitive(False)
150 return
151 else:
152 self.wizard.clear_msg('overlay')
153
154
155 d = self.wizard.checkImport(self.worker, 'cairo')
156 d.addCallback(checkImport)
157 d.addErrback(importError)
158
159 self.wizard.waitForTask('overlay')
160
161 d = self.wizard.checkElements(
162 self.worker, 'ffmpegcolorspace', 'videomixer')
163 d.addCallback(checkElements)
164
165
166
167 - def on_show_text__toggled(self, button):
168 self.text.set_sensitive(button.get_active())
169