VirtualMedia Class Reference
[BaseObject Inherited Classes: All of them.BaseObject Inherited Classes For VedaLib]

#include <VirtualMedia.h>

Inherits BaseObject.

Inherited by Media3DView, MediaSoundEquation, MediaTimePattern, and MP3SoundObject.

List of all members.


Detailed Description

Base model for all class that plays a suit of animations and/or sounds. You should extend ProcessMedia() for animations, and ProcessSoundInterupt() for sounds, in any way. This example extends a VirtualMedia and plays it. Note this class is not registered to BaseContext by default. you got to register it or not, according to your needs. Thus, it got to be registered first if you use inherited classes. ( through BaseContext::RegisterClassList() ) Also note that VirtualMedia::ProcessSoundInterupt() manages the sound registration to the machine itself.

Definition at line 22 of file VirtualMedia.h.

Public Types

enum  tm_BaseObject { tm_BaseObject_FirstInheritageToolMethod = 1 }
 Begin the enumeration for ExecuteToolMethod(). More...
enum  eVedaUpdate {
  eVedaUpdate_NoUpdate = 0, eVedaUpdate_MemberIsGoingToChange, eVedaUpdate_MemberChanged, eVedaUpdate_MemberChangedBecauseOfUndo,
  eVedaUpdate_MemberDestroyed, eVedaUpdate_ObjectNew, eVedaUpdate_ObjectDestroyed, eVedaUpdate_ObjectReCreated,
  eVedaUpdate_ObjectClosed, eVedaUpdate_NewRegisteredClass
}
 enum used by BaseContext::NotifyObjectChange() to describe the notification meaning. Used by interfaces to monitor a context. More...

Public Member Functions

 VirtualMedia (void)
 Constructor. There should only be members initialisation there.
 BASEOBJECT_DEFINE_VIRTUALCLASS (VirtualMedia)
 Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp.
void ProcessMediaOnDefaultViewport (double _frameDate)
 Process a media at a given date, or do anything) using a machine. Note there are no play/pause or speed concept here, by default, a date is passed. This version redirect the drawing to the main screen viewport. It should the main entry to play a media. Developpers should extend.
virtual void ProcessMedia (double _frameDate, VirtualMachine::InternalViewPort *_pViewPort)
 Process a media at a given date, or do anything) using a machine. You must process the media on machine this->GetMachine(). Note there are no play/pause or speed concept here, by default, a date is passed. By default, does nothing.
double GetTimeLength ()
 returns the Total Time length of this media, in seconds, when played at normal speed. This is just an information about the time length of this media, and you can pass any date to ProcessMedia().
virtual void SetSound (bool _Enable)
 Use SetSound() to enable sound capabilities for a media object, and the machine should then send ProcessSoundInterupt() to mix it. SetSound(true) at start and SetSound(false) at closing, have to be performed by external code, and should not be used by AzurVeda objects in their methods. Note: SetSound(true) enable One object, but this object can point other Media objects in the context with SetSound(false), and use ProcessSoundInterupt() recursively to mix all of them. So an object with SetSound(false) can still be noisy.
virtual void ProcessSoundInterupt (VirtualMachine::SoundBufferToAddYourSignal &_SoundBufferToAddYourSignal)
 If the media had to generate real time sounds, ProcessSoundInterupt will be called by a machine. There is a default behaviour for this method, which does nothing. the float buffer accumulate the whole machine sound.
virtual void StartPreview ()
 any suit of call to ProcessPreview() should be done between StartPreview() and EndPreview() . EndPreview(). This is needed to stop sound mixing from the object when the preview change.
virtual void ProcessPreview (double _frameDate, VirtualMachine::InternalViewPort *_pPreviewViewPort, const PreviewConfiguration *_pPreviewConfiguration)
 a GUI could need to play, draw, print, or output from any way, a preview of a created object. This is done with this method. sub classes can implement it (or not) in any way, to explicit current shape of an object.

virtual void EndPreview ()
 any suit of call to ProcessPreview() should be done between StartPreview() and EndPreview() . EndPreview(). This is needed to stop sound mixing from the object when the preview change.
int Create (bool _immediate=true)
 Public Method that ensures the object is construct, and ensures that all needed objects in the context are build before. Close() should close everything opened by Create() for this object. if _immediate is true, it will build everything immediately and return 0. if false, it will begin to build needed objects, and then return an integer which stand for the rest of objects to be built before this object is completly created. if Create(false) is thrown again and again, this weight will get down to zero, and zero mean the object is created (like with Create() ). It allows to follow the progression of the creation in a loop, and so progressbars. Note it runs the protected virtual CreateInternal() method to do it. Extend CreateInternal() to make the construction, do not extend create.
void Close (bool _AndCloseAllDependantObjects=false)
 Public method that will close everythinh opened with Create(), and declare the object Closed. The object is not destroyed, and can be rebuild eback using Create(). Extend CreateInternal() and CloseInternal() to manage your objects. This method also sends a "Object Close" message in edition mode.
virtual const char * GetClassID () const
 Each BaseType's inherited classes must explicit an ID for their class, or let use one of the super class at least through this virtual method. This is needed by GUIs to detect the types of each sub-members, and shape an interface for each Object according to their member list.
virtual const char * GetDisplayClassName () const
 return an explicit name for the class the object is instancied.
virtual const char * GetDefaultObjectName () const
 return the default name that is set to new objects if not specified:
virtual const char * GetClassHelpDescription () const
 return an explicit name for the class the object is instancied.
