diff options
| author | Lennart Poettering <lennart@poettering.net> | 2009-11-23 05:45:33 +0100 | 
|---|---|---|
| committer | Lennart Poettering <lennart@poettering.net> | 2009-11-23 05:45:33 +0100 | 
| commit | 0fcdc3d15d759e576ba3d71cc874c1036dcd36a0 (patch) | |
| tree | 5805a0dfc83aa8306a16f0b96f49530aa46c8765 | |
| parent | 675957b9e41d5a92d8cbff3d4fcbcec4965806da (diff) | |
| parent | c815441ba19e92f88395de8763df4a1e57950f7b (diff) | |
Merge branch 'master' of ssh://rootserver/home/lennart/git/public/pulseaudio
| -rw-r--r-- | src/Makefile.am | 1 | ||||
| -rwxr-xr-x | src/utils/qpaeq (renamed from src/utils/qpaeq.py) | 38 | 
2 files changed, 27 insertions, 12 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 5db6b39c..3be28692 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1185,6 +1185,7 @@ endif  if HAVE_FFTW  modlibexec_LTLIBRARIES += \  		module-equalizer-sink.la +bin_SCRIPTS += utils/qpaeq  endif  # These are generated by an M4 script diff --git a/src/utils/qpaeq.py b/src/utils/qpaeq index dca0701d..a8a9fda8 100755 --- a/src/utils/qpaeq.py +++ b/src/utils/qpaeq @@ -17,12 +17,20 @@  import os,math,sys -import PyQt4,sip -from PyQt4 import QtGui,QtCore -from functools import partial +try: +    import PyQt4,sip +    from PyQt4 import QtGui,QtCore +    import dbus.mainloop.qt +    import dbus +except ImportError,e: +    print 'There was an error importing need libraries' +    print 'Make sure you haveqt4 and dbus forthon installed' +    print 'The error that occured was' +    print '\t%s' %(str(e)) +    import sys +    sys.exit(-1) -import dbus.mainloop.qt -import dbus +from functools import partial  import signal  signal.signal(signal.SIGINT, signal.SIG_DFL) @@ -31,13 +39,19 @@ SYNC_TIMEOUT = 4*1000  CORE_PATH = "/org/pulseaudio/core1"  CORE_IFACE = "org.PulseAudio.Core1"  def connect(): -    if 'PULSE_DBUS_SERVER' in os.environ: -        address = os.environ['PULSE_DBUS_SERVER'] -    else: -        bus = dbus.SessionBus() # Should be UserBus, but D-Bus doesn't implement that yet. -        server_lookup = bus.get_object('org.PulseAudio1', '/org/pulseaudio/server_lookup1') -        address = server_lookup.Get('org.PulseAudio.ServerLookup1', 'Address', dbus_interface='org.freedesktop.DBus.Properties') -    return dbus.connection.Connection(address) +    try: +        if 'PULSE_DBUS_SERVER' in os.environ: +            address = os.environ['PULSE_DBUS_SERVER'] +        else: +            bus = dbus.SessionBus() # Should be UserBus, but D-Bus doesn't implement that yet. +            server_lookup = bus.get_object('org.PulseAudio1', '/org/pulseaudio/server_lookup1') +            address = server_lookup.Get('org.PulseAudio.ServerLookup1', 'Address', dbus_interface='org.freedesktop.DBus.Properties') +        return dbus.connection.Connection(address) +    except Exception,e: +        print 'There was an error connecting to pulseaudio, please make sure you have the pulseaudio dbus' +        print 'and equalizer modules loaded, exiting...' +        import sys +        sys.exit(-1)  #TODO: signals: sink Filter changed, sink reconfigured (window size) (sink iface)  | 
