From 1de09c4f69fed0d4adc3d8c1ed19473db4a342b0 Mon Sep 17 00:00:00 2001 From: Tim Redfern Date: Thu, 25 Apr 2013 13:33:05 +0100 Subject: GET styles --- rotord/01-future.xml | 30 ++++++++++++++++++++++++++++++ rotord/01.xml | 22 +++++----------------- rotord/01_thumbnail.jpg | Bin 0 -> 3469 bytes rotord/libavaudioloader.cpp | 2 ++ rotord/rotord.cpp | 30 +++++++++++++++--------------- rotord/rotord.h | 1 + rotord/styles.xml | 9 +++++++++ 7 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 rotord/01-future.xml create mode 100644 rotord/01_thumbnail.jpg create mode 100644 rotord/styles.xml diff --git a/rotord/01-future.xml b/rotord/01-future.xml new file mode 100644 index 0000000..03f3f0b --- /dev/null +++ b/rotord/01-future.xml @@ -0,0 +1,30 @@ + +Off and on template ©Rotor 2013 + beats + + segmenter + + signal divide + signal 1 to divide + amount + 2.0 + + + + red + 0.5 + + green + 0.5 + + blue + 0.5 + + + outputs a single 1 every time signal enters a new number + signal to analyse + + outputs data when changed + signal to output + + diff --git a/rotord/01.xml b/rotord/01.xml index 03f3f0b..0fe762a 100755 --- a/rotord/01.xml +++ b/rotord/01.xml @@ -1,30 +1,18 @@ -Off and on template ©Rotor 2013 +Sample template ©Rotor 2013 beats segmenter signal divide signal 1 to divide - amount - 2.0 - - - - red - 0.5 - - green - 0.5 - - blue - 0.5 - outputs a single 1 every time signal enters a new number signal to analyse - outputs data when changed - signal to output + performance video + + video output + image to output diff --git a/rotord/01_thumbnail.jpg b/rotord/01_thumbnail.jpg new file mode 100644 index 0000000..e44db36 Binary files /dev/null and b/rotord/01_thumbnail.jpg differ diff --git a/rotord/libavaudioloader.cpp b/rotord/libavaudioloader.cpp index b9beabc..c6c1355 100644 --- a/rotord/libavaudioloader.cpp +++ b/rotord/libavaudioloader.cpp @@ -177,9 +177,11 @@ uint16_t* libav::Audioloader::get_samples(int num){ //presumes 16bpc here } //std::cerr<<"filling buffer to "<<((sample_end+frame->nb_samples)*frame->channels)<nb_samples;i++) { for (int j=0;jchannels)+j]= ((uint16_t*) frame->buf[j]->data)[i]; + //buffer[(j*frame->channels)+(sample_end+i)]= ((uint16_t*) frame->buf[j]->data)[i]; ??planar?? nope } } sample_end+=frame->nb_samples; diff --git a/rotord/rotord.cpp b/rotord/rotord.cpp index a919a0b..1a68638 100755 --- a/rotord/rotord.cpp +++ b/rotord/rotord.cpp @@ -169,23 +169,23 @@ HTTPRequestHandler* RotorRequestHandlerFactory::createRequestHandler(const HTTPS //eventually retrieve from sql; //a bit of weirdness here: prefer to just get whole file to a string. if (request.getMethod()=="GET") { - std::vector styles = {"style01.xml","style02.xml" }; //c++11 STL initialiser list - content+="\n"; - for (auto &style: styles) { - Poco::File f=Poco::File(style); + std::string stylesfile = "styles.xml"; + Poco::File f=Poco::File(stylesfile); if (f.exists()) { - Poco::FileInputStream file(style); - string s=""; - while (!file.eof()) { - content +=s; - file >> s; - content +=" "; - } - content +="\n"; + Poco::FileInputStream file(stylesfile); + //while (!file.eof()) { + // file >> content; + //} + Poco::StreamCopier::copyToString(file, content); + status=HTTPResponse::HTTP_OK; } - } - content+="\n"; - status=HTTPResponse::HTTP_OK; + else { + content="Rotor: internal error: styles not found\n"; + } + + } + else { + content="Rotor: bad request\n"; } } else { diff --git a/rotord/rotord.h b/rotord/rotord.h index 7c0dbc3..b53a795 100755 --- a/rotord/rotord.h +++ b/rotord/rotord.h @@ -19,6 +19,7 @@ #include "Poco/Util/OptionSet.h" #include "Poco/Util/HelpFormatter.h" #include "Poco/FileStream.h" +#include "Poco/StreamCopier.h" #include "Poco/Net/HTTPStreamFactory.h" #include diff --git a/rotord/styles.xml b/rotord/styles.xml new file mode 100644 index 0000000..4826567 --- /dev/null +++ b/rotord/styles.xml @@ -0,0 +1,9 @@ + + + -- cgit v1.2.3