summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Wolf <ext-martin.2.wolf@nokia.com>2010-02-15 13:51:12 +0200
committerMartin Wolf <ext-martin.2.wolf@nokia.com>2010-02-15 13:51:12 +0200
commite288abf93cc33ce7f6d535e1e5d887e8f9628119 (patch)
tree5a2ad8933d1a8ce819b2d86ef7e0c16d8a9cee97
parentabb51ffa0565eb589dc74ca39a8396f865d8fbdc (diff)
downloadlibresourceqt-e288abf93cc33ce7f6d535e1e5d887e8f9628119.tar.gz
Added audio command to resourceqt-client example
-rw-r--r--resourceqt-client/client.cpp35
1 files changed, 33 insertions, 2 deletions
diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp
index 539f5b0..a276e88 100644
--- a/resourceqt-client/client.cpp
+++ b/resourceqt-client/client.cpp
@@ -323,7 +323,7 @@ void Client::showResources(const QList<Resource*> resList)
}
}
-void Client::resourceAcquiredHandler(const QList<ResourceType>& grantedResList)
+void Client::resourceAcquiredHandler(const QList<ResourceType>& /*grantedResList*/)
{
QList<Resource*> list = resourceSet->resources();
if( !list.count() )
@@ -476,7 +476,38 @@ void Client::timerEvent(QTimerEvent*)
}
else if( params[0] == "audio" )
{
- printf("Not yet implemented!\n");
+ if( params.count() < 3 )
+ {
+ printf("Not enough parameters! See help!\n");
+ }
+ else
+ {
+ AudioResource* p = reinterpret_cast<AudioResource*>(resourceSet->resource(AudioPlaybackType));
+ if( p == NULL )
+ {
+ printf("No AudioResource available in set!\n");
+ }
+ else
+ {
+ p->setAudioGroup(params[1]);
+
+ bool ok;
+ quint32 pid = (quint32)params[2].toInt(&ok, 10);
+ if( ok && pid != 0 )
+ {
+ p->setProcessID(pid);
+ }
+ else
+ {
+ printf("Ignoring pid parameter!\n");
+ }
+
+ if( params.count() > 3 )
+ {
+ p->setStreamTag(params[3]);
+ }
+ }
+ }
}
else if( !params[0].isEmpty() )
{