summaryrefslogtreecommitdiff
path: root/rotord/rotord.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@herge.(none)>2013-02-26 18:21:12 +0000
committerTim Redfern <tim@herge.(none)>2013-02-26 18:21:12 +0000
commit77c22b76a19793f36377ca10d7137522720548e4 (patch)
treeb85570be6af37b8de5b574078c50a2fb8e734c4a /rotord/rotord.cpp
parentc0758ba28eb13c198551e3a18d37d8582e76e02d (diff)
thread messaging
Diffstat (limited to 'rotord/rotord.cpp')
-rwxr-xr-xrotord/rotord.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp
index fc74801..6ea61df 100755
--- a/rotord/rotord.cpp
+++ b/rotord/rotord.cpp
@@ -188,12 +188,21 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS
}
}
else {
- if (command[0]=="audio") {
+ //in a way the rest of this stuff happens inside the thread
+ //its not elegant to decipher the message just to assemble another message to decipher elsewhere!
+ //pass a message object with the command type and contents selected?
+ //every action will have a seperate work function in the render_context
+ //some of these functions have to return data immediately- maybe a queue isn't the ideal model
+ if (command[1]=="audio") {
if (request.getMethod()=="PUT") {
//get audio file location and initiate analysis
- stringstream str;
- str << request.stream();
- //content << str;
+ std::string s;
+ std::ostringstream os;
+ os<<request.stream().rdbuf();
+ s=os.str();
+ //pass message to task
+ ((Poco::AutoPtr<Rotor::Render_context>)task)->add_queue(s);
+ content="<status>1</status>\n";
}
}