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

AnimationModel Class Reference

#include <animationmodel.h>

Inheritance diagram for AnimationModel:

Animation List of all members.

Public Member Functions

void attatch (Observer *o)
void detatch (Observer *o)
void registerFrontend (Frontend *frontend)
FrontendgetFrontend ()
void notifyAdd (const vector< char * > &frames, unsigned int index)
void notifyRemove (unsigned int fromFrame, unsigned int toFrame)
void notifyMove (unsigned int fromFrame, unsigned int toFrame, unsigned int movePosition)
void notifyNewActiveFrame (int frameNumber)
void notifyClear ()
void notifyPlayFrame (int frameNumber)
void notifyNewScene (int index)
void notifyRemoveScene (int sceneNumber)
void notifyMoveScene (int sceneNumber, int movePosition)
void notifyNewActiveScene (int sceneNumber, vector< char * > framePaths, Frontend *frontend)
void notifyAnimationChanged (int frameNumber)
virtual const vector< char * > addFrames (const vector< char * > &frameNames, unsigned int index)=0
virtual const vector< char * > removeFrames (unsigned int fromFrame, unsigned int toFrame)=0
virtual void moveFrames (unsigned int fromFrame, unsigned int toFrame, unsigned int movePosition)=0
virtual int addSound (unsigned int frameNumber, const char *filename)=0
virtual void removeSound (unsigned int frameNumber, unsigned int soundNumber)=0
virtual void setSoundName (unsigned int frameNumber, unsigned int soundNumber, char *soundName)=0
virtual FramegetFrame (unsigned int frameNumber, unsigned int sceneNumber)=0
virtual FramegetFrame (unsigned int frameNumber)=0
virtual unsigned int getModelSize ()=0
virtual unsigned int getSceneSize (int sceneNumber)=0
virtual unsigned int getNumberOfScenes ()=0
virtual void setActiveFrame (int frameNumber)=0
virtual void playFrame (int frameNumber)=0
virtual int getActiveFrameNumber ()=0
virtual void clear ()=0
virtual const char * getProjectFile ()=0
virtual bool openProject (const char *filename)=0
virtual bool saveProject (const char *filename)=0
virtual bool newProject ()=0
virtual bool isUnsavedChanges ()=0
virtual void setActiveScene (int sceneNumber)=0
virtual int getActiveSceneNumber ()=0
virtual void newScene (int index)=0
virtual void removeScene (int sceneNumber)=0
virtual void moveScene (int sceneNumber, int movePosition)=0
virtual bool initAudioDevice ()=0
virtual void shutdownAudioDevice ()=0
virtual void animationChanged (const char *alteredFile)=0
virtual bool exportToVideo (VideoEncoder *encoder)=0
virtual bool exportToCinerella (const char *file)=0

Protected Attributes

Frontendfrontend

Detailed Description

The animation model abstract class. All implementations of the animation model have to inherit from this class.

AnimationModel serves as the Subject in our implementation of the observer pattern, and takes care of notifying the observers when a change occur.

Author:
Bjoern Erik Nilsen & Fredrik Berg Kjoelstad


Member Function Documentation

virtual const vector<char*> AnimationModel::addFrames const vector< char * > &  frameNames,
unsigned int  index
[pure virtual]
 

Abstract function which adds a new frame to the AnimationModel.

Parameters:
frameNames a vector containing the frames to be added to the model
index the place to add the frames in the animation.
Returns:
a vector containing paths to the images which has been copied to a temporary directory.

Implemented in Animation.

virtual int AnimationModel::addSound unsigned int  frameNumber,
const char *  filename
[pure virtual]
 

Abstract function for adding the sound from the file "sound" to frame at position frameNumber.

Parameters:
frameNumber the number of the frame to add the sound to
filename the path to the file with the sound
Returns:
zero on success, less than zero on failure; -1 = file is not readable -2 = not a valid audio file

Implemented in Animation.

virtual void AnimationModel::animationChanged const char *  alteredFile  )  [pure virtual]
 

Abstract function which must be implemented to handle what should happen when a frame has been altered outside the application.

Parameters:
alteredFile the file which has been altered.

Implemented in Animation.

void AnimationModel::attatch Observer o  ) 
 

Attatches a new observer to the model. The observer will be notified when something is changed in the model.

Parameters:
o the observer to be attatched to the model.

virtual void AnimationModel::clear  )  [pure virtual]
 

Abstract function for clearing the model.

Implemented in Animation.

void AnimationModel::detatch Observer o  ) 
 

Detatches an observer from the model. The observer will no longer be notified when something is changed in the model.

Parameters:
o the observer to be detatched from the model.

virtual bool AnimationModel::exportToCinerella const char *  file  )  [pure virtual]
 

