Project

General

Profile

Feature #1789 ยป replay-index.diff

anbr, 04/06/2014 08:48 AM

View differences:

play.cpp
void Activate(bool); ///< player attached/detached
/// get current replay mode
virtual bool GetReplayMode(bool &, bool &, int &);
/// Returns the current and total frame index
virtual bool GetIndex(int &Current, int &Total, bool SnapToIFrame = false);
};
/**
......
return true;
}
/**
** Returns the current and total frame index.
**
** @Current current postion in frame per seconds
** @Total total length in frame per seconds
** @SnapToIFrame (unused)
*/
bool cMyPlayer::GetIndex(int &Current, int &Total, bool /*SnapToIFrame*/) {
if(PlayerTotal<=0) {
PlayerGetLength();
}
if(PlayerTotal>0) {
PlayerGetCurrentPosition();
if(PlayerCurrent >= 0) {
Current = PlayerCurrent * FramesPerSecond();
Total = PlayerTotal * FramesPerSecond();
return true;
}
}
return false;
}
//////////////////////////////////////////////////////////////////////////////
// cStatus
//////////////////////////////////////////////////////////////////////////////
    (1-1/1)