diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-09-19 13:25:51 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-09-19 13:25:51 +0100 |
| commit | cb4b17f617e998fb64cf20e13bd05b5f31f240ce (patch) | |
| tree | f9eb2bb15e9d8f207b1512b4da37da7ac991fd52 /rotord/src/rendercontext.cpp | |
| parent | b57c742e2df5c8f495a3b4dbf4a9e56a4aab9f7e (diff) | |
reduce bit rate
Diffstat (limited to 'rotord/src/rendercontext.cpp')
| -rw-r--r-- | rotord/src/rendercontext.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/rotord/src/rendercontext.cpp b/rotord/src/rendercontext.cpp index 718d6ae..39cd8d2 100644 --- a/rotord/src/rendercontext.cpp +++ b/rotord/src/rendercontext.cpp @@ -115,6 +115,25 @@ void Render_context::session_command(const Session_command& command,xmlIO& XML,H } } } + if (command.commands[1]=="bitrate") { + if (command.method=="PUT") { + int b=toInt(command.body); + if (graph.set_bitrate(b)){ + logger.information("bitrate set to "+command.body); + XML.addValue("status","bitrate set to "+command.body); + status=HTTPResponse::HTTP_OK; + } + else { + logger.error("ERROR: Could not set bitrate set to "+command.body); + XML.addValue("error","Could not set bitrate set to "+command.body); + } + } + else { + status=HTTPResponse::HTTP_BAD_REQUEST; + logger.error("ERROR: Bad request"); + XML.addValue("error","Bad request"); + } + } if (command.commands[1]=="audio") { if (command.method=="PUT") { //get audio file location and initiate analysis if (command.body!="") { |
