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