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

Animation Class Reference

#include <animation.h>

Inheritance diagram for Animation:

AnimationModel List of all members.

Public Member Functions

 Animation ()
 ~Animation ()
const vector< char * > addFrames (const vector< char * > &frameNames, unsigned int index)
const vector< char * > removeFrames (unsigned int fromFrame, const unsigned int toFrame)
void moveFrames (unsigned int fromFrame, unsigned int toFrame, unsigned int movePosition)
int addSound (unsigned int frameNumber, const char *filename)
void removeSound (unsigned int frameNumber, unsigned int soundNumber)
void setSoundName (unsigned int frameNumber, unsigned int soundNumber, char *soundName)
FramegetFrame (unsigned int frameNumber, unsigned int sceneNumber)
FramegetFrame (unsigned int frameNumber)
unsigned int getModelSize ()
unsigned int getSceneSize (int sceneNumber)
unsigned int getNumberOfScenes ()
void setActiveFrame (int frameNumber)
void playFrame (int frameNumber)
int getActiveFrameNumber ()
void clear ()
const char * getProjectFile ()
bool openProject (const char *filename)
bool saveProject (const char *filename)
bool newProject ()
bool isUnsavedChanges ()
void setActiveScene (int sceneNumber)
int getActiveSceneNumber ()
void newScene (int index)
void removeScene (int sceneNumber)
void moveScene (int sceneNumber, int movePosition)
bool initAudioDevice ()
void shutdownAudioDevice ()
void animationChanged (const char *alteredFile)
bool exportToVideo (VideoEncoder *encoder)
bool exportToCinerella (const char *file)

Detailed Description

Implementation of the animationmodel containing the data about the animation.

Author:
Bjoern Erik Nilsen & Fredrik Berg Kjoelstad


Constructor & Destructor Documentation

Animation::Animation  ) 
 

Initializes the variables of the animation to starting values.

Animation::~Animation  ) 
 

Cleans up the animation.


Member Function Documentation

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

Inserts a new frame into the animationmodel.

Parameters:
frameNames a vector containing the names to be added in 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

Implements AnimationModel.

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

Adds 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

Implements AnimationModel.

void Animation::animationChanged const char *  alteredFile  )  [virtual]
 

Function to call when a file has been altered and the gui should be updated.

Parameters:
alteredFile the file which has been altered.

Implements AnimationModel.

void Animation::clear  )  [virtual]
 

Clears the model.

Implements AnimationModel.

bool Animation::exportToCinerella const char *  file  )  [virtual]
 

Exports the current project to a Cinerella project.

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

Implements AnimationModel.

bool Animation::exportToVideo VideoEncoder encoder  )  [virtual]
 

Exports 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

Implements AnimationModel.

int Animation::getActiveFrameNumber  )  [virtual]
 

Returns the number of the currently active frame in the model.

Returns:
the number of the currently active frame.

Implements AnimationModel.

int Animation::getActiveSceneNumber  )  [virtual]
 

Returns the number of the currently active scene.

Returns:
the number of the active scene.

Implements AnimationModel.

Frame * Animation::getFrame unsigned int  frameNumber  )  [virtual]
 

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.

Implements AnimationModel.

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

Returns the frame with the number frameNumber.

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

Implements AnimationModel.

unsigned int Animation::getModelSize  )  [virtual]
 

Returns the size of the model.

Returns:
the size of the model.

Implements AnimationModel.

unsigned int Animation::getNumberOfScenes  )  [virtual]
 

Retrieves the number of scenes in the animation.

Returns:
the number of scenes in the animation.

Implements AnimationModel.

const char * Animation::getProjectFile  )  [virtual]
 

Retrieves the project directory

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

Implements AnimationModel.

unsigned int Animation::getSceneSize int  sceneNumber  )  [virtual]
 

Retrieves the size of the scene at index sceneNumber.

Parameters:
sceneNumber the index of the scene to retrieve the size of.
Returns:
the size of the scene.

Implements AnimationModel.

bool Animation::initAudioDevice  )  [virtual]
 

Initializes the audio device so it is ready to play sounds.

Returns:
true on success, false otherwise

Implements AnimationModel.

bool Animation::isUnsavedChanges  )  [virtual]
 

Checks if there are unsaved changes in the model.

Returns:
true if there are unsaved changes, false otherwise.

Implements AnimationModel.

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

Move 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.

Implements AnimationModel.

void Animation::moveScene int  sceneNumber,
int  movePosition
[virtual]
 

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.

Implements AnimationModel.

bool Animation::newProject  )  [virtual]
 

Creates a new project.

Returns:
true on success, false otherwise

Implements AnimationModel.

void Animation::newScene int  index  )  [virtual]
 

Create and adds a new scene to the animation at position ``index''.

Parameters:
index the position to add the new scene.

Implements AnimationModel.

bool Animation::openProject const char *  filename  )  [virtual]
 

Opens a project.

Parameters:
filename the project file to open (ends with .sto)
Returns:
true on success, false otherwise

Implements AnimationModel.

void Animation::playFrame int  frameNumber  )  [virtual]
 

Plays the frame with number frameNumber.

Parameters:
frameNumber the number of the frame to play.

Implements AnimationModel.

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

Removes 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.

Implements AnimationModel.

void Animation::removeScene int  sceneNumber  )  [virtual]
 

Removes the scene at the location sceneNumber from the animation.

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

Implements AnimationModel.

void Animation::removeSound unsigned int  frameNumber,
unsigned int  soundNumber
[virtual]
 

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.

Implements AnimationModel.

bool Animation::saveProject const char *  filename  )  [virtual]
 

Saves the active project to a XML-file which is written to disk.

Parameters:
filename the filename to store the project files within.
Returns:
true on success, false otherwise

Implements AnimationModel.

void Animation::setActiveFrame int  frameNumber  )  [virtual]
 

Function for changing the currently active frame.

Parameters:
frameNumber the number of the new active frame.

Implements AnimationModel.

void Animation::setActiveScene int  sceneNumber  )  [virtual]
 

Sets the scene with at position sceneNumber as the active scene.

Parameters:
sceneNumber the number of the new active scene.

Implements AnimationModel.

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

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.

Implements AnimationModel.

void Animation::shutdownAudioDevice  )  [virtual]
 

Shutdowns the the audio device so that other programs can use it.

Implements AnimationModel.


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