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

DomainFacade Class Reference

#include <domainfacade.h>

List of all members.

Public Member Functions

void attatch (Observer *o)
void detatch (Observer *o)
void registerFrontend (Frontend *frontend)
FrontendgetFrontend ()
void setActiveFrame (int frameNumber)
int getActiveFrameNumber ()
void addFrames (const vector< char * > &frameNames)
void removeFrames (unsigned int fromFrame, 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)
void playFrame (int frameNumber)
bool openProject (const char *filename)
bool saveProject (const char *filename)
bool newProject ()
bool isUnsavedChanges ()
FramegetFrame (unsigned int frameNumber, unsigned int sceneNumber)
FramegetFrame (unsigned int frameNumber)
unsigned int getModelSize ()
unsigned int getSceneSize (int sceneNumber)
unsigned int getNumberOfScenes ()
const char * getProjectFile ()
bool undo ()
bool redo ()
void clearHistory ()
void setActiveScene (int sceneNumber)
int getActiveSceneNumber ()
void newScene (int index)
void removeScene (int sceneNumber)
void moveScene (int sceneNumber, int movePosition)
bool initAudioDevice ()
void shutdownAudioDevice ()
bool exportToVideo (VideoEncoder *encoder)
bool exportToCinerella (const char *file)
void animationChanged (const char *alteredFile)

Static Public Member Functions

static DomainFacadegetFacade ()

Protected Member Functions

 DomainFacade ()


Detailed Description

Singleton facade for the domain level. All requests into the domain layer has to pass through this facade. The only exception is observer requests for display data.

DomainFacade is implemented with lazy allocation.

Author:
Bjoern Erik Nilsen & Fredrik Berg Kjoelstad


Constructor & Destructor Documentation

DomainFacade::DomainFacade  )  [protected]
 

The constructor. It is protected so that it will be impossible for other classes, who doesn't inherit from it to instanciate the singleton.


Member Function Documentation

void DomainFacade::addFrames const vector< char * > &  frameNames  ) 
 

Adds the frames in the vector to the animation model and sets up the undo command object

Parameters:
frameNames a vector containing the frames to be added to the animation.

int DomainFacade::addSound unsigned int  frameNumber,
const char *  filename
 

Adds a sound the given frame number. An error message will be sent to the frontend if somethings goes wrong with the adding.

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

void DomainFacade::animationChanged const char *  alteredFile  ) 
 

Tells the domain that the file alteredFile has been changed outside the program and that it should be updated.

Parameters:
alteredFile the file which has been altered.

void DomainFacade::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.

void DomainFacade::clearHistory  ) 
 

Clears the undo history.

void DomainFacade::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.

bool DomainFacade::exportToCinerella const char *  file  ) 
 

Exports the current project to a Cinerella project.

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

bool DomainFacade::exportToVideo VideoEncoder encoder  ) 
 

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

int DomainFacade::getActiveFrameNumber  ) 
 

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

Returns:

int DomainFacade::getActiveSceneNumber  ) 
 

Returns the number of the currently active scene.

Returns:
the number of the active scene.

DomainFacade * DomainFacade::getFacade  )  [static]
 

Static function to retrieve the factory instance object from the singleton class.

Returns:
the factory for sending requests into the domain.

Frame * DomainFacade::getFrame unsigned int  frameNumber  ) 
 

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.

Frame * DomainFacade::getFrame unsigned int  frameNumber,
unsigned int  sceneNumber
 

Retrieves a given frame.

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

Frontend * DomainFacade::getFrontend  ) 
 

Retrieves the registered frontend.

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

unsigned int DomainFacade::getModelSize  ) 
 

Retrieves the size of the model

Returns:
the size of the model

unsigned int DomainFacade::getNumberOfScenes  ) 
 

Function for retrieving number of scenes.

Returns:
number of scenes

const char * DomainFacade::getProjectFile  ) 
 

Retrieves the project file.

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

unsigned int DomainFacade::getSceneSize int  sceneNumber  ) 
 

Function for retrieving number of frames in a given scene.

Parameters:
sceneNumber the scene number
Returns:
number of frames

bool DomainFacade::initAudioDevice  ) 
 

Initializes the audio device so it is ready to play sounds. It will sends an error message to the frontend if somethings goes wrong, and audio will be disabled until the problem is fixed.

Returns:
true on success, false otherwise

bool DomainFacade::isUnsavedChanges  ) 
 

Checks if there are unsaved changes in the model.

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

void DomainFacade::moveFrames unsigned int  fromFrame,
unsigned int  toFrame,
unsigned int  movePosition
 

Moves the frames in the frameNumbers container to toPosition.

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

void DomainFacade::moveScene int  sceneNumber,
int  movePosition
 

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.

bool DomainFacade::newProject  ) 
 

Creates a new project.

void DomainFacade::newScene int  index  ) 
 

Creates a new scene in the animation project.

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

bool DomainFacade::openProject const char *  filename  ) 
 

Opens a project.

void DomainFacade::playFrame int  frameNumber  ) 
 

Plays the frame with the number frameNumber

Parameters:
frameNumber the number of the frame to play

bool DomainFacade::redo  ) 
 

Redoes the last undo operation.

void DomainFacade::registerFrontend Frontend frontend  ) 
 

Registers the GUI frontend which is used to display and update a progress bar when running time consuming operations.

Parameters:
frontend the GUI frontend

void DomainFacade::removeFrames unsigned int  fromFrame,
unsigned int  toFrame
 

Removes the frame between (inclusive) fromFrame and toFrame from the animation model.

Parameters:
fromFrame the first frame to remove.
toFrame the last frame to remove.

void DomainFacade::removeScene int  sceneNumber  ) 
 

Removes the scene at the location sceneNumber from the animation.

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

void DomainFacade::removeSound unsigned int  frameNumber,
unsigned int  soundNumber
 

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.

bool DomainFacade::saveProject const char *  filename  ) 
 

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

void DomainFacade::setActiveFrame int  frameNumber  ) 
 

Function to change the currently active frame. (Working frame).

Parameters:
frameNumber the number of the new active frame.

void DomainFacade::setActiveScene int  sceneNumber  ) 
 

Sets a new active scene (the scene to be worked on now).

Parameters:
sceneNumber the new active scene.

void DomainFacade::setSoundName unsigned int  frameNumber,
unsigned int  soundNumber,
char *  soundName
 

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.

void DomainFacade::shutdownAudioDevice  ) 
 

Shutdowns the audio device so other programs can use it.

bool DomainFacade::undo  ) 
 

Undoes the last undoable operation on the model.


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