Removed jump to frame, length and frame methods from Movie, modified Frame example accordingly.

This commit is contained in:
codeanticode
2011-10-18 00:04:48 +00:00
parent 6c7278d952
commit fdc29f6e5e
2 changed files with 38 additions and 49 deletions

View File

@@ -294,25 +294,6 @@ public class Movie extends PImage implements PConstants {
return sec + Video.nanoSecToSecFrac(nanosec);
}
/**
* Get the full length of this movie (in frames).
*
* @return float
*/
public long length() {
return (int)(duration() * getSourceFrameRate());
}
/**
* Return the current frame.
*
* @return int
*/
public int frame() {
double sec = gplayer.queryPosition().toSeconds() + gplayer.queryPosition().getNanoSeconds() * 1E-9;
return (int)(Math.ceil(sec * getSourceFrameRate())) - 1;
}
/**
* ( begin auto-generated from Movie_jump.xml )
*
@@ -349,30 +330,7 @@ public class Movie extends PImage implements PConstants {
gplayer.getState();
seeking = false;
}
/**
* Jump to a specific frame.
*
* @param frame ???
*/
public void jump(int frame) {
float srcFramerate = getSourceFrameRate();
// The duration of a single frame:
float frameDuration = 1.0f / srcFramerate;
// We move to the middle of the frame by adding 0.5:
float where = (frame + 0.5f) * frameDuration;
// Taking into account border effects:
float diff = duration() - where;
if (diff < 0) {
where += diff - 0.25f * frameDuration;
}
jump(where);
}
/**
* Returns true if the stream is already producing frames.
*