virtual const ClassDescription & GetClassDescription (void) const
BaseObjectClone (const char *_cloneName=0L)
 Create a new object with the exact same member values in the same context. references to other objects are kept the same, so that the clone uses the same objects as the original.
void SetBaseContext (BaseContext *_pBaseContext)
 The BaseContext the Object belong to. Should only be used by BaseContext at object creation. As it is set after construction, the chunk initialisation continue there the initialisation of registered members.
BaseContextGetContext (void)
 get the context this object belong to.
VirtualMachineGetMachine ()
 The Machine of which the context is implemented. It is a gateway for hardware abstraction.
PackObjectReferenceGetFirstReferenceToThisObject (void)
 return the First Reference To This Object, and then scan the list of all PackObjectReference that refers the objects.
virtual void CloseReferences ()
 all reference to this object will be closed. used by deletion done by ClassNode.
void SetFirstReferenceToThisObject (PackObjectReference *_pReference)
 set FirstReferenceToThisObject, should be used privately.
void SetUniqueReference (unsigned int _referenceIndex)
 Used by the context to set the reference index for serialization, to manage PackObjectReference serialisation:.
unsigned int GetUniqueReference ()
 Used by PackObjectReference for input serialization. See ClassNode::SetObjectsUniqueReferenceIndex().
bool isDependantOf (BaseObject *_pObjectSuspectedOfOwnage)
 if this object is refered by another one (which means: needed to be created.) directly, or indirectly through other objects references, it will return true, otherwise false if no dependance are found at all. This is a recursive test.
bool isCreated () const
 return false if allocated but not created, true if also created.
float GetCreationRate ()
 the rate of creation, 0.0f if created, 1.0f if not created at all.
virtual void ProcessPreview (double _frameDate, VirtualMachine::InternalViewPort *_pPreviewViewPort, const PreviewConfiguration *_pPreviewConfiguration)
 Extend this method to draw your preview ! a GUI could need to play, draw, print, or output from any way, a preview of a created object. Inherited classes can implement it in any way, to explicit the current shape of an object.
const char * GetObjectInfoLine () const
 In editable mode, it returns an information output to display, usually given in ProcessPreview(), using m_ObjectInfoLine.
virtual void ExecuteToolMethod (unsigned int _MethodIDToExecute)
 Tool Method main entry. In editable mode, the object can register a set of methods identified with an ID number by using RegisterToolMethod(), and throw the methods through a switch in ToolMethod(). Then an interface can ask about the available tool methods for an object, and provide action on it. This was made to allow special external processing to edit an object, by exemple by importing a file, or to allow export of the object in a file format. By default, it does nothing for BaseObject. Important: 0 can't be used as an ID. You can only register an ID once, for a given class. See RegisterToolMethod().
unsigned int GetNextToolMethod (unsigned int _PreviousMethodID, unsigned int &_NextMethodflagInfo, const char *&_pNextShortDisplayName, const char *&_pNextDisplayHelp)
 get next tool method ID, or 0 if no more. Send 0 as _PreviousMethodID to get the first.
bool DidLastCreationFailed () const
 If the last call to Create() failed, this return true, and GetLastCreationErrorString() could explain why.
const char * GetLastCreationErrorString () const
virtual const unsigned char * Serialize_In (const unsigned char *_pDescriptionChunk)
 Read the object description from a byte chunk. Could crash if chunk not valid.
virtual unsigned int GetSerializedDescriptionSize (void)
 get the size of the whole byte chunk that will be written by Serialize_Out().
virtual unsigned char * Serialize_Out (unsigned char *_pDescriptionChunkToFill)
 write the Current object definition to a Chunk using private packed types, recursively.
unsigned int GetChunkLength ()
 the chunk length once serialized. should be valid just after in or out serialisation, but not if the object was modified. use GetSerializedDescriptionSize() instead.
const char * GetName (void) const
 Return the name of the object as a character string.
void SetName (const char *_pname)
 set the name of the object as a character string. This is copied of course.
virtual void SetObjectThatManagesThis (BaseObject *_pManager)
 The Object this one belong to as a member. Should only be used at init.
virtual const char * ValueToString ()
 convert the value of this object to an explicit string. The object manages the string privately, so just read it or copy it. the string would be destroyed with the objects, and changed when using Set() methods. Note: this is not virtual, but each class can manage m_pValueString or not.
virtual Cell * AddElement (int _indexWhereToInsert=-1, BaseType *_pObjectToAdd=0L)
 Add a new element, at the given index.
BaseTypeGet (unsigned int _index)
 get an element at a given index.
virtual void DeleteElement (unsigned int _index)
 delete an element at a given object of the cell to destroy. does not destroy the object.
Cell * GetFirstCell () const
 FirstCell or null if empty.
Cell * GetLastCell () const
 the Last Cell or null if empty
unsigned int GetNumberOfCell () const
 return the number of cell.
void DeleteAllElements (void)
 close and destroy the whole list.
virtual unsigned int WriteFile (const char *_pFileName)
 write a serialized form, using GetSerializedDescriptionSize() and Serialize_Out().
virtual unsigned int ReadFile (const char *_pFileName)
 Try to read a serialized form, using Serialize_In().
void SetMemberName (const char *_MemberName)
 Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() returning NULL should not be edited by an interface or undo-managed. Use REGISTER_MEMBER macros family: it registers the members and use SetMemberName() automatically (or not, according to the compilation mode).
const char * GetMemberName () const
 Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() to NULL should not be edited by an interface or undo-managed. set with SetMemberName().
