Home

Download

Features

Screenshots

Handbook

Browse Source

Authors

SourceForge.net Logo
Hosted by SourceForge.net

OSI Certified


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages   Search  

animator.h

00001 /***************************************************************************
00002                           animator.h  -  description
00003                              -------------------
00004     begin                : Sat Mar 29 2003
00005     copyright            : (C) 2003 by Fungmeista
00006     email                : mizunoami44@users.sourceforge.net
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef ANIMATOR_H
00019 #define ANIMATOR_H 
00020  
00021 class QObject;
00022 class QTimer;
00023 
00037 class Animator
00038 {
00039     public:
00040         Animator();
00041         virtual ~Animator();
00042 
00043         virtual void load_key( const char *key, const char *value );
00044 
00046         int setAnimationMin(double);
00047         
00049         int setAnimationMax(double);
00050         
00052         int setAnimationStep(double);
00053         
00055         int setAnimationSpeed(int);
00056         
00058         double getAnimationMin() const{return min;}
00059         
00061         double getAnimationMax() const{return max;}
00062         
00064         double getAnimationStep() const{return step;}
00065         
00067         int getAnimationSpeed() const{return speed;}
00068         
00070         void setAnimationFrame(double n){current = n; nextFrameReady();}
00071         
00075         double animatorValue() const{return current;}
00076 
00078         void play();
00079         
00081         void stop();
00082         
00086         void pause();
00087         
00089         void saveAsMovie();
00090         
00091         inline bool displayAnimatorValue(){ return _displayNValue; }
00092         inline void setDisplayAnimatorValue( bool b ){ _displayNValue = b; }
00093 
00094     protected:
00099         virtual void nextFrameReady() = 0;
00100 
00102         void nextFrame();
00103         
00108         void initializeAnimator( QObject * );
00109         
00110         bool isSaving() const{return _save;}
00111     
00112     private:
00113         double min, max, step, current;
00114         int speed;
00115         QTimer *_timer;
00116         bool _displayNValue, _save;
00117 };
00118 
00119 #endif
00120