Initial check-in of OpenShot Library

This commit is contained in:
Jonathan Thomas
2011-10-11 08:44:27 -05:00
commit 161e8923af
66 changed files with 12842 additions and 0 deletions

29
src/FrameRate.cpp Normal file
View File

@@ -0,0 +1,29 @@
/**
* \file
* \brief Source code for the FrameRate class
* \author Copyright (c) 2011 Jonathan Thomas
*/
#include "../include/FrameRate.h"
using namespace openshot;
Framerate::Framerate(int numerator, int denominator) {
m_numerator = numerator;
m_denominator = denominator;
}
Framerate::Framerate() {
m_numerator = 24;
m_denominator = 1;
}
// Return a rounded integer of the frame rate (for example 30000/1001 returns 30 fps)
int Framerate::GetRoundedFPS() {
return round((float) m_numerator / m_denominator);
}
// Return a float of the frame rate (for example 30000/1001 returns 29.97...)
float Framerate::GetFPS() {
return (float) m_numerator / m_denominator;
}