summaryrefslogtreecommitdiff
path: root/drivers/theoraplayer/src/TheoraTimer.cpp
blob: 644d1c2ab702242e8e6c3c59db70a86d57697086 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/************************************************************************************
This source file is part of the Theora Video Playback Library
For latest info, see http://libtheoraplayer.googlecode.com
*************************************************************************************
Copyright (c) 2008-2014 Kresimir Spes (kspes@cateia.com)
This program is free software; you can redistribute it and/or modify it under
the terms of the BSD license: http://opensource.org/licenses/BSD-3-Clause
*************************************************************************************/
#include "TheoraTimer.h"

TheoraTimer::TheoraTimer()
{
	mTime = 0;
	mPaused = 0;
    mSpeed = 1.0f;
}

TheoraTimer::~TheoraTimer()
{

}

void TheoraTimer::update(float timeDelta)
{
	if (!isPaused())
	{
		mTime += timeDelta * mSpeed;
	}
}

float TheoraTimer::getTime()
{
	return mTime;
}

void TheoraTimer::pause()
{
	mPaused = true;
}

void TheoraTimer::play()
{
	mPaused = false;
}


bool TheoraTimer::isPaused()
{
	return mPaused;
}

void TheoraTimer::stop()
{

}

void TheoraTimer::seek(float time)
{
	mTime = time;
}

void TheoraTimer::setSpeed(float speed)
{
    mSpeed = speed;
}

float TheoraTimer::getSpeed()
{
    return mSpeed;
}