diff options
| author | Tim Redfern <tim@herge.(none)> | 2013-02-27 12:00:18 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@herge.(none)> | 2013-02-27 12:00:18 +0000 |
| commit | 06c11d8aa29e3a097c3ceb076b7d78f1c28a974f (patch) | |
| tree | 4933733ecc298cde884d703e40d726f8a6be8adb | |
| parent | 6921d2df9e60525d6e0ddb9452f6eea5845b670c (diff) | |
parsing work packet
| -rwxr-xr-x | httptest.py | 11 | ||||
| -rwxr-xr-x | rotord/rotor.h | 16 | ||||
| -rwxr-xr-x | rotord/rotord.cpp | 29 |
3 files changed, 34 insertions, 22 deletions
diff --git a/httptest.py b/httptest.py deleted file mode 100755 index a368fe4..0000000 --- a/httptest.py +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/python -import httplib -import argparse -parser = argparse.ArgumentParser() -parser.add_argument("method",default="GET",nargs='?') -parser.add_argument("path",default="/",nargs='?') -parser.add_argument("body",default="body",nargs='?') -args=parser.parse_args() -connection = httplib.HTTPConnection('127.0.0.1:9000') -connection.request(args.method, args.path, args.body) -print connection.getresponse().read() diff --git a/rotord/rotor.h b/rotord/rotor.h index 4961b98..594465d 100755 --- a/rotord/rotor.h +++ b/rotord/rotor.h @@ -135,6 +135,22 @@ namespace Rotor { work_queue.push_back(item); mutex.unlock(); } + std::string session_command(const std::vector<std::string>& command){ + string response; + mutex.lock(); + if (command[1]=="audio") { + if (command[0]=="PUT") { + //get audio file location and initiate analysis + if (command.size()>1) { + //pass message to task + work_queue.push_back(command[2]); + response="<status>1</status>\n"; + } + } + } + mutex.unlock(); + return response; + } Render_status get_status(); void cancel(); //interrupt locking process int make_preview(int nodeID, float time); //starts a frame preview - returns status code - how to retrieve? diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index 22e2e9f..c4103e3 100755 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -197,19 +197,26 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS //could have a seperate mutex for the graph //all the get methods want to get something from the render context and express it in xml. //what is the best way... - if (command[1]=="audio") { - if (request.getMethod()=="PUT") { - //get audio file location and initiate analysis - 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"; - } + //should the processing be done inside the render context - I think so + + //++++ processing inside object + //---- processing occurring in different places + + //the idea of command queueing won't work + + std::string s; + std::ostringstream os; + os<<request.stream().rdbuf(); + s=os.str(); + + vector<string> sc; + sc.push_back(request.getMethod()); + for (auto& i: command){ + sc.push_back(i); } + sc.push_back(s); + content=((Poco::AutoPtr<Rotor::Render_context>)task)->session_command(command); } } } |
