summaryrefslogtreecommitdiff
path: root/rotord/src/rotor.h
diff options
context:
space:
mode:
Diffstat (limited to 'rotord/src/rotor.h')
-rw-r--r--rotord/src/rotor.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h
index 605ee44..9d621e2 100644
--- a/rotord/src/rotor.h
+++ b/rotord/src/rotor.h
@@ -467,7 +467,7 @@ namespace Rotor {
segment_end=((Time_spec)testframe).time;
cerr<<"Video_cycler: segment "<<seg<<" start: "<<segment_start<<" end: "<<segment_end<<endl;
-
+
}
}
lastframe=thisframe;
@@ -477,7 +477,7 @@ namespace Rotor {
float in_time=(((Time_spec)frame).time-segment_start);
//time in seconds for the incoming sequence: starts at 0
float out_time=(((Time_spec)frame).time-prevseg_start);
- //time in seconds for the outgoing sequence:
+ //time in seconds for the outgoing sequence:
//starts at how many seconds the outgoing has got to
//so we need the previous segmente duration
@@ -500,14 +500,14 @@ namespace Rotor {
//we don't want to mix from this input to the next
//we want to mix out the previous segment whose start time was the previous segment (or the end one)
//awkward, its getting close to the point where we just need access to all of the segments data everywhere?
- //we have 2 times here
+ //we have 2 times here
if (attributes["mode"]->intVal==CYCLER_mix&&image_inputs.size()>1){
int im1=seg%image_inputs.size();
int im2=prevseg%image_inputs.size();
- float f;
-
+ float f;
+
switch (attributes["length_mode"]->intVal){
case CYCLER_seconds:
f=min(1.0f,in_time/parameters["transition_length"]->value);
@@ -516,12 +516,12 @@ namespace Rotor {
f=min(1.0f,(in_time/(segment_end-segment_start))/parameters["transition_length"]->value);
break;
}
-
+
Image *in1=image_inputs[im1]->get(attributes["time_mode"]->intVal==CYCLER_abs?frame:inframe);
if (in1){
if (f<1.0f) {
- Image *in2=image_inputs[im2]->get(outframe);
+ Image *in2=image_inputs[im2]->get(attributes["time_mode"]->intVal==CYCLER_abs?frame:outframe);
if (in2){
image=(*in1);
image*=f;
@@ -663,6 +663,7 @@ namespace Rotor {
libav::video_decoder player;
int lastframe;
bool isLoaded;
+ string media_path;
};
//relative timelines used to stretch video
//1. make a video position input for video node - seconds and stretch modes
@@ -672,23 +673,24 @@ namespace Rotor {
Video_loader(){
create_attribute("filename","name of video file to load","File name","");
create_attribute("media_id","media_id","media_id","media_id"); //for rotorW
- create_attribute("media_path","media_path","media_path","media_path"); //for rotorW
+ //create_attribute("media_path","media_path","media_path","media_path"); //for rotorW? NO
title="Video loader";
description="Loads a video file";
UID="5b64b8ca-2d0a-11e3-92ed-4b7420b40040";
};
Video_loader(map<string,string> &settings): Video_loader() {
base_settings(settings);
- for (auto a:attributes) cerr<<"Video loader: "<<a.first<<" set to "<<a.second->value<<endl;
+ media_path=find_setting(settings,"media_path","");
+ //for (auto a:attributes) cerr<<"Video loader: "<<a.first<<" set to "<<a.second->value<<endl;
if (attributes["filename"]->value!="") {
- isLoaded=load(find_setting(settings,"media_path","")+attributes["filename"]->value);
+ isLoaded=load(media_path+attributes["filename"]->value);
}
};
~Video_loader(){};
void init_attribute(const string &attr){
if (attr=="filename") {
- isLoaded=load(attributes["media_path"]->value+attributes[attr]->value);
+ isLoaded=load(media_path+attributes[attr]->value);
}
};
Video_loader* clone(map<string,string> &_settings) { return new Video_loader(_settings);};
@@ -799,7 +801,6 @@ namespace Rotor {
};
private:
int clip_loaded;
- string media_path;
float segment_start;
int segment;
int lastframe;