File indexing completed on 2024-04-14 04:00:25

0001 /*
0002     SPDX-FileCopyrightText: 2007 Paolo Capriotti <p.capriotti@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef ANIMATOR_H
0008 #define ANIMATOR_H
0009 
0010 #include <QTimer>
0011 #include <QElapsedTimer>
0012 
0013 class AnimationGroup;
0014 class Animation;
0015 
0016 class Animator : public QObject
0017 {
0018 Q_OBJECT
0019     AnimationGroup* m_group;
0020     QTimer m_timer;
0021     QElapsedTimer m_time;
0022     
0023     static Animator* m_instance;
0024     Animator();
0025 public:
0026     static Animator* instance();
0027     
0028     ~Animator() override;
0029     void add(Animation*);
0030     
0031     void start();
0032     void stop();
0033     void restart();
0034 private Q_SLOTS:
0035     void tick();
0036 };
0037 
0038 #endif // ANIMATOR_H
0039