void SetMemberInfo (const char *_MemberInfo)
 Explicits the use of an object when used as a class member. It should explain what the member does for the object. It exists only in editable mode,and can be used by any GUI. Don't use html tags , only \n are allowed. Use REGISTER_MEMBER_INFO macro after the REGISTER_MEMBER macro in the constructors. It can be left NULL.
const char * GetMemberInfo () const
 Explicits the use of an object when used as a class member. It exists only in editable mode and can be used by any GUI. It should explain what the member does for the object.
BaseObjectGetObjectThatManagesThis ()
 If there is any, get the object that manages this one as a member.
void MakeCloneOf (BaseType &_ModelObject)
 Tool that makes an object take the values of another using serialization. Use with care: You got to clone a PackUlong with a PackULong, a PackString with a PackString: Clone Object of the same type or it will crash . A test is done at the beginning to check that for both types are the sames, if not it does nothing. however it may still crash with 2 objects from unherited classes. Also, some type like PackObjectReference, will not clone its value by copying a pointer.Reference member clonage is done with BaseObject::Clone().

Static Public Attributes

static const ClassDescription m_Description
 the static class description object, to be reimplemented in each class to describe it, with BASEOBJECT_DECLARE_VIRTUALCLASS / BASEOBJECT_DECLARE_CLASS macros

Protected Member Functions

virtual void CloseInternal (void)
 Method that really build the object using the serializable parameters. Close() should close everything opened by CreateInternal(). that closes everything. Still, the object exist and can be rebuild the same using Create().
virtual void ProcessPreview_DrawSoundBuffer (VirtualMachine::InternalViewPort *_pViewport, float *_pSoundBuffer, unsigned int _bufferlength)
 Tool to draw a preview of the current sound signal.
virtual bool CreateInternal (void)
 Method that really build the object using the serializable parameters. Close() should close everything opened by Create(). If the object is already created, it return false, and all Create methods should exit. Note it runs the protected virtual CreateInternal() method to do it.
void RegisterToolMethod (unsigned int _MethodID, unsigned int _MethodflagInfo, const char *_pShortDisplayName, const char *_pDisplayHelp)
 Register a tool method. Do not use it directly, use macro version BASEOBJECT_REGISTER_TOOLMETHOD() It should be set in the constructors.
void RegisterSerializableMember (BaseType &_object)
 Register any serializable object to serialize for read or write operation, Use it in objects constructors. The object are serialized in the file in the same order as they are given by this method.
void BeginChangeNotification ()
 In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.
void EndChangeNotification ()
 In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

Protected Attributes

bool m_SoundIsMixed
 true if m_MediaSoundInterface is currently registered to VirtualMachine as playing sound.
double m_MediaTimeLength
 Total Time length of this media, in seconds, when played at normal speed. Can be used or not.
PackULong mSer_UniqueReference
 Unique reference used only for serilalization, and PackObjectReference resolution.
PackString m_ObjectInfoLine
PackString m_LastCreationErrorString
 In editable mode, if Create() fail, this string may be inited.
float m_CreationRate
 the rate of creation, 0.0f if created, 1.0f if not created at all.
PackObjectReferencem_pFirstReferenceToThisObject
 In editable mode, trace the list of all reference to this object:.
ToolMethodCell * m_pFirstToolMethodCell
 next method or 0L.
PackULong mSerUlong_ChunkLength
 all named objects, ClassNode and BaseObjects, has the ability to jump over the chunk without reading it:
PackString mSerStr_ObjectName
BaseContextm_pBaseContext
 an object can belong (or not) to a BaseContext, as an object.
Cell * m_pFirstCell
 member that manages the list of members to serialize automatically.
Cell * m_pLastCell
 another member that manages the list of members to serialize automatically, and allow to grow the list by the end.
unsigned int m_NumberOfCell
 the number of cell.
BaseObjectm_pObjectThatManagesThis
 an object can belong (or not) to a BaseObject,( and to a BaseContext through it).
const char * m_pMemberName
 If used as a member in an object, the member name, or NULL (not editable member).
const char * m_pMemberInfo
 a short string explaining what's the object for in editable mode. OK if NULL (no info).
PackStringm_pValueString
 a string standing for an expression of the value of the object:
unsigned char * m_pPreviousValueShape
 used as a temp for object change notification in Begin/EndChangeNotification():
unsigned int m_PreviousValueShapeLength

Static Protected Attributes

static const char * m_pErrorString_Memory
 some optimsation stuff to not make the executable string table grow too much...
static const char * m_pErrorString_CantOpenFile


Member Enumeration Documentation

enum eVedaUpdate [inherited]
 

enum used by BaseContext::NotifyObjectChange() to describe the notification meaning. Used by interfaces to monitor a context.

Enumerator:
eVedaUpdate_NoUpdate  0 means No Update.
eVedaUpdate_MemberIsGoingToChange  Sent before a BaseObject member value change.( in order to lock the context to prevent object use from other thread.).
eVedaUpdate_MemberChanged  a member of a BaseObject just changed.
eVedaUpdate_MemberChangedBecauseOfUndo  a member of a BaseObject just changed, but because of an undo. you may treat it the same as eVedaUpdate_MemberChanged.
eVedaUpdate_MemberDestroyed  Member of object Destroyed ! Watch out, the ID of the member is a dead pointer.
eVedaUpdate_ObjectNew  new BaseObject created.
eVedaUpdate_ObjectDestroyed  BaseObject just destroyed.Watch out, the ID of the object is a dead pointer.
eVedaUpdate_ObjectReCreated  an object has just been Created; It's state has changed!
eVedaUpdate_ObjectClosed  an object has just been closed; It's state has changed!
eVedaUpdate_NewRegisteredClass  TODO: a new class has been registered to the context.

