From 053f57745ac8e6848e3ae6060162bddebb36bcef Mon Sep 17 00:00:00 2001 From: Comment Date: Tue, 12 Nov 2013 19:38:23 +0000 Subject: video bank loader fix --- rotord/src/rotor.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'rotord') 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 "<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 &settings): Video_loader() { base_settings(settings); - for (auto a:attributes) cerr<<"Video loader: "<value<value<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 &_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; -- cgit v1.2.3