1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31 import gettext
32 import os
33
34 from zope.interface import implements
35
36 from flumotion.admin.assistant.interfaces import IProducerPlugin
37 from flumotion.admin.assistant.models import VideoProducer
38 from flumotion.common import errors
39 from flumotion.common.i18n import N_, gettexter
40 from flumotion.common.messages import Info
41 from flumotion.admin.gtk.basesteps import VideoProducerStep
42
43 __version__ = "$Rev$"
44 _ = gettext.gettext
45 T_ = gettexter()
46
47
57
58
60 name = 'TVCard'
61 title = _('TV Card')
62 icon = 'tv.png'
63 gladeFile = os.path.join(os.path.dirname(os.path.abspath(__file__)),
64 'wizard.glade')
65 componentType = 'bttv'
66 docSection = 'help-configuration-assistant-producer-video-tvcard'
67 docAnchor = ''
68 docVersion = 'local'
69
73
74
75
77 self._inSetup = True
78
79 self.device.data_type = str
80 self.width.data_type = int
81 self.height.data_type = int
82 self.framerate.data_type = float
83 self.channel.data_type = str
84 self.signal.data_type = str
85
86 self.channel.prefill([''])
87 self.signal.prefill([''])
88 self.device.prefill(['/dev/video0',
89 '/dev/video1',
90 '/dev/video2',
91 '/dev/video3'])
92
93 self.add_proxy(self.model.properties,
94 ['device', 'height', 'width',
95 'framerate', 'signal', 'channel'])
96
97 self._inSetup = False
98
103
104
105
107 self.channel.clear()
108 self.channel.set_sensitive(False)
109 self.signal.clear()
110 self.signal.set_sensitive(False)
111
132
133 def errRemoteRunError(failure):
134 failure.trap(errors.RemoteRunError)
135 self.debug('a RemoteRunError happened')
136 self._clearCombos()
137 self.wizard.taskFinished(True)
138
139 def deviceFound(result):
140 if not result:
141 self._clearCombos()
142 self.wizard.taskFinished(True)
143 return None
144
145 deviceName, channels, signals = result
146 self.wizard.clear_msg('tvcard-check')
147 self.channel.prefill(channels)
148 self.channel.set_sensitive(True)
149 self.signal.prefill(signals)
150 self.signal.set_sensitive(True)
151 self.wizard.taskFinished()
152
153 d.addCallback(deviceFound)
154 d.addErrback(errRemoteRunFailure)
155 d.addErrback(errRemoteRunError)
156
157
158
161
162
172