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

animation.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 ANIMATION_H
00021 #define ANIMATION_H
00022 
00023 #include "src/config.h"
00024 #include "animationmodel.h"
00025 #include "scene.h"
00026 // #include "externalchangemonitor.h"
00027 #include "src/technical/projectserializer.h"
00028 #include "src/technical/audio/ossdriver.h"
00029 
00030 #include "frame.h"
00031 
00032 #include <vector>
00033 #include <libxml/tree.h>
00034 
00035 using namespace std;
00036 
00037 
00043 class Animation : public AnimationModel
00044 {
00045 public:
00049         Animation();
00050         
00054         ~Animation();
00055 
00063         const vector<char*> addFrames(const vector<char*>& frameNames, 
00064                         unsigned int index);
00065         
00074         const vector<char*> removeFrames(unsigned int fromFrame, 
00075                         const unsigned int toFrame);
00076         
00083         void moveFrames(unsigned int fromFrame, unsigned int toFrame, 
00084                         unsigned int movePosition);
00085         
00095         int addSound(unsigned int frameNumber, const char *filename);
00096         
00103         void removeSound(unsigned int frameNumber, unsigned int soundNumber);
00104         
00112         void setSoundName(unsigned int frameNumber, unsigned int soundNumber,
00113                         char* soundName);
00114         
00121         Frame* getFrame(unsigned int frameNumber, unsigned int sceneNumber);
00122         
00129         Frame* getFrame(unsigned int frameNumber);
00130         
00135         unsigned int getModelSize();
00136         
00142         unsigned int getSceneSize(int sceneNumber);
00143         
00148         unsigned int getNumberOfScenes();
00149         
00154         void setActiveFrame(int frameNumber);
00155 
00160         void playFrame(int frameNumber);
00161           
00167         int getActiveFrameNumber();
00168         
00172         void clear();
00173         
00178         const char *getProjectFile();
00179         
00185         bool openProject(const char *filename);
00186         
00192         bool saveProject(const char *filename);
00193         
00198         bool newProject();
00199         
00204         bool isUnsavedChanges();
00205         
00210         void setActiveScene(int sceneNumber);
00211         
00216         int getActiveSceneNumber();
00217         
00222         void newScene(int index);
00223         
00228         void removeScene(int sceneNumber);
00229         
00235         void moveScene(int sceneNumber, int movePosition);
00236         
00241         bool initAudioDevice();
00242         
00246         void shutdownAudioDevice();
00247         
00253         void animationChanged(const char *alteredFile);
00254         
00260         bool exportToVideo(VideoEncoder *encoder);
00261         
00267         bool exportToCinerella(const char *file);
00268         
00269 private:
00271         vector<Scene*> scenes;
00272         
00274         ProjectSerializer *serializer;
00275         
00278 //      ExternalChangeMonitor *externalChangeMonitor;
00279         
00281         AudioDriver *audioDriver;
00282         
00284         int activeFrame;
00285         
00287         int activeScene;
00288         
00290         int numSounds;
00291         
00293         bool isChangesSaved;
00294         
00296         bool isAudioDriverInitialized;
00297         
00303         void loadSavedScenes();
00304         
00309         void activateScene(int sceneNumber);
00310 };
00311 
00312 #endif

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