OSDL::Rendering::MultimediaRenderer Class Reference

#include <OSDLMultimediaRenderer.h>

Inheritance diagram for OSDL::Rendering::MultimediaRenderer:

[legend]
Collaboration diagram for OSDL::Rendering::MultimediaRenderer:
[legend]
List of all members.

Detailed Description

This renderer manages all multimedia concerns for the views it is in charge of.

It is triggered by the scheduler, so that at each rendering tick it gets activated.

This multimedia renderer delegates all graphical concerns to an internal video renderer, if any, and all sound concerns to an internal audio renderer, if any.

This kind of renderer is often used as a root renderer, since it is able to federate all multimedia needs for the views.

See also:
OSDL::Engine::Scheduler

Ceylan::View

Definition at line 45 of file OSDLMultimediaRenderer.h.

Public Member Functions

 MultimediaRenderer (bool registerToScheduler=true) throw ( RenderingException )
 Constructs a new multimedia renderer.
virtual ~MultimediaRenderer () throw ()
 Virtual destructor, no view is destroyed.
virtual bool hasVideoRenderer () const throw ()
 Returns whether a video renderer is available.
virtual VideoRenderergetVideoRenderer () const throw ( RenderingException )
 Returns the video renderer currently been used by this multimedia renderer.
virtual void setVideoRenderer (VideoRenderer &newVideoRenderer) throw ()
 Sets the video renderer that should be used by this multimedia renderer.
virtual bool hasAudioRenderer () const throw ()
 Returns whether a audio renderer is available.
virtual AudioRenderergetAudioRenderer () const throw ( RenderingException )
 Returns the audio renderer currently been used by this multimedia renderer.
virtual void setAudioRenderer (AudioRenderer &newAudioRenderer) throw ()
 Sets the audio renderer that should be used by this multimedia renderer.
virtual void render (Events::RenderingTick currentRenderingTick=0) throw ()
 Triggers the actual rendering of all views, for specified rendering tick, if any.
virtual void renderVideo (Events::RenderingTick currentRenderingTick=0)=0 throw ()
 Triggers the actual video rendering of all views, for specified rendering tick, if any.
virtual void renderAudio (Events::RenderingTick currentRenderingTick=0)=0 throw ()
 Triggers the actual audio rendering of all views, for specified rendering tick, if any.
virtual void onRenderingSkipped (Events::RenderingTick skippedRenderingTick) throw ()
 Allows the renderer to be aware that a rendering step has to be skipped.
virtual const std::string toString (Ceylan::VerbosityLevels level=Ceylan::high) const throw ()
 Returns an user-friendly description of the state of this object.

Static Public Member Functions

static bool HasExistingRootRenderer () throw ()
 Tells whether a root renderer is available.
static RendererGetExistingRootRenderer () throw ( RenderingException )
 Returns the one and only one root renderer instance that may be already available.
static void DeleteExistingRootRenderer () throw ( RenderingException )
 Deletes the existing root renderer.
static void DeleteRootRenderer () throw ()
 Deletes the root renderer, if any.

Protected Attributes

VideoRenderer_videoRenderer
 The internally used video renderer being used, if any.
AudioRenderer_audioRenderer
 The internally used audio renderer being used, if any.
RenderCount _renderingDone
 Counts the number of renderings achieved.
RenderCount _renderingSkipped
 Counts the number of renderings skipped.
Events::RenderingTick _lastRender
 Records the last rendering tick.

Private Member Functions

 MultimediaRenderer (const MultimediaRenderer &source) throw ()
 Copy constructor made private to ensure that it will never be called.
MultimediaRendereroperator= (const MultimediaRenderer &source) throw ()
 Assignment operator made private to ensure that it will never be called.


Constructor & Destructor Documentation

MultimediaRenderer::MultimediaRenderer ( bool  registerToScheduler = true  )  throw ( RenderingException ) [explicit]

Constructs a new multimedia renderer.

Parameters:
registerToScheduler iff true, then a scheduler is supposed to exist already, and this renderer is automatically registered to the scheduler so that it gets called at each rendering tick.
Exceptions:
RenderingException if registerToScheduler is true and no scheduler is available.

Definition at line 29 of file OSDLMultimediaRenderer.cc.