Definition at line 194 of file BaseType.h.

enum tm_BaseObject [inherited]
 

Begin the enumeration for ExecuteToolMethod().

Enumerator:
tm_BaseObject_FirstInheritageToolMethod  first enum to extend tool method index.

Definition at line 411 of file BaseObject.h.


Constructor & Destructor Documentation

VirtualMedia void   ) 
 

Constructor. There should only be members initialisation there.


Member Function Documentation

virtual Cell* AddElement int  _indexWhereToInsert = -1,
BaseType _pObjectToAdd = 0L
[virtual, inherited]
 

Add a new element, at the given index.

Parameters:
_indexWhereToInsert the index where to insert. if -1, at the end.
_pObjectToAdd object to manage, or NULL to set it after on the returned cell.
Returns:
the element created.

Reimplemented in PackList, PackList_TimeBlockTrack, and PackList_TimeTrack.

BASEOBJECT_DEFINE_VIRTUALCLASS VirtualMedia   ) 
 

Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp.

void BeginChangeNotification  )  [protected, inherited]
 

In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

BaseObject* Clone const char *  _cloneName = 0L  )  [inherited]
 

Create a new object with the exact same member values in the same context. references to other objects are kept the same, so that the clone uses the same objects as the original.

Parameters:
_cloneName the name of the new clone.
Returns:
a new object of the same shape, or 0L if failed.

void Close bool  _AndCloseAllDependantObjects = false  )  [inherited]
 

Public method that will close everythinh opened with Create(), and declare the object Closed. The object is not destroyed, and can be rebuild eback using Create(). Extend CreateInternal() and CloseInternal() to manage your objects. This method also sends a "Object Close" message in edition mode.

Parameters:
_AndCloseAllDependantObjects if true, all dependant objects are close the same way.

virtual void CloseInternal void   )  [protected, virtual]
 

Method that really build the object using the serializable parameters. Close() should close everything opened by CreateInternal(). that closes everything. Still, the object exist and can be rebuild the same using Create().

Reimplemented from BaseObject.

Reimplemented in MediaTimePattern, MediaSoundEquation, and MP3SoundObject.

virtual void CloseReferences  )  [virtual, inherited]
 

all reference to this object will be closed. used by deletion done by ClassNode.

Reimplemented in InterfacePrefObject.

int Create bool  _immediate = true  )  [inherited]
 

Public Method that ensures the object is construct, and ensures that all needed objects in the context are build before. Close() should close everything opened by Create() for this object. if _immediate is true, it will build everything immediately and return 0. if false, it will begin to build needed objects, and then return an integer which stand for the rest of objects to be built before this object is completly created. if Create(false) is thrown again and again, this weight will get down to zero, and zero mean the object is created (like with Create() ). It allows to follow the progression of the creation in a loop, and so progressbars. Note it runs the protected virtual CreateInternal() method to do it. Extend CreateInternal() to make the construction, do not extend create.

Parameters:
_immediate if true, it will build everything and return 0. If false, make just a part of the creation and return a construction weight.
Returns:
0 when object is completly built, otherwise a weight integer with positive value when constrution is still to be performed. a negative value means creation impossible.

virtual bool CreateInternal void   )  [inline, protected, virtual, inherited]
 

Method that really build the object using the serializable parameters. Close() should close everything opened by Create(). If the object is already created, it return false, and all Create methods should exit. Note it runs the protected virtual CreateInternal() method to do it.

Returns:
true if object has to be built.

Reimplemented in MediaTimePattern, TextLocalized, EquationSoundSignal, VirtualEquationSpline, BubbleGreyImage, ImplicitEquationImage, ImplicitEquationImage, PerlinNoiseImage, ProceduralImage, RGBAImage, VirtualImage, Media3DView, Object3DGrid, Object3DLWOResource, Object3DMesh3D, ParticleSetVirtual, RenderTargetRectangle, RenderTargetTexture, Texture3D, Image2DEffectFire, MarchinCubeSpace, MediaSoundEquation, Object3DFontArial, Object3DFontBitmap, Object3DMarchCube, Object3DText, MP3SoundObject, and ImageJPEG.

Definition at line 503 of file BaseObject.h.

void DeleteAllElements void   )  [inherited]
 

close and destroy the whole list.

virtual void DeleteElement unsigned int  _index  )  [virtual, inherited]
 

delete an element at a given object of the cell to destroy. does not destroy the object.

Parameters:
_index index of the object to destroy.

Reimplemented in PackList.

bool DidLastCreationFailed  )  const [inline, inherited]
 

If the last call to Create() failed, this return true, and GetLastCreationErrorString() could explain why.

Definition at line 462 of file BaseObject.h.

void EndChangeNotification  )  [protected, inherited]
 

In edition mode, when a member of an object is changed (like in a Set()), you got to use BeginChangeNotification(), make your changes, and then EndChangeNotification(), so that the edition of this object and member is known by the context, and allows it to manage a GUI update and the undo stack.

virtual void EndPreview  )  [virtual]
 

any suit of call to ProcessPreview() should be done between StartPreview() and EndPreview() . EndPreview(). This is needed to stop sound mixing from the object when the preview change.

Reimplemented from BaseObject.

