Rough PGN save support.
[tagua/yd.git] / src / mainanimation.h
bloba56d3970adf39fb98b75713230d532e48085f286
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef MAINANIMATION_H
12 #define MAINANIMATION_H
14 #include <QObject>
15 #include <QTime>
16 #include <QTimer>
17 #include "animation.h"
18 #include <boost/shared_ptr.hpp>
20 /**
21 * @a MainAnimation is a persistent animation used to activate
22 * all chessboard animations.
24 class MainAnimation : public QObject, protected AnimationGroup {
25 Q_OBJECT
26 QTime m_time;
27 QTimer m_timer;
28 int m_translate;
29 double m_speed;
30 int m_delay;
31 public:
32 MainAnimation(double speed = 1.0);
34 /**
35 * Activate the animation @a a.
37 void addAnimation(const boost::shared_ptr<Animation>& a);
39 /**
40 * Stop all animations.
42 void stop();
44 /**
45 * Sets the overall speed factor (default is 1.0).
46 * This function is implemented to avoid time gaps.
48 void setSpeed(double speed);
50 /**
51 * Sets the frame delay.
53 void setDelay(int delay);
55 /**
56 * Return a global MasterAnimation, i.e. not tied to a particular board.
58 static MainAnimation& global();
59 protected Q_SLOTS:
60 void tick();
63 #endif // MAINANIMATION_H