diff options
| author | Comment <tim@gray.(none)> | 2013-11-07 10:37:07 +0000 |
|---|---|---|
| committer | Comment <tim@gray.(none)> | 2013-11-07 10:37:07 +0000 |
| commit | 40af1e696717c1a287204c35596bd5685771054d (patch) | |
| tree | f8b7a2504a268700592814fc466180b177483e34 /rotord/src | |
| parent | 8790ba996bccce3b77394e2d24e8debc9a21d6dc (diff) | |
refining video bank
Diffstat (limited to 'rotord/src')
| -rw-r--r-- | rotord/src/rotor.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/rotord/src/rotor.h b/rotord/src/rotor.h index ca3e5d2..fee29bc 100644 --- a/rotord/src/rotor.h +++ b/rotord/src/rotor.h @@ -612,8 +612,9 @@ namespace Rotor { } if (attributes["filenames"]->vals.size()){ float ph=inputs[0]->get((Time_spec)frame); - int wv=((int)ph)%attributes["filenames"]->vals.size(); - ph=fmod(ph,wv); + int seg=((int)ph); + int wv=seg%attributes["filenames"]->vals.size(); + ph=fmod(ph,seg); if (clip_loaded!=wv){ if (load(media_path+attributes["filenames"]->vals[wv] )) { clip_loaded=wv; @@ -627,25 +628,27 @@ namespace Rotor { if (isLoaded){ int wanted=0.0f; int thisframe=((Time_spec)frame).frame(); + float clipframerate=(parameters["framerate"]->value==0.0f?player.get_framerate():parameters["framerate"]->value); + float clipspeed=(clipframerate/frame.framerate)*parameters["speed"]->value; switch (attributes["frame_mode"]->intVal){ case VIDEOTIME_play: if(thisframe==lastframe||thisframe==lastframe+1){ - if (segment!=wv){ + if (segment!=seg){ //start of new segment - cerr<<"segment "<<wv<<" started: "<<((Time_spec)frame).time<<endl; - segment=wv; + cerr<<"segment "<<seg<<" started: "<<((Time_spec)frame).time<<endl; + segment=seg; segment_start=((Time_spec)frame).time; } } else { //find segment start Time_spec testframe=(Time_spec)frame.lastframe(); - while ((int)inputs[0]->get(testframe)==wv&&testframe.frame()>0){ + while ((int)inputs[0]->get(testframe)==seg&&testframe.frame()>0){ testframe=testframe.lastframe(); } segment_start=testframe.time; } - wanted=(((Time_spec)frame).time-segment_start)*player.get_framerate(); + wanted=(((Time_spec)frame).time-segment_start)*clipspeed*frame.framerate; lastframe=thisframe; break; case VIDEOTIME_stretch: |
