jack/jack-1.9.8-signal-device-error-via-dbus.patch

62 lines
2.0 KiB
Diff
Raw Normal View History

From 983421cbdc41dd5b2006155c4108d042df15bc57 Mon Sep 17 00:00:00 2001
From: Robin Gareus <robin@gareus.org>
Date: Sun, 20 Feb 2011 14:50:06 +0100
Subject: [PATCH 3/3] signal device-error via dbus
* qNd: send org.jackaudio.JackControl.DeviceError
on audio-device-disconnect/error
---
common/JackAudioDriver.cpp | 13 ++++++++++++-
dbus/controller_iface_control.c | 4 ++++
2 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/common/JackAudioDriver.cpp b/common/JackAudioDriver.cpp
index 9748b46..783ce98 100644
--- a/common/JackAudioDriver.cpp
+++ b/common/JackAudioDriver.cpp
@@ -203,7 +203,18 @@ int JackAudioDriver::ProcessNull()
int JackAudioDriver::Process()
{
- return (fEngineControl->fSyncMode) ? ProcessSync() : ProcessAsync();
+ int rv = (fEngineControl->fSyncMode) ? ProcessSync() : ProcessAsync();
+ if (rv) {
+#if defined(JACK_DBUS)
+ jack_error("Process returned %i -> send dbus signal\n", rv);
+ /* send dbus notification
+ * note: this is a realtime-thread in libjackserver
+ * TODO: Notify jackdbus to send the message.
+ */
+ system("dbus-send --session /org/jackaudio/Controller org.jackaudio.JackControl.DeviceError"); // XXX quick'n'dirty
+#endif
+ }
+ return rv;
}
/*
diff --git a/dbus/controller_iface_control.c b/dbus/controller_iface_control.c
index 22cd398..66fb801 100644
--- a/dbus/controller_iface_control.c
+++ b/dbus/controller_iface_control.c
@@ -395,6 +395,9 @@ JACK_DBUS_METHODS_BEGIN
JACK_DBUS_METHOD_DESCRIBE(RemoveSlave, NULL)
JACK_DBUS_METHODS_END
+JACK_DBUS_SIGNAL_ARGUMENTS_BEGIN(DeviceError)
+JACK_DBUS_SIGNAL_ARGUMENTS_END
+
JACK_DBUS_SIGNAL_ARGUMENTS_BEGIN(ServerStarted)
JACK_DBUS_SIGNAL_ARGUMENTS_END
@@ -402,6 +405,7 @@ JACK_DBUS_SIGNAL_ARGUMENTS_BEGIN(ServerStopped)
JACK_DBUS_SIGNAL_ARGUMENTS_END
JACK_DBUS_SIGNALS_BEGIN
+ JACK_DBUS_SIGNAL_DESCRIBE(DeviceError)
JACK_DBUS_SIGNAL_DESCRIBE(ServerStarted)
JACK_DBUS_SIGNAL_DESCRIBE(ServerStopped)
JACK_DBUS_SIGNALS_END
--
1.7.2.3