Frame counting based on a given FrameRange. More...
#include <Media/FrameCounter.H>
Public Member Functions | |
FrameCounter (const FrameRange &rng, bool w=false) | |
Default constructor (first=last=0, delay=0.0). | |
void | reset (const FrameRange &rng, bool update_start_time, bool w=false) |
Reset frame and time counters. | |
int | currentFrame () const |
Get the current frame number. | |
void | setStartTime (const SimTime &t) |
Set the time at which we start incrementing frames. | |
FrameState | update (const SimTime &stime, const bool new_event=false) |
Update our frame counter for the given simtime and new-event status. | |
FrameState | updateNext () |
Just increment the frame counter by one. | |
bool | setCurrent (int n) |
Try to force the counter to the given value. |
Frame counting based on a given FrameRange.
Definition at line 47 of file FrameCounter.H.
FrameCounter::FrameCounter | ( | const FrameRange & | rng, | |
bool | w = false | |||
) | [inline] |
Default constructor (first=last=0, delay=0.0).
Definition at line 51 of file FrameCounter.H.
int FrameCounter::currentFrame | ( | ) | const [inline] |
Get the current frame number.
Definition at line 75 of file FrameCounter.H.
Referenced by OutputFrameSeries::frame(), InputFrameSeries::frame(), InputFrameSeries::peekFrameSpec(), InputFrameSeries::update(), OutputFrameSeries::update(), and OutputFrameSeries::writeFrame().
void FrameCounter::reset | ( | const FrameRange & | rng, | |
bool | update_start_time, | |||
bool | w = false | |||
) | [inline] |
Reset frame and time counters.
Definition at line 60 of file FrameCounter.H.
References ASSERT, and setStartTime().
Referenced by OutputFrameSeries::paramChanged(), InputFrameSeries::paramChanged(), InputFrameSeries::reset1(), and OutputFrameSeries::reset1().
bool FrameCounter::setCurrent | ( | int | n | ) |
Try to force the counter to the given value.
If the given value is outside of the frame range, return false.
Definition at line 136 of file FrameCounter.C.
void FrameCounter::setStartTime | ( | const SimTime & | t | ) | [inline] |
Set the time at which we start incrementing frames.
Definition at line 84 of file FrameCounter.H.
Referenced by reset().
FrameState FrameCounter::update | ( | const SimTime & | stime, | |
const bool | new_event = false | |||
) | [inline] |
Update our frame counter for the given simtime and new-event status.
If we are in event-triggered mode, then the counter is advanced if new_event is true; if we are NOT in event-triggered mode, then the counter is advanced if sufficient time has passed since our previous frame.
Definition at line 91 of file FrameCounter.H.
Referenced by InputFrameSeries::update(), and OutputFrameSeries::update().
FrameState FrameCounter::updateNext | ( | ) |
Just increment the frame counter by one.
Definition at line 44 of file FrameCounter.C.
Referenced by InputFrameSeries::updateNext(), and OutputFrameSeries::updateNext().