summaryrefslogtreecommitdiff
path: root/resourceqt-client
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-03-25 13:21:04 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-03-25 13:21:04 +0200
commit77b9a734387dcddea4097a61e1cd19fcd60bd452 (patch)
tree6a37d69514b0ed2fff763c7760ac5c8ae3b493d7 /resourceqt-client
parent6edecafaa7e81a625bc799d1513790af456ea302 (diff)
Changed so that audio information is sent as soon as it is set.
Diffstat (limited to 'resourceqt-client')
-rw-r--r--resourceqt-client/client.cpp26
1 files changed, 25 insertions, 1 deletions
diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp
index 968810e..078e6e4 100644
--- a/resourceqt-client/client.cpp
+++ b/resourceqt-client/client.cpp
@@ -356,7 +356,8 @@ void Client::timerEvent(QTimerEvent*)
printf("\t update\tupdate modified resource set after add or remove command\n");
printf("\t add reslist [-o]\tadd reosurce list, if -o provided, set as optional\n");
printf("\t remove reslist [-o]\tremove reosurce list, if -o provided, removed only optional flag\n");
- printf("\t audio pid <pid> | group <audio group> | tag <name> <value>\tset audio properties");
+ printf("\t audio pid <pid> | group <audio group> | tag <name> <value>\tset audio properties\n");
+ printf("\t addaudio <audio group> <pid> <tag name> <tag value>\n");
printf("\t show \tshow resources\n");
}
else if (params[0] == "show") {
@@ -463,6 +464,29 @@ void Client::timerEvent(QTimerEvent*)
}
}
}
+ else if (params[0] == "addaudio") {
+ if (params.count() < 5) {
+ printf("Not enough parameters! See help!\n");
+ }
+ else {
+ AudioResource *audioResource = new AudioResource(params[1]);
+ if (audioResource == NULL) {
+ printf("Failed to create an AudioResource object!\n");
+ }
+ else {
+ bool ok=false;
+ quint32 pid = (quint32)params[2].toInt(&ok, 10);
+ if (ok && pid != 0) {
+ audioResource->setProcessID(pid);
+ }
+ else {
+ printf("Bad pid parameter!\n");
+ }
+ audioResource->setStreamTag(params[3], params[4]);
+ resourceSet->addResourceObject(audioResource);
+ }
+ }
+ }
else if (!params[0].isEmpty()) {
QByteArray ba = line.toLatin1();
const char *c_line = ba.data();