diff options
-rw-r--r-- | libresourceqt/Doxyfile | 2 | ||||
-rw-r--r-- | libresourceqt/include/qt4/policy/audio-resource.h | 9 | ||||
-rw-r--r-- | resourceqt-client/client.cpp | 14 | ||||
-rw-r--r-- | resourceqt-client/client.h | 2 |
4 files changed, 21 insertions, 6 deletions
diff --git a/libresourceqt/Doxyfile b/libresourceqt/Doxyfile index 3918664..f493c9a 100644 --- a/libresourceqt/Doxyfile +++ b/libresourceqt/Doxyfile @@ -31,7 +31,7 @@ PROJECT_NAME = ResourcePolicy # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 1.17 +PROJECT_NUMBER = 1.21 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. diff --git a/libresourceqt/include/qt4/policy/audio-resource.h b/libresourceqt/include/qt4/policy/audio-resource.h index 27ffac6..87f215f 100644 --- a/libresourceqt/include/qt4/policy/audio-resource.h +++ b/libresourceqt/include/qt4/policy/audio-resource.h @@ -87,6 +87,15 @@ private: QString streamName; QString streamValue; signals: + /** + * This signal is emitted when any of the properties of the AudioResource + * are changed. This signal is connected to in the ResourceSet to + * track the changes to the AudioResource object. + * \param group The new audio group + * \param pit The new PID of the audio renderer + * \param name The new Stream tag name + * \param value the new stream tag value + */ void audioPropertiesChanged(const QString &group, quint32 pid, const QString &name, const QString &value); }; 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; |