Abstract function for exporting the current project to a Cinerella project.

Parameters:
file the Cinerella project file
Returns:
true on success, false otherwise

Implemented in Animation.

virtual bool AnimationModel::exportToVideo VideoEncoder encoder  )  [pure virtual]
 

Abstract function for exporting the current project to a video file as specified by the video encoder.

Parameters:
encoder the video encoder to use for export to video
Returns:
true on success, false otherwise

Implemented in Animation.

virtual int AnimationModel::getActiveFrameNumber  )  [pure virtual]
 

Abstract function which returns the number of the currently active frame in the model.

Returns:
the number of the currently active frame.

Implemented in Animation.

virtual int AnimationModel::getActiveSceneNumber  )  [pure virtual]
 

Abstract function for retrieving the number of the currently active scene.

Returns:
the number of the active scene.

Implemented in Animation.

virtual Frame* AnimationModel::getFrame unsigned int  frameNumber  )  [pure virtual]
 

Abstract overloaded function for convenience. Assumes the scene to retrieve there frame from is the active scene.

Parameters:
frameNumber the number of the frame to retrieve.
Returns:
the frame at location frameNumber in the active scene.

Implemented in Animation.

virtual Frame* AnimationModel::getFrame unsigned int  frameNumber,
unsigned int  sceneNumber
[pure virtual]
 

Abstract function which retrieves a given frame

Parameters:
frameNumber the number of the frame to retrieve
sceneNumber the scene to retrieve the frame from.
Returns:
the frame to retrieve.

Implemented in Animation.

Frontend * AnimationModel::getFrontend  ) 
 

Retrieves the registered frontend.

Returns:
the frontend if it is a valid frontend pointer, NULL otherwise.

virtual unsigned int AnimationModel::getModelSize  )  [pure virtual]
 

Abstract function which returns the size of the model.

Returns:
the size of the model.

Implemented in Animation.

virtual unsigned int AnimationModel::getNumberOfScenes  )  [pure virtual]
 

Abstract function for retrieving number of scenes.

Returns:
number of scenes

Implemented in Animation.

virtual const char* AnimationModel::getProjectFile  )  [pure virtual]
 

Abstract function for retrieving the project file

Returns:
the project file if it's setted, NULL otherwise.

Implemented in Animation.

virtual unsigned int AnimationModel::getSceneSize int  sceneNumber  )  [pure virtual]
 

Abstract function for retrieving number of frames in a given scene.

Parameters:
sceneNumber the scene number
Returns:
number of frames

Implemented in Animation.

virtual bool AnimationModel::initAudioDevice  )  [pure virtual]
 

Abstract function for initializing the audio device so it is ready to play sounds.

Returns:
true on success, false otherwise

Implemented in Animation.

virtual bool AnimationModel::isUnsavedChanges  )  [pure virtual]
 

Abstract function to check if there are unsaved changes.

Returns:
true if there are unsaved changes, false otherwise

Implemented in Animation.

virtual void AnimationModel::moveFrames unsigned int  fromFrame,
unsigned int  toFrame,
unsigned int  movePosition
[pure virtual]
 

Abstract function for moving the frames from fromFrame (inclusive) to toFrame to toPosition.

Parameters:
fromFrame the first frame to move.
toFrame the last frame to move.
movePosition the posititon to move the frames to.

Implemented in Animation.

virtual void AnimationModel::moveScene int  sceneNumber,
int  movePosition
[pure virtual]
 

Abstract function which moves the scene at position sceneNumber to the position movePosition.

Parameters:
sceneNumber the number of the scene to move.
movePosition the position to move the scene to.

Implemented in Animation.

virtual bool AnimationModel::newProject  )  [pure virtual]
 

Abstract funtion to create a new project.

Returns:
true on success, false otherwise

Implemented in Animation.

virtual void AnimationModel::newScene int  index  )  [pure virtual]
 

Abstract function for adding a new scene at a given index in the vector containing the scenes.

Parameters:
index the index to add the scene

Implemented in Animation.

void AnimationModel::notifyAdd const vector< char * > &  frames,
unsigned int  index
 

Notify the observers that a frame is added to the model.

Parameters:
frames a vector containing the frames that are added to the model.
index the position it is added to.

void AnimationModel::notifyAnimationChanged int  frameNumber  ) 
 

Notify the observers that the disk representation of the animation has been altered.

Parameters:
frameNumber the index of the frame which has been changed.

void AnimationModel::notifyClear  ) 
 

Notify the observers that the model has been cleared.

void AnimationModel::notifyMove unsigned int  fromFrame,
unsigned int  toFrame,
unsigned int  movePosition
 

Notify the observers that a frame in the model has changed location (moved).

