The connection to FFADOs DBus service could not be established.Probably you didn't start the ffado-dbus-server. Should I try this now?
", QMessageBox.Yes, QMessageBox.No )
if tmp == 4:
sys.exit(-1)
else:
os.spawnlp( os.P_NOWAIT, "ffado-dbus-server" )
nb_checks = 20
while nb_checks > 0:
nb_checks = nb_checks - 1
try:
devmgr=DeviceManagerInterface(server, basepath)
nbDevices=devmgr.getNbDevices()
nb_checks = 0
repeat = 0
except dbus.DBusException, ex:
time.sleep( 1 )
if nbDevices == 0:
print "No supported device found..."
msg.information( msg, "No mixer found", "No devices with mixer support discovered." )
sys.exit( -1 )
mw = QTabWidget()
mixerwidgets = []
for idx in range(nbDevices):
path=devmgr.getDeviceName(idx)
print "Found device %d: %s" % (idx, path)
cfgrom = ConfigRomInterface(server, basepath+'/DeviceManager/'+path)
vendorId = cfgrom.getVendorId()
modelId = cfgrom.getModelId()
unitVersion = cfgrom.getUnitVersion()
GUID = cfgrom.getGUID()
vendorName = cfgrom.getVendorName()
modelName = cfgrom.getModelName()
print " Found (%s, %X, %X) %s %s" % (str(GUID), vendorId, modelId, vendorName, modelName)
# check whether this has already been registered at ffado.org
reg = ffado_registration(FFADO_VERSION, int(GUID, 16),
vendorId, modelId,
vendorName, modelName)
reg.check_for_registration()
thisdev=(vendorId, modelId);
# The MOTU devices use unitVersion to differentiate models. For the
# moment thought we don't need to know precisely which model we're
# using.
if vendorId == 0x1f2:
thisdev=(vendorId, 0x00000000)
dev = None
for d in SupportedDevices:
if d[0] == thisdev:
dev = d
w = QWidget( mw )
l = QVBoxLayout( w )
# create a control object
hw = ControlInterface(server, basepath+'/DeviceManager/'+path)
clockselect = ClockSelectInterface( server, basepath+"/DeviceManager/"+path )
samplerateselect = SamplerateSelectInterface( server, basepath+"/DeviceManager/"+path )
nickname = TextInterface( server, basepath+"/DeviceManager/"+path+"/Generic/Nickname" )
#
# Generic elements for all mixers follow here:
#
tmp = GlobalMixer( w )
tmp.configrom = cfgrom
tmp.clockselect = clockselect
tmp.samplerateselect = samplerateselect
tmp.nickname = nickname
tmp.hw = hw
tmp.initValues()
l.addWidget( tmp, 1 )
#
# Line to separate
#
l.addWidget( HLine( w ) )
#
# Specific (or dummy) mixer widgets get loaded in the following
#
if dev != None:
mixerapp = dev[1]
if vendorId == 0x00130e:
is_saffirele = False
is_saffirepro = False
# hack for the focusrite devices
# Saffire: 0x130e010001????
# SaffireLE: 0x130e010004????
if modelId == 0x00000000:
if int(GUID, 16) >= 0x130e0100040000:
is_saffirele = True
print "Found SaffireLE GUID"
else:
is_saffirele = False
print "Found Saffire GUID"
# different panel for different clock frequency
selected = samplerateselect.selected()
samplerate = int(samplerateselect.getEnumLabel( selected ))
# adat on PRO26 makes a difference
have_adat = False
if modelId == 0x00000003: # PRO26
is_saffirepro = True
state = hw.getDiscrete('/Control/ADATDisable')
if state:
have_adat = False
print "detected PRO26, ADAT disabled"
else:
have_adat = True
print "detected PRO26, ADAT enabled"
elif modelId == 0x00000006: # PRO10
is_saffirepro = True
suffix = ''
if samplerate <= 48000:
suffix = "Large"
# on the saffire pro 26, the large panel can be used
# at 96k when adat is disabled. pro10 = pro26 w/o ADAT
elif samplerate <= 96000 and is_saffirepro and have_adat:
suffix = "Small"
elif samplerate <= 96000 and is_saffirepro:
suffix = "Large"
# higher samplerates need the small panel
else:
suffix = "Small"
if is_saffirepro:
mixerapp = "SaffireProMixer" + suffix
elif is_saffirele:
mixerapp = "SaffireLEMixer" + suffix
else:
mixerapp = "SaffireMixer"
exec( "mixerwidget = "+mixerapp+"( w )" )
else:
mixerwidget = DummyMixer( w )
mixerapp = modelName+" (Dummy)"
#
# The same for all mixers
#
l.addWidget( mixerwidget, 10 )
mixerwidget.configrom = cfgrom
mixerwidget.clockselect = clockselect
mixerwidget.samplerateselect = samplerateselect
mixerwidget.nickname = nickname
mixerwidget.hw = hw
if 'buildMixer' in dir(mixerwidget):
mixerwidget.buildMixer()
if 'initValues' in dir(mixerwidget):
mixerwidget.initValues()
mixerwidgets.append(mixerwidget)
mw.addTab( w, mixerapp )
#
# Show the generic (development) mixer if it is available
#
if nbDevices > 0 and use_generic:
mw.addTab( GenericMixer( devmgr.bus, server, mw ), "Generic Mixer" )
#
# Only really show the mainwindow and start the mixer when at least on mixer is shown
#
if mw.count() > 0:
puw = PollUpdateWidgets(mixerwidgets)
timer = QTimer(puw)
QObject.connect( timer, SIGNAL('timeout()'), puw.updateWidgets );
timer.start( POLL_SLEEP_TIME_MSEC );
# Adjust size of mixer window to the requirements of the selected device mixer(s)
mw.adjustSize()
mw.show()
QObject.connect(app,SIGNAL("lastWindowClosed()"),app,SLOT("quit()"))
app.exec_loop()