summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rotord/01-future.xml30
-rwxr-xr-xrotord/01.xml22
-rw-r--r--rotord/01_thumbnail.jpgbin0 -> 3469 bytes
-rw-r--r--rotord/libavaudioloader.cpp2
-rwxr-xr-xrotord/rotord.cpp30
-rwxr-xr-xrotord/rotord.h1
-rw-r--r--rotord/styles.xml9
7 files changed, 62 insertions, 32 deletions
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 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<patchbay ID="0f7aa258-7c2f-11e2-abbd-133252267708">Off and on template ©Rotor 2013
+ <node ID="01" type="audio_analysis" soname="qm-vamp-plugins" id="qm-tempotracker" output="signal">beats
+ </node>
+ <node ID="02" type="audio_analysis" soname="qm-vamp-plugins" id="qm-segmenter" output="signal">segmenter
+ </node>
+ <node ID="03" type="divide" amount="2.0" output="signal">signal divide
+ <signal_input from="01">signal 1 to divide</signal_input>
+ <signal_input from="02" interface="hslider">amount
+ <interface type="hslider">2.0</interface>
+ </signal_input>
+ </node>
+ <node ID="04" type="colour picker">
+ <signal_input from="01" interface="hslider">red
+ <interface type="hslider">0.5</interface>
+ </signal_input>
+ <signal_input from="02" interface="hslider">green
+ <interface type="hslider">0.5</interface>
+ </signal_input>
+ <signal_input from="03" interface="hslider">blue
+ <interface type="hslider">0.5</interface>
+ </signal_input>
+ </node>
+ <node ID="04" type="bang" output="signal">outputs a single 1 every time signal enters a new number
+ <signal_input from="03">signal to analyse</signal_input>
+ </node>
+ <node ID="05" type="signal_output">outputs data when changed
+ <signal_input from="04">signal to output</signal_input>
+ </node>
+</patchbay>
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 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<patchbay ID="0f7aa258-7c2f-11e2-abbd-133252267708">Off and on template ©Rotor 2013
+<patchbay ID="0f7aa258-7c2f-11e2-abbd-133252267708" >Sample template ©Rotor 2013
<node ID="01" type="audio_analysis" soname="qm-vamp-plugins" id="qm-tempotracker" output="signal">beats
</node>
<node ID="02" type="audio_analysis" soname="qm-vamp-plugins" id="qm-segmenter" output="signal">segmenter
</node>
<node ID="03" type="divide" amount="2.0" output="signal">signal divide
<signal_input from="01">signal 1 to divide</signal_input>
- <signal_input from="02" interface="hslider">amount
- <interface type="hslider">2.0</interface>
- </signal_input>
- </node>
- <node ID="04" type="colour picker">
- <signal_input from="01" interface="hslider">red
- <interface type="hslider">0.5</interface>
- </signal_input>
- <signal_input from="02" interface="hslider">green
- <interface type="hslider">0.5</interface>
- </signal_input>
- <signal_input from="03" interface="hslider">blue
- <interface type="hslider">0.5</interface>
- </signal_input>
</node>
<node ID="04" type="bang" output="signal">outputs a single 1 every time signal enters a new number
<signal_input from="03">signal to analyse</signal_input>
</node>
- <node ID="05" type="signal_output">outputs data when changed
- <signal_input from="04">signal to output</signal_input>
+ <node ID="05" type="video_input">performance video
+ </node>
+ <node ID="06" type="video_output">video output
+ <image_input from="05">image to output</signal_input>
</node>
</patchbay>
diff --git a/rotord/01_thumbnail.jpg b/rotord/01_thumbnail.jpg
new file mode 100644
index 0000000..e44db36
--- /dev/null
+++ b/rotord/01_thumbnail.jpg
Binary files 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)<<std::endl;
+
for (int i=0;i<frame->nb_samples;i++) {
for (int j=0;j<av_frame_get_channels(frame);j++) {
buffer[((sample_end+i)*frame->channels)+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<std::string> styles = {"style01.xml","style02.xml" }; //c++11 STL initialiser list
- content+="<styles>\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+="</styles>\n";
- status=HTTPResponse::HTTP_OK;
+ else {
+ content="<status>Rotor: internal error: styles not found</status>\n";
+ }
+
+ }
+ else {
+ content="<status>Rotor: bad request</status>\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 <iostream>
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 @@
+<styles>
+ <style ID="0f7aa258-7c2f-11e2-abbd-133252267708" thumbnail="01_thumbnail.jpg" style="01.xml">No Offs
+ <info>A quick cutting style that cuts the beat and energy of the tune. We recommend this style for a performance based video, which requires two full track length takes of a singer and/or other members of the act or a single take of another action. A minimum of seven other videos should be uploaded to get the most out of animated zooming overlays.</info>
+ <slot minvideos="1" maxvideos="1" ID="1">This should be a video of a full performance of the song</slot>
+ <slot minvideos="1" maxvideos="1" ID="2">This should be a video of a full performance of the song</slot>
+ <slot minvideos="5" maxvideos="-1" ID="10">These should be a sequence of video cutaways</slot>
+ <slot minvideos="5" maxvideos="-1" ID="11">These should be a sequence of video cutaways</slot>
+ </style>
+</styles>