MultimediaRenderer::~MultimediaRenderer (  )  throw () [virtual]

Virtual destructor, no view is destroyed.

Definition at line 40 of file OSDLMultimediaRenderer.cc.

OSDL::Rendering::MultimediaRenderer::MultimediaRenderer ( const MultimediaRenderer source  )  throw () [explicit, private]

Copy constructor made private to ensure that it will never be called.

The compiler should complain whenever this undefined constructor is called, implicitly or not.


Member Function Documentation

bool MultimediaRenderer::hasVideoRenderer (  )  const throw () [virtual]

Returns whether a video renderer is available.

Definition at line 49 of file OSDLMultimediaRenderer.cc.

References _videoRenderer.

VideoRenderer & MultimediaRenderer::getVideoRenderer (  )  const throw ( RenderingException ) [virtual]

Returns the video renderer currently been used by this multimedia renderer.

Exceptions:
RenderingException iff no video renderer is available.

Definition at line 58 of file OSDLMultimediaRenderer.cc.

References _videoRenderer.

void MultimediaRenderer::setVideoRenderer ( VideoRenderer newVideoRenderer  )  throw () [virtual]

Sets the video renderer that should be used by this multimedia renderer.

Parameters:
newVideoRenderer the new video renderer.
If a renderer was already registered, it is deallocated first : this renderer takes ownership of its sub-renderers and manages their life cycle.

Definition at line 72 of file OSDLMultimediaRenderer.cc.

bool MultimediaRenderer::hasAudioRenderer (  )  const throw () [virtual]

Returns whether a audio renderer is available.

Definition at line 85 of file OSDLMultimediaRenderer.cc.

References _audioRenderer.

AudioRenderer & MultimediaRenderer::getAudioRenderer (  )  const throw ( RenderingException ) [virtual]

Returns the audio renderer currently been used by this multimedia renderer.

Exceptions:
RenderingException iff no audio renderer is available.

Definition at line 94 of file OSDLMultimediaRenderer.cc.

References _audioRenderer.

void MultimediaRenderer::setAudioRenderer ( AudioRenderer newAudioRenderer  )  throw () [virtual]

Sets the audio renderer that should be used by this multimedia renderer.

Parameters:
newAudioRenderer the new audio renderer.
If a renderer was already registered, it is deallocated first : this renderer takes ownership of its sub-renderers and manages their life cycle.

Definition at line 108 of file OSDLMultimediaRenderer.cc.

void MultimediaRenderer::render ( Events::RenderingTick  currentRenderingTick = 0  )  throw () [virtual]

Triggers the actual rendering of all views, for specified rendering tick, if any.

This method will manage both the video and audio renderings, should the dedicated specialized renderers be available.

Parameters:
currentRenderingTick the rendering tick corresponding to this render step. If the renderer is called from a basic event loop (no scheduler is used), then the rendering tick is meaningless and is always zero.
See also:
renderVideo, renderAudio

Reimplemented from OSDL::Rendering::Renderer.

Definition at line 121 of file OSDLMultimediaRenderer.cc.

References OSDL_MULTIMEDIA_RENDER_LOG.

virtual void OSDL::Rendering::MultimediaRenderer::renderVideo ( Events::RenderingTick  currentRenderingTick = 0  )  throw () [pure virtual]

Triggers the actual video rendering of all views, for specified rendering tick, if any.

This method will manage the video rendering, and is to be called by the overall render method, implemented by all renderers.

Parameters:
currentRenderingTick the rendering tick corresponding to this render step. If the renderer is called from a basic event loop (no scheduler is used), then the rendering tick is meaningless and is always zero.
See also:
render, renderAudio
Note:
This method is used instead of calling directly the internal video renderer so that informations can be more easily shared between the multimedia renderer and its specialized counterparts.

virtual void OSDL::Rendering::MultimediaRenderer::renderAudio ( Events::RenderingTick  currentRenderingTick = 0  )  throw () [pure virtual]

Triggers the actual audio rendering of all views, for specified rendering tick, if any.

This method will manage the audio rendering, and is to be called by the overall render method, implemented by all renderers.

