Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

animationmodel.h

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Bjoern Erik Nilsen & Fredrik Berg Kjoelstad     *
00003  *   bjoern_erik_nilsen@hotmail.com & fredrikbk@hotmail.com                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef ANIMATIONMODEL_H
00021 #define ANIMATIONMODEL_H
00022 
00023 #include "src/config.h"
00024 #include "src/presentation/observer.h"
00025 #include "src/presentation/frontends/frontend.h"
00026 #include "src/technical/video/videoencoder.h"
00027 #include "frame.h"
00028 
00029 #include <cstring>
00030 #include <vector>
00031 
00032 using namespace std;
00033 
00043 class AnimationModel
00044 {
00045 public:
00046         AnimationModel();
00047         virtual ~AnimationModel();
00048 
00054         void attatch(Observer *o);
00055         
00061         void detatch(Observer *o);
00062         
00068         void registerFrontend(Frontend *frontend);
00069         
00074         Frontend* getFrontend();
00075         
00081         void notifyAdd(const vector<char*>& frames, unsigned int index);
00082         
00088         void notifyRemove(unsigned int fromFrame, unsigned int toFrame);
00089         
00096         void notifyMove(unsigned int fromFrame, unsigned int toFrame, unsigned int movePosition);
00097         
00102         void notifyNewActiveFrame(int frameNumber);
00103         
00107         void notifyClear();
00108         
00113         void notifyPlayFrame(int frameNumber);
00114                 
00119         void notifyNewScene(int index);
00120         
00125         void notifyRemoveScene(int sceneNumber);
00126         
00132         void notifyMoveScene(int sceneNumber, int movePosition);
00133         
00140         void notifyNewActiveScene(int sceneNumber, vector<char*> framePaths, 
00141                         Frontend *frontend);
00142         
00148         void notifyAnimationChanged(int frameNumber);
00149         
00157         virtual const vector<char*> addFrames(const vector<char*>& frameNames, 
00158                         unsigned int index) = 0;
00159          
00168         virtual const vector<char*> removeFrames(       unsigned int fromFrame, 
00169                                                                                                 unsigned int toFrame) = 0;
00170         
00178         virtual void moveFrames(unsigned int fromFrame, unsigned int toFrame, 
00179                         unsigned int movePosition) = 0;
00180         
00190         virtual int addSound(unsigned int frameNumber, const char *filename) = 0;
00191         
00198         virtual void removeSound(unsigned int frameNumber, unsigned int soundNumber) = 0;
00199         
00207         virtual void setSoundName(unsigned int frameNumber, unsigned int soundNumber,
00208                         char* soundName) = 0;
00209         
00217         virtual Frame* getFrame(unsigned int frameNumber, unsigned int sceneNumber) = 0;
00218         
00225         virtual Frame* getFrame(unsigned int frameNumber) = 0;
00226         
00231         virtual unsigned int getModelSize() = 0;
00232         
00238         virtual unsigned int getSceneSize(int sceneNumber) = 0;
00239         
00244         virtual unsigned int getNumberOfScenes() = 0;
00245         
00250         virtual void setActiveFrame(int frameNumber) = 0;
00251           
00256         virtual void playFrame(int frameNumber) = 0;
00257          
00263         virtual int getActiveFrameNumber() = 0;
00264           
00265          
00269         virtual void clear() = 0; 
00270         
00275         virtual const char* getProjectFile() = 0;
00276         
00281         virtual bool openProject(const char *filename) = 0;
00282         
00288         virtual bool saveProject(const char *filename) = 0;
00289         
00294         virtual bool newProject() = 0;
00295         
00300         virtual bool isUnsavedChanges() = 0;
00301         
00306         virtual void setActiveScene(int sceneNumber) = 0;
00307         
00312         virtual int getActiveSceneNumber() = 0;
00313         
00319         virtual void newScene(int index) = 0;
00320         
00326         virtual void removeScene(int sceneNumber) = 0;
00327         
00334         virtual void moveScene(int sceneNumber, int movePosition) = 0;
00335         
00341         virtual bool initAudioDevice() = 0;
00342         
00347         virtual void shutdownAudioDevice() = 0;
00348         
00354         virtual void animationChanged(const char *alteredFile) = 0;
00355         
00362         virtual bool exportToVideo(VideoEncoder *encoder) = 0;
00363         
00369         virtual bool exportToCinerella(const char *file) = 0;
00370         
00371 protected:
00376         Frontend *frontend;
00377          
00378 private:
00383         vector<Observer*> observers;
00384 };
00385 
00386 #endif

Generated on Thu May 19 01:51:20 2005 for stopmotion.kdevelop by  doxygen 1.4.2