Parameters:
fromFrame the first frame in the selection
toFrame the last frame in the selection
movePosition the index to move the selected frames

void AnimationModel::notifyMoveScene int  sceneNumber,
int  movePosition
 

Notify the observers that a scene in the animation has been moved.

Parameters:
sceneNumber the scene which has been moved.
movePosition the location the scene has been moved to.

void AnimationModel::notifyNewActiveFrame int  frameNumber  ) 
 

Notify the observers the active frame in the model has changed.

Parameters:
frameNumber the number of the new active frame.

void AnimationModel::notifyNewActiveScene int  sceneNumber,
vector< char * >  framePaths,
Frontend frontend
 

Notify the observers that a new scene is set as the active scene.

Parameters:
sceneNumber the number of the new active scene.
framePaths the paths to the frames in the new scene.
frontend the frontend for process handling.

void AnimationModel::notifyNewScene int  index  ) 
 

Notify the observers that a new scene has been added to the animation.

Parameters:
index the place the new scene should be added to.

void AnimationModel::notifyPlayFrame int  frameNumber  ) 
 

Notify the observers that a frame is to be played.

Parameters:
frameNumber the frame to be played.

void AnimationModel::notifyRemove unsigned int  fromFrame,
unsigned int  toFrame
 

Notify the observers that a selection of frames are removed from the model.

Parameters:
fromFrame the first frame in the selection.
toFrame the last frame in the selection.

void AnimationModel::notifyRemoveScene int  sceneNumber  ) 
 

Notify the observers that a scene has been removed from the animation.

Parameters:
sceneNumber the frame which has been removed from the animation.

virtual bool AnimationModel::openProject const char *  filename  )  [pure virtual]
 

Abstract function for opening a project.

Returns:
true on success, false otherwise

Implemented in Animation.

virtual void AnimationModel::playFrame int  frameNumber  )  [pure virtual]
 

Abstract function for playing the frame with number frameNumber.

Parameters:
frameNumber the number of the frame to play.

Implemented in Animation.

void AnimationModel::registerFrontend Frontend frontend  ) 
 

Registers the GUI frontend which is used to displaying and updating progress when running timeconsuming operations.

Parameters:
frontend the GUI frontend

virtual const vector<char*> AnimationModel::removeFrames unsigned int  fromFrame,
unsigned int  toFrame
[pure virtual]
 

Abstract function to remove the frames between (inclusive) fromFrame and toFrame from the animation.

Parameters:
fromFrame the first frame to remove.
toFrame the last frame to remove.
Returns:
a vector containing paths to the images in the given range, which are moved to a trash directory.

Implemented in Animation.

virtual void AnimationModel::removeScene int  sceneNumber  )  [pure virtual]
 

Abstract function which removes the scene at the location sceneNumber from the animation.

Parameters:
sceneNumber the scene to be removed from the animation.

Implemented in Animation.

virtual void AnimationModel::removeSound unsigned int  frameNumber,
unsigned int  soundNumber
[pure virtual]
 

Abstract function which removes the sound with index soundNumber from the frame with index frameNumber.

Parameters:
frameNumber the index of the frame to remove a sound from.
soundNumber the index of the sound to remove from the frame.

Implemented in Animation.

virtual bool AnimationModel::saveProject const char *  filename  )  [pure virtual]
 

Abstract function which saves the active project to a XML-file which is written to disk.

Returns:
true on success, false otherwise

Implemented in Animation.

virtual void AnimationModel::setActiveFrame int  frameNumber  )  [pure virtual]
 

Abstract function for changing the currently active frame.

Parameters:
frameNumber the number of the new active frame.

Implemented in Animation.

virtual void AnimationModel::setActiveScene int  sceneNumber  )  [pure virtual]
 

Abstract funtion for setting new active scene.

Parameters:
sceneNumber the scene to set active

Implemented in Animation.

virtual void AnimationModel::setSoundName unsigned int  frameNumber,
unsigned int  soundNumber,
char *  soundName
[pure virtual]
 

Abstract function whick sets the name of the sound with index soundNumber in the frame with index frameNumber to soundName.

Parameters:
frameNumber the index of the frame the sound is in.
soundNumber the index to the sound to change the name of.
soundName the new name of the sound.

Implemented in Animation.

virtual void AnimationModel::shutdownAudioDevice  )  [pure virtual]
 

Abstract function for shutting down the audio device so other programs can use it.

Implemented in Animation.


Member Data Documentation

Frontend* AnimationModel::frontend [protected]
 

Pointer to the frontend that can be used to display progress and error messages.


The documentation for this class was generated from the following files:
Generated on Thu May 19 01:51:21 2005 for stopmotion.kdevelop by  doxygen 1.4.2