Parameters:
currentRenderingTick the rendering tick corresponding to this render step. If the renderer is called from a basic event loop (no scheduler is used), then the rendering tick is meaningless and is always zero.
See also:
render, renderVideo
Note:
This method is used instead of calling directly the internal audio renderer so that informations can be more easily shared between the multimedia renderer and its specialized counterparts.

void MultimediaRenderer::onRenderingSkipped ( Events::RenderingTick  skippedRenderingTick  )  throw () [virtual]

Allows the renderer to be aware that a rendering step has to be skipped.

It may be a chance for it to trigger counter-measures, such as decreasing the level of detail in order not to slow down the whole process.

Parameters:
skippedRenderingTick the rendering tick that had to be skipped.

Reimplemented from OSDL::Rendering::Renderer.

Definition at line 148 of file OSDLMultimediaRenderer.cc.

References OSDL_MULTIMEDIA_RENDER_LOG.

const string MultimediaRenderer::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const throw () [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Reimplemented from OSDL::Rendering::Renderer.

Definition at line 159 of file OSDLMultimediaRenderer.cc.

References OSDL::Video::Pixels::toString().

MultimediaRenderer& OSDL::Rendering::MultimediaRenderer::operator= ( const MultimediaRenderer source  )  throw () [private]

Assignment operator made private to ensure that it will never be called.

The compiler should complain whenever this undefined operator is called, implicitly or not.

bool Renderer::HasExistingRootRenderer (  )  throw () [static, inherited]

Tells whether a root renderer is available.

Returns:
true iff a root renderer is already available.

Definition at line 123 of file OSDLRenderer.cc.

References OSDL::Rendering::Renderer::_internalRootRenderer.

Referenced by OSDL::Events::EventsModule::enterBasicMainLoop().

Renderer & Renderer::GetExistingRootRenderer (  )  throw ( RenderingException ) [static, inherited]

Returns the one and only one root renderer instance that may be already available.

Note:
The returned value is a reference and not a pointer, to avoid any abnormal deallocation by its users, that should never deallocate the root renderer.
Exceptions:
RenderingException if there is no root renderer already available.
Note:
There is no 'GetRootRenderer' method that would create a root renderer if none was already set, since various renderers could be chosen as the root one.

Definition at line 131 of file OSDLRenderer.cc.

References OSDL::Rendering::Renderer::_internalRootRenderer.

Referenced by OSDL::Events::EventsModule::enterBasicMainLoop().

void Renderer::DeleteExistingRootRenderer (  )  throw ( RenderingException ) [static, inherited]

Deletes the existing root renderer.

Exceptions:
RenderingException if not renderer was available.

Definition at line 142 of file OSDLRenderer.cc.

References OSDL::Rendering::Renderer::_internalRootRenderer.

void Renderer::DeleteRootRenderer (  )  throw () [static, inherited]

Deletes the root renderer, if any.

Definition at line 157 of file OSDLRenderer.cc.

References OSDL::Rendering::Renderer::_internalRootRenderer.


Member Data Documentation

VideoRenderer* OSDL::Rendering::MultimediaRenderer::_videoRenderer [protected]

The internally used video renderer being used, if any.

Definition at line 261 of file OSDLMultimediaRenderer.h.

Referenced by getVideoRenderer(), and hasVideoRenderer().

AudioRenderer* OSDL::Rendering::MultimediaRenderer::_audioRenderer [protected]

The internally used audio renderer being used, if any.

Definition at line 268 of file OSDLMultimediaRenderer.h.

Referenced by getAudioRenderer(), and hasAudioRenderer().

RenderCount OSDL::Rendering::Renderer::_renderingDone [protected, inherited]

Counts the number of renderings achieved.

Definition at line 221 of file OSDLRenderer.h.

RenderCount OSDL::Rendering::Renderer::_renderingSkipped [protected, inherited]

Counts the number of renderings skipped.

Definition at line 228 of file OSDLRenderer.h.

Events::RenderingTick OSDL::Rendering::Renderer::_lastRender [protected, inherited]

Records the last rendering tick.

Useful to check whether no rendering tick was missed.

Definition at line 237 of file OSDLRenderer.h.


The documentation for this class was generated from the following files:
Generated on Fri Mar 30 14:47:29 2007 for OSDL by  doxygen 1.5.1