virtual void ExecuteToolMethod unsigned int  _MethodIDToExecute  )  [virtual, inherited]
 

Tool Method main entry. In editable mode, the object can register a set of methods identified with an ID number by using RegisterToolMethod(), and throw the methods through a switch in ToolMethod(). Then an interface can ask about the available tool methods for an object, and provide action on it. This was made to allow special external processing to edit an object, by exemple by importing a file, or to allow export of the object in a file format. By default, it does nothing for BaseObject. Important: 0 can't be used as an ID. You can only register an ID once, for a given class. See RegisterToolMethod().

Parameters:
_MethodIDToExecute the tool method ID, greater than 0.

Reimplemented in EquationSpline_X, and Object3DMesh3D.

BaseType* Get unsigned int  _index  )  [inherited]
 

get an element at a given index.

Parameters:
_index the index of the element
Returns:
the element at the index or NULL if failed.

unsigned int GetChunkLength  )  [inline, inherited]
 

the chunk length once serialized. should be valid just after in or out serialisation, but not if the object was modified. use GetSerializedDescriptionSize() instead.

Returns:
the chunk length

Definition at line 65 of file NamedObject.h.

References PackULong::Get(), and NamedObject::mSerUlong_ChunkLength.

virtual const ClassDescription& GetClassDescription void   )  const [virtual, inherited]
 

Returns:

Referenced by BaseObject::GetClassID(), BaseObject::GetDefaultObjectName(), and BaseObject::GetDisplayClassName().

virtual const char* GetClassHelpDescription  )  const [inline, virtual, inherited]
 

return an explicit name for the class the object is instancied.

Returns:
a const character string.

Definition at line 243 of file BaseObject.h.

virtual const char* GetClassID  )  const [inline, virtual, inherited]
 

Each BaseType's inherited classes must explicit an ID for their class, or let use one of the super class at least through this virtual method. This is needed by GUIs to detect the types of each sub-members, and shape an interface for each Object according to their member list.

For all "BaseObject", this name is the same that identify the class into the context: No need to extend this method further after BaseObject.

Returns:
a const character string, that must be unique and unchanged for all serializable base type.

Reimplemented from PackStruct.

Definition at line 222 of file BaseObject.h.

References BaseObject::GetClassDescription().

BaseContext* GetContext void   )  [inline, inherited]
 

get the context this object belong to.

Returns:
the context.

Definition at line 277 of file BaseObject.h.

References NamedObject::m_pBaseContext.

float GetCreationRate  )  [inline, inherited]
 

the rate of creation, 0.0f if created, 1.0f if not created at all.

Returns:
the 0,1 rate

Definition at line 338 of file BaseObject.h.

References BaseObject::m_CreationRate.

virtual const char* GetDefaultObjectName  )  const [inline, virtual, inherited]
 

return the default name that is set to new objects if not specified:

Returns:
a const character string.

Definition at line 236 of file BaseObject.h.

References BaseObject::GetClassDescription().

virtual const char* GetDisplayClassName  )  const [inline, virtual, inherited]
 

return an explicit name for the class the object is instancied.

Returns:
a const character string.

Definition at line 229 of file BaseObject.h.

References BaseObject::GetClassDescription().

Cell* GetFirstCell  )  const [inline, inherited]
 

FirstCell or null if empty.

Returns:
the cell

Definition at line 171 of file PackStruct.h.

References PackStruct::m_pFirstCell.

Referenced by LightModel::GetFirstDifuseLight(), and LightModel::GetFirstLinearLight().

PackObjectReference* GetFirstReferenceToThisObject void   )  [inline, inherited]
 

return the First Reference To This Object, and then scan the list of all PackObjectReference that refers the objects.

Returns:
FirstReferenceToThisObject

Definition at line 289 of file BaseObject.h.

References BaseObject::m_pFirstReferenceToThisObject.

Cell* GetLastCell  )  const [inline, inherited]
 

the Last Cell or null if empty

Returns:
the cell

Definition at line 176 of file PackStruct.h.

References PackStruct::m_pLastCell.

Referenced by PackList_TimeTrack::GetEndTime().

VirtualMachine* GetMachine  )  [inherited]
 

The Machine of which the context is implemented. It is a gateway for hardware abstraction.

Returns:
a machine used by the object and context.

const char* GetMemberInfo  )  const [inline, inherited]
 

Explicits the use of an object when used as a class member. It exists only in editable mode and can be used by any GUI. It should explain what the member does for the object.

Returns:
a short string explaining what's the object for, or NULL if not set.

Definition at line 144 of file BaseType.h.

References BaseType::m_pMemberInfo.

const char* GetMemberName  )  const [inline, inherited]
 

Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() to NULL should not be edited by an interface or undo-managed. set with SetMemberName().

Returns:
the member name or NULL

Definition at line 123 of file BaseType.h.

References BaseType::m_pMemberName.

const char* GetName void   )  const [inline, inherited]
 

Return the name of the object as a character string.

Returns:
the name.

Definition at line 71 of file NamedObject.h.

References PackString::Get(), and NamedObject::mSerStr_ObjectName.

unsigned int GetNextToolMethod unsigned int  _PreviousMethodID,
unsigned int &  _NextMethodflagInfo,
const char *&  _pNextShortDisplayName,
const char *&  _pNextDisplayHelp
[inherited]
 

get next tool method ID, or 0 if no more. Send 0 as _PreviousMethodID to get the first.

unsigned int GetNumberOfCell  )  const [inline, inherited]
 

return the number of cell.

