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 import gettext
27 import os
28
29 from zope.interface import implements
30
31 from flumotion.admin.assistant.interfaces import IProducerPlugin
32 from flumotion.admin.assistant.models import VideoProducer
33 from flumotion.common import errors
34 from flumotion.common.i18n import N_, gettexter
35 from flumotion.common.messages import Info
36 from flumotion.admin.gtk.basesteps import VideoProducerStep
37
38 __version__ = "$Rev$"
39 _ = gettext.gettext
40 T_ = gettexter()
41
42
52
53
55 name = 'TVCard'
56 title = _('TV Card')
57 icon = 'tv.png'
58 gladeFile = os.path.join(os.path.dirname(os.path.abspath(__file__)),
59 'wizard.glade')
60 componentType = 'bttv'
61 docSection = 'help-configuration-assistant-producer-video-tvcard'
62 docAnchor = ''
63 docVersion = 'local'
64
68
69
70
72 self._inSetup = True
73
74 self.device.data_type = str
75 self.width.data_type = int
76 self.height.data_type = int
77 self.framerate.data_type = float
78 self.channel.data_type = str
79 self.signal.data_type = str
80
81 self.channel.prefill([''])
82 self.signal.prefill([''])
83 self.device.prefill(['/dev/video0',
84 '/dev/video1',
85 '/dev/video2',
86 '/dev/video3'])
87
88 self.add_proxy(self.model.properties,
89 ['device', 'height', 'width',
90 'framerate', 'signal', 'channel'])
91
92 self._inSetup = False
93
98
99
100
102 self.channel.clear()
103 self.channel.set_sensitive(False)
104 self.signal.clear()
105 self.signal.set_sensitive(False)
106
127
128 def errRemoteRunError(failure):
129 failure.trap(errors.RemoteRunError)
130 self.debug('a RemoteRunError happened')
131 self._clearCombos()
132 self.wizard.taskFinished(True)
133
134 def deviceFound(result):
135 if not result:
136 self._clearCombos()
137 self.wizard.taskFinished(True)
138 return None
139
140 deviceName, channels, signals = result
141 self.wizard.clear_msg('tvcard-check')
142 self.channel.prefill(channels)
143 self.channel.set_sensitive(True)
144 self.signal.prefill(signals)
145 self.signal.set_sensitive(True)
146 self.wizard.taskFinished()
147
148 d.addCallback(deviceFound)
149 d.addErrback(errRemoteRunFailure)
150 d.addErrback(errRemoteRunError)
151
152
153
156
157
167