Skip to content

Commit

Permalink
FEAT(client): add starttalking and stoptalking to the socket rpc inte…
Browse files Browse the repository at this point in the history
…rface

If mumble isn't allowed to listen to all input from an input device, for example when running as wayland client, ptt events can be sent via socket rpc, and, in the case of wayland, the keybinding can be done by the compositor. mumble-voip#3675 implements this for dbus.
To avoid executing the rather large mumble binary to do the rpc, one could also do something like this:
echo '<self><starttalking>starttalking</starttalking></self>' | socat - UNIX-CONNECT:/tmp/MumbleSocket

Implements mumble-voip#1594
  • Loading branch information
cortiv committed Feb 13, 2021
1 parent c748e65 commit d48c8bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mumble/SocketRPC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ void SocketRPCClient::processXml() {
g.mw->qaAudioDeaf->trigger();
}
}
iter = qmRequest.find(QLatin1String("starttalking"));
if (iter != qmRequest.constEnd()) {
g.mw->on_PushToTalk_triggered(true, QVariant());
}
iter = qmRequest.find(QLatin1String("stoptalking"));
if (iter != qmRequest.constEnd()) {
g.mw->on_PushToTalk_triggered(false, QVariant());
}
ack = true;
} else if (request.nodeName() == QLatin1String("url")) {
if (g.sh && g.sh->isRunning() && g.uiSession) {
Expand Down
4 changes: 4 additions & 0 deletions src/mumble/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,10 @@ int main(int argc, char **argv) {
" Undeafen self\n"
" toggledeaf\n"
" Toggle self-deafen status\n"
" starttalking\n"
" Start talking\n"
" stoptalking\n"
" Stop talking\n"
"\n");

QString helpOutput = helpMessage + rpcHelpBanner + rpcHelpMessage;
Expand Down

0 comments on commit d48c8bd

Please sign in to comment.