You.i Engine
IYIClosedCaptionsRenderer Class Referenceabstract

Detailed Description

An interface that describes a class that can render closed captions.

Rendering of closed captions is initiated by a call to Begin(), followed by zero or more calls to the Draw functions, and ends with a call to End(). Implementation may draw as they receive Draw calls, or may wait until the End() call.

Each of the Begin(), Draw and End() receives a reference to a CYIClosedCaptionsAttributes object which indicates what the default style of the closed captions should be. Within a single rendering block, all function calls receive a reference to the same CYIClosedCaptionsAttributes object.

#include <player/YiClosedCaptionsRenderer.h>

Inheritance diagram for IYIClosedCaptionsRenderer:

Classes

struct  Cue
 
struct  Span
 

Public Types

enum  TEXT_ANCHOR_POINT {
  TOP_LEFT_OF_TEXT,
  TOP_LEFT_OF_BOX,
  CENTER
}
 
enum  TEXT_HORIZONTAL_ALIGNMENT {
  ALIGN_LEFT,
  ALIGN_CENTER,
  ALIGN_RIGHT
}
 
enum  TEXT_VERTICAL_ALIGNMENT {
  ALIGN_VERTICALLY_TOP,
  ALIGN_VERTICALLY_CENTER,
  ALIGN_VERTICALLY_BOTTOM
}
 
enum  LIFETIME {
  UNTIL_NEXT_BEGIN,
  UNTIL_REMOVED
}
 

Public Member Functions

virtual ~IYIClosedCaptionsRenderer ()
 
virtual void Clear ()=0
 
virtual void Begin ()=0
 
virtual void End ()=0
 
virtual void AddCue (const Cue &cue)=0
 
virtual void RemoveCues (const CYIString &cueText)=0
 
virtual void OnVideoTimeUpdated (uint64_t uVideoTimeMs)=0
 

Member Enumeration Documentation

An enum that details how long a cue should be rendered for.

Enumerator
UNTIL_NEXT_BEGIN 

The cue should be rendered until the next call to Begin(). The cue may also be removed if it has a duration and that duration has elapsed.

UNTIL_REMOVED 

The cue should be rendered until manually removed by a call to RemoveCues(). The cue may also be removed if it has a duration and that duration has elapsed.

An enum that indicates what provided text positions are in reference to.

Enumerator
TOP_LEFT_OF_TEXT 

Indicates that the provided text position refers to the top-left corner of the rendered text.

TOP_LEFT_OF_BOX 

Indicates that the provided text position refers to the top-left corner of the text box.

CENTER 

Indicates that the provided text position refers to the center of the rendered text.

An enum that specifies how multiple lines of text should be aligned horizontally, relative to each other. For some TEXT_ANCHOR_POINT modes, these values also specify where within the text box the text gets rendered.

Enumerator
ALIGN_LEFT 
ALIGN_CENTER 
ALIGN_RIGHT 

An enum that specifies where, vertically within the text box, the text should be renderered.

Enumerator
ALIGN_VERTICALLY_TOP 
ALIGN_VERTICALLY_CENTER 
ALIGN_VERTICALLY_BOTTOM 

Constructor & Destructor Documentation

virtual IYIClosedCaptionsRenderer::~IYIClosedCaptionsRenderer ( )
inlinevirtual

Member Function Documentation

virtual void IYIClosedCaptionsRenderer::AddCue ( const Cue cue)
pure virtual

Adds a subtitle cue for rendering.

Implemented in CYIClosedCaptionsDispatcher.

virtual void IYIClosedCaptionsRenderer::Begin ( )
pure virtual

Clears any captions that use the timing mode TIMING_MODE::UNTIL_NEXT_BEGIN and marks the beginning of a new set of rendering commands.

This should be called before any new cues are added.

Implemented in CYIClosedCaptionsDispatcher.

virtual void IYIClosedCaptionsRenderer::Clear ( )
pure virtual

Clears any displayed closed captions.

Implemented in CYIClosedCaptionsDispatcher.

virtual void IYIClosedCaptionsRenderer::End ( )
pure virtual

Marks the end of a set of rendering commands.

This should be called once all of the cues necessary to complete the closed captions presentation have been submitted.

Implemented in CYIClosedCaptionsDispatcher.

virtual void IYIClosedCaptionsRenderer::OnVideoTimeUpdated ( uint64_t  uVideoTimeMs)
pure virtual

Called when the video playback time has been updated. This is used to remove time-based closed captions when they expire.

Implemented in CYIClosedCaptionsDispatcher.

virtual void IYIClosedCaptionsRenderer::RemoveCues ( const CYIString cueText)
pure virtual

Removes the subtitle cues identified by the text cueText.

Implemented in CYIClosedCaptionsDispatcher.


The documentation for this class was generated from the following file: