From e288abf93cc33ce7f6d535e1e5d887e8f9628119 Mon Sep 17 00:00:00 2001 From: Martin Wolf Date: Mon, 15 Feb 2010 13:51:12 +0200 Subject: Added audio command to resourceqt-client example --- resourceqt-client/client.cpp | 35 +++++++++++++++++++++++++++++++++-- 1 file 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 resList) } } -void Client::resourceAcquiredHandler(const QList& grantedResList) +void Client::resourceAcquiredHandler(const QList& /*grantedResList*/) { QList 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(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() ) { -- cgit v1.2.3