Returns:
the number of cell.

Definition at line 181 of file PackStruct.h.

References PackStruct::m_NumberOfCell.

const char* GetObjectInfoLine  )  const [inline, inherited]
 

In editable mode, it returns an information output to display, usually given in ProcessPreview(), using m_ObjectInfoLine.

Returns:
a character string

Definition at line 403 of file BaseObject.h.

References PackString::Get(), and BaseObject::m_ObjectInfoLine.

BaseObject* GetObjectThatManagesThis  )  [inline, inherited]
 

If there is any, get the object that manages this one as a member.

Returns:
the object that manages this one as a member, or NULL

Definition at line 170 of file BaseType.h.

References BaseType::m_pObjectThatManagesThis.

virtual unsigned int GetSerializedDescriptionSize void   )  [virtual, inherited]
 

get the size of the whole byte chunk that will be written by Serialize_Out().

Returns:
byte size of the serialisation to do.

Reimplemented from PackStruct.

Reimplemented in BaseContext, ClassNode, and InterfacePrefObject.

double GetTimeLength  )  [inline]
 

returns the Total Time length of this media, in seconds, when played at normal speed. This is just an information about the time length of this media, and you can pass any date to ProcessMedia().

Returns:
Total Time length of this media, in seconds, when played at normal speed. Can be used or not.

Definition at line 64 of file VirtualMedia.h.

References m_MediaTimeLength.

unsigned int GetUniqueReference  )  [inline, inherited]
 

Used by PackObjectReference for input serialization. See ClassNode::SetObjectsUniqueReferenceIndex().

Returns:
the unique index of the object in the whole database.

Definition at line 317 of file BaseObject.h.

References PackULong::Get(), and BaseObject::mSer_UniqueReference.

bool isCreated  )  const [inline, inherited]
 

return false if allocated but not created, true if also created.

Returns:
true if currently created.

Definition at line 332 of file BaseObject.h.

bool isDependantOf BaseObject _pObjectSuspectedOfOwnage  )  [inherited]
 

if this object is refered by another one (which means: needed to be created.) directly, or indirectly through other objects references, it will return true, otherwise false if no dependance are found at all. This is a recursive test.

Parameters:
_pObjectSuspectedOfOwnage the object supsected of ownage.
Returns:
true if dependant.

void MakeCloneOf BaseType _ModelObject  )  [inherited]
 

Tool that makes an object take the values of another using serialization. Use with care: You got to clone a PackUlong with a PackULong, a PackString with a PackString: Clone Object of the same type or it will crash . A test is done at the beginning to check that for both types are the sames, if not it does nothing. however it may still crash with 2 objects from unherited classes. Also, some type like PackObjectReference, will not clone its value by copying a pointer.Reference member clonage is done with BaseObject::Clone().

Parameters:
_ModelObject the object took as a model.

virtual void ProcessMedia double  _frameDate,
VirtualMachine::InternalViewPort _pViewPort
[virtual]
 

Process a media at a given date, or do anything) using a machine. You must process the media on machine this->GetMachine(). Note there are no play/pause or speed concept here, by default, a date is passed. By default, does nothing.

Parameters:
_frameDate a date, in second, which defines the effect cinematic.
_pViewPort the viewport to render. Can't be 0L.

Reimplemented in MediaTimePattern, Media3DView, and MP3SoundObject.

void ProcessMediaOnDefaultViewport double  _frameDate  ) 
 

Process a media at a given date, or do anything) using a machine. Note there are no play/pause or speed concept here, by default, a date is passed. This version redirect the drawing to the main screen viewport. It should the main entry to play a media. Developpers should extend.

Parameters:
_frameDate a date, in second, which defines the effect cinematic.

virtual void ProcessPreview double  _frameDate,
VirtualMachine::InternalViewPort _pPreviewViewPort,
const PreviewConfiguration _pPreviewConfiguration
[virtual, inherited]
 

Extend this method to draw your preview ! a GUI could need to play, draw, print, or output from any way, a preview of a created object. Inherited classes can implement it in any way, to explicit the current shape of an object.

Parameters:
_frameDate a date, in second, which defines the effect cinematic.
_pPreviewViewPort the viewport to render. Can't be 0L.
_pPreviewConfiguration Preview Configuration object. Never 0L. Do not keep a pointer to it.

virtual void ProcessPreview double  _frameDate,
VirtualMachine::InternalViewPort _pPreviewViewPort,
const PreviewConfiguration *  _pPreviewConfiguration
[virtual]
 

a GUI could need to play, draw, print, or output from any way, a preview of a created object. This is done with this method. sub classes can implement it (or not) in any way, to explicit current shape of an object.

Parameters:
_frameDate a date, in second, which defines the effect cinematic.
_pPreviewViewPort the viewport to render. Can't be 0L.
_pPreviewConfiguration 

Reimplemented in MediaTimePattern, MediaSoundEquation, and MP3SoundObject.

virtual void ProcessPreview_DrawSoundBuffer VirtualMachine::InternalViewPort _pViewport,
float *  _pSoundBuffer,
unsigned int  _bufferlength
[protected, virtual]
 

Tool to draw a preview of the current sound signal.

Parameters:
_pViewport where to draw
_pSoundBuffer float left/right table
_bufferlength number of right/left on the table.

virtual void ProcessSoundInterupt VirtualMachine::SoundBufferToAddYourSignal _SoundBufferToAddYourSignal  )  [virtual]
 

