| 218 | |
---|
| 219 | class TextInterface: |
---|
| 220 | def __init__(self, servername, basepath): |
---|
| 221 | self.basepath=basepath |
---|
| 222 | self.servername=servername |
---|
| 223 | self.bus=dbus.SessionBus() |
---|
| 224 | self.dev = self.bus.get_object( self.servername, self.basepath ) |
---|
| 225 | self.iface = dbus.Interface( self.dev, dbus_interface="org.ffado.Control.Element.Text" ) |
---|
| 226 | |
---|
| 227 | def text(self): |
---|
| 228 | return self.iface.getValue() |
---|
| 229 | |
---|
| 230 | def setText(self,text): |
---|
| 231 | self.iface.setValue(text) |
---|
| 232 | |
---|
| 233 | class HLine( QFrame ): |
---|
| 234 | def __init__( self, parent ): |
---|
| 235 | QFrame.__init__( self, parent ) |
---|
| 236 | self.setFrameShape( QFrame.HLine ) |
---|
| 237 | self.setLineWidth( 2 ) |
---|
| 238 | self.setMinimumHeight( 10 ) |
---|
288 | | found_panel = False |
---|
289 | | for dev in SupportedDevices: |
---|
290 | | if dev[0] == thisdev: |
---|
291 | | mixerapp = dev[1] |
---|
292 | | |
---|
293 | | # hack for the focusrite devices |
---|
294 | | # Saffire: 0x130e010001???? |
---|
295 | | # SaffireLE: 0x130e010004???? |
---|
296 | | if thisdev == (0x00130e, 0x00000000): |
---|
297 | | if int(GUID, 16) < 0x130e0100040000: |
---|
298 | | mixerapp = "SaffireMixer" |
---|
299 | | else: |
---|
300 | | mixerapp = "SaffireLEMixer" |
---|
301 | | print mixerapp |
---|
302 | | exec('tmp = '+mixerapp+'( mw )') |
---|
303 | | mixersize = tmp.size() |
---|
304 | | mw.addTab( tmp, mixerapp ) |
---|
305 | | tmp.hw = ControlInterface(server, basepath+'/DeviceManager/'+path) |
---|
306 | | tmp.configrom = cfgrom |
---|
307 | | tmp.clockselect = ClockSelectInterface(server, basepath+'/DeviceManager/'+path) |
---|
308 | | tmp.initValues() |
---|
309 | | tmp.show() |
---|
310 | | found_panel = True |
---|
311 | | |
---|
312 | | if not found_panel: |
---|
313 | | tmp = DummyMixer( mw ) |
---|
314 | | mw.addTab( tmp, modelName+" (Dummy)" ) |
---|
315 | | tmp.hw = ControlInterface(server, basepath+'/DeviceManager/'+path) |
---|
316 | | tmp.configrom = cfgrom |
---|
317 | | tmp.clockselect = ClockSelectInterface(server, basepath+'/DeviceManager/'+path) |
---|
318 | | tmp.initValues() |
---|
319 | | tmp.show() |
---|
320 | | |
---|
| 310 | dev = None |
---|
| 311 | for d in SupportedDevices: |
---|
| 312 | if d[0] == thisdev: |
---|
| 313 | dev = d |
---|
| 314 | |
---|
| 315 | w = QWidget( mw ) |
---|
| 316 | l = QVBoxLayout( w ) |
---|
| 317 | |
---|
| 318 | # |
---|
| 319 | # Generic elements for all mixers follow here: |
---|
| 320 | # |
---|
| 321 | |
---|
| 322 | tmp = GlobalMixer( w ) |
---|
| 323 | tmp.clockselect = ClockSelectInterface( server, basepath+"/DeviceManager/"+path ) |
---|
| 324 | tmp.nickname = TextInterface( server, basepath+"/DeviceManager/"+path+"/Generic/Nickname" ) |
---|
| 325 | tmp.initValues() |
---|
| 326 | l.addWidget( tmp, 1 ) |
---|
| 327 | |
---|
| 328 | # |
---|
| 329 | # Line to separate |
---|
| 330 | # |
---|
| 331 | l.addWidget( HLine( w ) ) |
---|
| 332 | |
---|
| 333 | # |
---|
| 334 | # Specific (or dummy) mixer widgets get loaded in the following |
---|
| 335 | # |
---|
| 336 | if dev != None: |
---|
| 337 | mixerapp = dev[1] |
---|
| 338 | # hack for the focusrite devices |
---|
| 339 | # Saffire: 0x130e010001???? |
---|
| 340 | # SaffireLE: 0x130e010004???? |
---|
| 341 | if thisdev == (0x00130e, 0x00000000): |
---|
| 342 | if int(GUID, 16) < 0x130e0100040000: |
---|
| 343 | mixerapp = "SaffireMixer" |
---|
| 344 | else: |
---|
| 345 | mixerapp = "SaffireLEMixer" |
---|
| 346 | |
---|
| 347 | exec( "mixerwidget = "+mixerapp+"( w )" ) |
---|
| 348 | |
---|
| 349 | else: |
---|
| 350 | mixerwidget = DummyMixer( w ) |
---|
| 351 | mixerapp = modelName+" (Dummy)" |
---|
| 352 | |
---|
| 353 | # |
---|
| 354 | # The same for all mixers |
---|
| 355 | # |
---|
| 356 | l.addWidget( mixerwidget, 10 ) |
---|
| 357 | mixerwidget.hw = ControlInterface(server, basepath+'/DeviceManager/'+path) |
---|
| 358 | mixerwidget.configrom = cfgrom |
---|
| 359 | mixerwidget.clockselect = ClockSelectInterface(server, basepath+'/DeviceManager/'+path) |
---|
| 360 | mixerwidget.initValues() |
---|
| 361 | mw.addTab( w, mixerapp ) |
---|
| 362 | |
---|
| 363 | # |
---|
| 364 | # Show the generic (development) mixer if it is available |
---|
| 365 | # |
---|