summaryrefslogtreecommitdiff
path: root/resourceqt-client
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-10-05 14:54:01 +0300
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-10-05 14:54:01 +0300
commit74c3aa649202a19dac0b24d3bb899cf317f9e9a2 (patch)
tree532d234fce76f44182012dc136d89a7cb58b5f57 /resourceqt-client
parentc57377b51b7b257432484cbfe80beca6d684127d (diff)
downloadlibresourceqt-74c3aa649202a19dac0b24d3bb899cf317f9e9a2.tar.gz
Added timing for the addaudio command
Diffstat (limited to 'resourceqt-client')
-rw-r--r--resourceqt-client/client.cpp14
-rw-r--r--resourceqt-client/client.h2
2 files changed, 11 insertions, 5 deletions
diff --git a/resourceqt-client/client.cpp b/resourceqt-client/client.cpp
index 2fa583a..1b92d67 100644
--- a/resourceqt-client/client.cpp
+++ b/resourceqt-client/client.cpp
@@ -51,10 +51,9 @@ CommandListArgs::~CommandListArgs()
}
Client::Client()
- : QObject(), standardInput(stdin, QIODevice::ReadOnly), stdInNotifier(0, QSocketNotifier::Read), applicationClass(),
+ : QObject(), standardInput(stdin, QIODevice::ReadOnly), stdInNotifier(0, QSocketNotifier::Read), pendingAddAudio(false), applicationClass(),
resourceSet(NULL), output(stdout)
{
- mainTimerID = startTimer(0);
commandList["help"] = CommandListArgs("", "print this help message");
commandList["quit"] = CommandListArgs("", "exit application");
commandList["free"] = CommandListArgs("", "destroy and free the resources");
@@ -71,8 +70,6 @@ Client::Client()
Client::~Client()
{
- killTimer(mainTimerID);
-
delete resourceSet;
}
@@ -263,6 +260,13 @@ void Client::resourceReleasedHandler()
void Client::resourcesBecameAvailableHandler(const QList<ResourcePolicy::ResourceType> &availableResources)
{
+ if (pendingAddAudio) {
+ pendingAddAudio = false;
+ long int ms = stop_timer();
+ if (ms > 0) {
+ outputln << "Operation took " << ms << "ms" << endl;
+ }
+ }
outputln << "advice:" << availableResources << endl;
showPrompt();
}
@@ -445,6 +449,8 @@ void Client::readLine(int)
else {
audioResource->setProcessID(pid);
audioResource->setStreamTag(tagName, tagValue);
+ pendingAddAudio = true;
+ start_timer();
resourceSet->addResourceObject(audioResource);
}
}
diff --git a/resourceqt-client/client.h b/resourceqt-client/client.h
index a3e0012..c22475d 100644
--- a/resourceqt-client/client.h
+++ b/resourceqt-client/client.h
@@ -66,7 +66,7 @@ private slots:
private:
QTextStream standardInput;
QSocketNotifier stdInNotifier;
- int mainTimerID;
+ bool pendingAddAudio;
QString applicationClass;
ResourcePolicy::ResourceSet *resourceSet;
QTextStream output;