Added code to print the total recorded time during movie capture.

ver1_5_1
Chris Laurel 2002-03-08 19:36:50 +00:00
parent dd8ad6c445
commit a062398701
4 changed files with 17 additions and 0 deletions

View File

@ -228,3 +228,8 @@ float AVICapture::getFrameRate() const
{
return frameRate;
}
int AVICapture::getFrameCount() const
{
return frameCounter;
}

View File

@ -28,6 +28,7 @@ class AVICapture : public MovieCapture
int getWidth() const;
int getHeight() const;
float getFrameRate() const;
int getFrameCount() const;
private:
void cleanup();

View File

@ -1350,6 +1350,16 @@ void CelestiaCore::renderOverlay()
glPopMatrix();
glPushMatrix();
glTranslatef((width + movieWidth) / 2 - emWidth * 5,
(height + movieHeight) / 2 + 2, 0);
float sec = movieCapture->getFrameCount() /
movieCapture->getFrameRate();
int min = (int) (sec / 60);
sec -= min * 60.0f;
overlay->printf("%3d:%05.2f", min, sec);
glPopMatrix();
glPushMatrix();
glTranslatef((width - movieWidth) / 2,
(height - movieHeight) / 2 - fontHeight - 2, 0);

View File

@ -25,6 +25,7 @@ class MovieCapture
virtual bool end() = 0;
virtual bool captureFrame() = 0;
virtual int getFrameCount() const = 0;
virtual int getWidth() const = 0;
virtual int getHeight() const = 0;
virtual float getFrameRate() const = 0;