If the media had to generate real time sounds, ProcessSoundInterupt will be called by a machine. There is a default behaviour for this method, which does nothing. the float buffer accumulate the whole machine sound.

Parameters:
_SoundBufferToAddYourSignal description of the buffer to fill.

Reimplemented in MediaTimePattern, MediaSoundEquation, and MP3SoundObject.

virtual unsigned int ReadFile const char *  _pFileName  )  [virtual, inherited]
 

Try to read a serialized form, using Serialize_In().

Parameters:
_pFileName the file path.
Returns:
0 if OK.

void RegisterSerializableMember BaseType _object  )  [protected, inherited]
 

Register any serializable object to serialize for read or write operation, Use it in objects constructors. The object are serialized in the file in the same order as they are given by this method.

Parameters:
_object reference to the member, which must inherit from BaseType.

void RegisterToolMethod unsigned int  _MethodID,
unsigned int  _MethodflagInfo,
const char *  _pShortDisplayName,
const char *  _pDisplayHelp
[protected, inherited]
 

Register a tool method. Do not use it directly, use macro version BASEOBJECT_REGISTER_TOOLMETHOD() It should be set in the constructors.

virtual const unsigned char* Serialize_In const unsigned char *  _pDescriptionChunk  )  [virtual, inherited]
 

Read the object description from a byte chunk. Could crash if chunk not valid.

Parameters:
_pDescriptionChunk the objet description chunk.
Returns:
the end of the chunk written, possibly unlocated. Don't use this if you don't need it.

Reimplemented from PackStruct.

Reimplemented in BaseContext, and ClassNode.

virtual unsigned char* Serialize_Out unsigned char *  _pDescriptionChunkToFill  )  [virtual, inherited]
 

write the Current object definition to a Chunk using private packed types, recursively.

Parameters:
_pDescriptionChunkToFill the chunk where to write the objet description chunk.
Returns:
the end of the chunk written, possibly unlocated. Don't use this if you don't need it.

Reimplemented from PackStruct.

Reimplemented in BaseContext, and ClassNode.

void SetBaseContext BaseContext _pBaseContext  )  [inherited]
 

The BaseContext the Object belong to. Should only be used by BaseContext at object creation. As it is set after construction, the chunk initialisation continue there the initialisation of registered members.

Parameters:
_pBaseContext 

void SetFirstReferenceToThisObject PackObjectReference _pReference  )  [inline, inherited]
 

set FirstReferenceToThisObject, should be used privately.

Parameters:
_pReference FirstReferenceToThisObject

Definition at line 304 of file BaseObject.h.

References BaseObject::m_pFirstReferenceToThisObject.

void SetMemberInfo const char *  _MemberInfo  )  [inherited]
 

Explicits the use of an object when used as a class member. It should explain what the member does for the object. It exists only in editable mode,and can be used by any GUI. Don't use html tags , only \n are allowed. Use REGISTER_MEMBER_INFO macro after the REGISTER_MEMBER macro in the constructors. It can be left NULL.

Parameters:
_MemberName a short string explaining what's the object for.

void SetMemberName const char *  _MemberName  )  [inherited]
 

Explicits the name of an object when used as a class member. It exists only in editable mode, and then can be used by any GUI. A member with an infoString not NULL, should be drawn in a GUI and receive updates. an object member with GetMemberName() returning NULL should not be edited by an interface or undo-managed. Use REGISTER_MEMBER macros family: it registers the members and use SetMemberName() automatically (or not, according to the compilation mode).

Parameters:
_MemberName the member name

void SetName const char *  _pname  )  [inherited]
 

set the name of the object as a character string. This is copied of course.

Parameters:
_pname teh new name

virtual void SetObjectThatManagesThis BaseObject _pManager  )  [virtual, inherited]
 

The Object this one belong to as a member. Should only be used at init.

Parameters:
_pManager BaseObject

Reimplemented from BaseType.

Reimplemented in PackResource.

virtual void SetSound bool  _Enable  )  [virtual]
 

Use SetSound() to enable sound capabilities for a media object, and the machine should then send ProcessSoundInterupt() to mix it. SetSound(true) at start and SetSound(false) at closing, have to be performed by external code, and should not be used by AzurVeda objects in their methods. Note: SetSound(true) enable One object, but this object can point other Media objects in the context with SetSound(false), and use ProcessSoundInterupt() recursively to mix all of them. So an object with SetSound(false) can still be noisy.

In its default behaviour, SetSound() uses the default AzurVeda machine, GetMachine()

Parameters:
_Enable true start sound, false stop it.

void SetUniqueReference unsigned int  _referenceIndex  )  [inline, inherited]
 

Used by the context to set the reference index for serialization, to manage PackObjectReference serialisation:.

Parameters:
_referenceIndex the unique index of the object in the whole database.

Definition at line 311 of file BaseObject.h.

References BaseObject::mSer_UniqueReference, and PackULong::Set().

virtual void StartPreview  )  [virtual]
 

any suit of call to ProcessPreview() should be done between StartPreview() and EndPreview() . EndPreview(). This is needed to stop sound mixing from the object when the preview change.

Reimplemented from BaseObject.

virtual const char* ValueToString  )  [virtual, inherited]
 

convert the value of this object to an explicit string. The object manages the string privately, so just read it or copy it. the string would be destroyed with the objects, and changed when using Set() methods. Note: this is not virtual, but each class can manage m_pValueString or not.

Returns:
the value as a const string.

Reimplemented from BaseType.

Reimplemented in PackDynamicType.

