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  TextAnchorPoint {
  TextAnchorPoint::TopLeftOfText,
  TextAnchorPoint::TopLeftOfBox,
  TextAnchorPoint::Center
}
 
enum  TextHorizontalAlignment {
  TextHorizontalAlignment::Left,
  TextHorizontalAlignment::Center,
  TextHorizontalAlignment::Right
}
 
enum  TextVerticalAlignment {
  TextVerticalAlignment::Top,
  TextVerticalAlignment::Center,
  TextVerticalAlignment::Bottom
}
 
enum  Lifetime {
  Lifetime::UntilNextBegin,
  Lifetime::UntilRemoved
}
 

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 videoTimeMs)=0
 

Member Enumeration Documentation

◆ Lifetime

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

Enumerator
UntilNextBegin 

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.

UntilRemoved 

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.

◆ TextAnchorPoint

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

Enumerator
TopLeftOfText 

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

TopLeftOfBox 

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.

◆ TextHorizontalAlignment

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

Enumerator
Left 
Center 
Right 

◆ TextVerticalAlignment

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

Enumerator
Top 
Center 
Bottom 

Constructor & Destructor Documentation

◆ ~IYIClosedCaptionsRenderer()

virtual IYIClosedCaptionsRenderer::~IYIClosedCaptionsRenderer ( )
inlinevirtual

Member Function Documentation

◆ AddCue()

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

Adds a subtitle cue for rendering.

Implemented in CYIClosedCaptionsDispatcher.

◆ Begin()

virtual void IYIClosedCaptionsRenderer::Begin ( )
pure virtual

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

This should be called before any new cues are added.

Implemented in CYIClosedCaptionsDispatcher.

◆ Clear()

virtual void IYIClosedCaptionsRenderer::Clear ( )
pure virtual

Clears any displayed closed captions.

Implemented in CYIClosedCaptionsDispatcher.

◆ End()

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.

◆ OnVideoTimeUpdated()

virtual void IYIClosedCaptionsRenderer::OnVideoTimeUpdated ( uint64_t  videoTimeMs)
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.

◆ RemoveCues()

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: