|
@@ -15,6 +15,7 @@ namespace bbiwarg.InputProviders
|
|
|
public bool IsPaused { get { return (playStep.Value == 0); } }
|
|
|
|
|
|
private IParameterHandle<int> currentMovieFrame;
|
|
|
+ private IParameterHandle<int> frameCount;
|
|
|
private IParameterHandle<int> playStep;
|
|
|
|
|
|
public VideoInputProvider(String moviePath)
|
|
@@ -35,6 +36,7 @@ namespace bbiwarg.InputProviders
|
|
|
|
|
|
device.RegisterParameterHandle<int>("SOURCE.MOVIE.PlayMode").Value = 1; // 0=once, 1=loop, 2=pingPong
|
|
|
currentMovieFrame = device.RegisterParameterHandle<int>("SOURCE.MOVIE.CurrentFrame");
|
|
|
+ frameCount = device.RegisterParameterHandle<int>("SOURCE.MOVIE.FrameCount");
|
|
|
playStep = device.RegisterParameterHandle<int>("SOURCE.MOVIE.PlayStep");
|
|
|
}
|
|
|
|
|
@@ -53,7 +55,7 @@ namespace bbiwarg.InputProviders
|
|
|
public void nextFrame()
|
|
|
{
|
|
|
playStep.Value = 1;
|
|
|
- int nextFrame = currentMovieFrame.Value + 1;
|
|
|
+ int nextFrame = Math.Min((currentMovieFrame.Value + 1), frameCount.Value - 1);
|
|
|
while (currentMovieFrame.Value != nextFrame)
|
|
|
{
|
|
|
device.UpdateFrame(true);
|
|
@@ -66,7 +68,7 @@ namespace bbiwarg.InputProviders
|
|
|
public void previousFrame()
|
|
|
{
|
|
|
playStep.Value = -1;
|
|
|
- int previousFrame = currentMovieFrame.Value - 1;
|
|
|
+ int previousFrame = Math.Max((currentMovieFrame.Value - 1), 0);
|
|
|
while (currentMovieFrame.Value != previousFrame)
|
|
|
{
|
|
|
device.UpdateFrame(true);
|