virtual unsigned int WriteFile const char *  _pFileName  )  [virtual, inherited]
 

write a serialized form, using GetSerializedDescriptionSize() and Serialize_Out().

Parameters:
_pFileName the file path.
Returns:
0 if OK.


Member Data Documentation

float m_CreationRate [protected, inherited]
 

the rate of creation, 0.0f if created, 1.0f if not created at all.

Definition at line 489 of file BaseObject.h.

Referenced by BaseObject::GetCreationRate().

const ClassDescription m_Description [static, inherited]
 

the static class description object, to be reimplemented in each class to describe it, with BASEOBJECT_DECLARE_VIRTUALCLASS / BASEOBJECT_DECLARE_CLASS macros

Definition at line 243 of file BaseObject.h.

Referenced by InterfacePrefObject::Edited::Edited(), MediaTimePattern::PartToPlay::PartToPlay(), and InterfacePrefObject::PreviewEdited::PreviewEdited().

PackString m_LastCreationErrorString [protected, inherited]
 

In editable mode, if Create() fail, this string may be inited.

Definition at line 485 of file BaseObject.h.

double m_MediaTimeLength [protected]
 

Total Time length of this media, in seconds, when played at normal speed. Can be used or not.

Definition at line 130 of file VirtualMedia.h.

Referenced by GetTimeLength().

unsigned int m_NumberOfCell [protected, inherited]
 

the number of cell.

Definition at line 197 of file PackStruct.h.

Referenced by PackStruct::GetNumberOfCell().

PackString m_ObjectInfoLine [protected, inherited]
 

In editable mode, an information output to display, in any form. usually given by ProcessPreview().

Definition at line 481 of file BaseObject.h.

Referenced by BaseObject::GetObjectInfoLine().

BaseContext* m_pBaseContext [protected, inherited]
 

an object can belong (or not) to a BaseContext, as an object.

Definition at line 93 of file NamedObject.h.

Referenced by BaseObject::GetContext().

const char* m_pErrorString_Memory [static, protected, inherited]
 

some optimsation stuff to not make the executable string table grow too much...

Definition at line 542 of file BaseObject.h.

Cell* m_pFirstCell [protected, inherited]
 

member that manages the list of members to serialize automatically.

Definition at line 193 of file PackStruct.h.

Referenced by PackStruct::GetFirstCell().

PackObjectReference* m_pFirstReferenceToThisObject [protected, inherited]
 

In editable mode, trace the list of all reference to this object:.

Definition at line 493 of file BaseObject.h.

Referenced by BaseObject::GetFirstReferenceToThisObject(), and BaseObject::SetFirstReferenceToThisObject().

ToolMethodCell* m_pFirstToolMethodCell [protected, inherited]
 

next method or 0L.

Definition at line 538 of file BaseObject.h.

Cell* m_pLastCell [protected, inherited]
 

another member that manages the list of members to serialize automatically, and allow to grow the list by the end.

Definition at line 195 of file PackStruct.h.

Referenced by PackStruct::GetLastCell().

const char* m_pMemberInfo [protected, inherited]
 

a short string explaining what's the object for in editable mode. OK if NULL (no info).

Definition at line 259 of file BaseType.h.

Referenced by BaseType::GetMemberInfo().

const char* m_pMemberName [protected, inherited]
 

If used as a member in an object, the member name, or NULL (not editable member).

Definition at line 255 of file BaseType.h.

Referenced by BaseType::GetMemberName().

BaseObject* m_pObjectThatManagesThis [protected, inherited]
 

an object can belong (or not) to a BaseObject,( and to a BaseContext through it).

Definition at line 251 of file BaseType.h.

Referenced by BaseType::GetObjectThatManagesThis().

unsigned char* m_pPreviousValueShape [protected, inherited]
 

used as a temp for object change notification in Begin/EndChangeNotification():

Definition at line 269 of file BaseType.h.

PackString* m_pValueString [protected, inherited]
 

a string standing for an expression of the value of the object:

Definition at line 264 of file BaseType.h.

bool m_SoundIsMixed [protected]
 

true if m_MediaSoundInterface is currently registered to VirtualMachine as playing sound.

Definition at line 128 of file VirtualMedia.h.

PackULong mSer_UniqueReference [protected, inherited]
 

Unique reference used only for serilalization, and PackObjectReference resolution.

Definition at line 468 of file BaseObject.h.

Referenced by BaseObject::GetUniqueReference(), and BaseObject::SetUniqueReference().

PackString mSerStr_ObjectName [protected, inherited]
 

Serializable member that stands for the name of the object, and can be used to reference it in the context database. A name should not (and can't) be used twice in the whole context.

Definition at line 90 of file NamedObject.h.

Referenced by NamedObject::GetName().

PackULong mSerUlong_ChunkLength [protected, inherited]
 

all named objects, ClassNode and BaseObjects, has the ability to jump over the chunk without reading it:

Definition at line 86 of file NamedObject.h.

Referenced by NamedObject::GetChunkLength().


The documentation for this class was generated from the following file:
      /\/\        4         N         k         !         N         D
                      _______  _ __ ___  _____            ___ _ _  ____
     ___________  __//___   /________  |/    / ___________\_______/    \
    /   _   _   \/   _     /    _   /      _/_/____/    _       __     /
   /    /   /       /     /    /    \      \/     /    /    \   \     /
  \\___/___/___/    ¯    _____/_____/       ______\___/_____/\________\\
               \________/_ ___ __ l____\      /elD!  
                 http://www.m4nkind.com \____/