Logo Search packages:      
Sourcecode: kdenlive version File versions  Download package

gentime.cpp
/***************************************************************************
                          time.cpp  -  description
                             -------------------
    begin                : Sat Sep 14 2002
    copyright            : (C) 2002 by Jason Wood
    email                : jasonwood@blueyonder.co.uk
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "gentime.h"

double GenTime::s_delta = 0.00001;

00022 GenTime::GenTime()
{
    m_time = 0.0;
}

00027 GenTime::GenTime(double seconds)
{
    m_time = seconds;
}

00032 GenTime::GenTime(int frames, double framesPerSecond)
{
    m_time = (double) frames / framesPerSecond;
}

00037 double GenTime::seconds() const
{
    return m_time;
}

00042 double GenTime::ms() const
{
    return m_time * 1000;
}

00047 double GenTime::frames(double framesPerSecond) const
{
    return floor(m_time * framesPerSecond + 0.5);
}

00052 GenTime& GenTime::roundNearestFrame(double framesPerSecond)
{
    m_time = floor((m_time * framesPerSecond) + 0.5) / framesPerSecond;
    return *this;
}

Generated by  Doxygen 1.6.0   Back to index