AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Types | Public Member Functions | Static Public Member Functions | List of all members
alexaClientSDK::captions::CaptionFrame Class Reference

#include <CaptionFrame.h>

Public Types

using MediaPlayerSourceId = avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId
 Type alias to the media player source ID. More...
 

Public Member Functions

 CaptionFrame (MediaPlayerSourceId sourceId=0, std::chrono::milliseconds duration=std::chrono::milliseconds(0), std::chrono::milliseconds delay=std::chrono::milliseconds(0), const std::vector< CaptionLine > &captionLines={})
 
std::chrono::milliseconds getDuration () const
 
std::chrono::milliseconds getDelay () const
 
MediaPlayerSourceId getSourceId () const
 
std::vector< CaptionLinegetCaptionLines () const
 
bool operator== (const CaptionFrame &rhs) const
 
bool operator!= (const CaptionFrame &rhs) const
 

Static Public Member Functions

static int getLineWrapLimit ()
 

Detailed Description

A container to represent a single frame of captions, with all the metadata needed to format and display the text.

Member Typedef Documentation

◆ MediaPlayerSourceId

Type alias to the media player source ID.

Constructor & Destructor Documentation

◆ CaptionFrame()

alexaClientSDK::captions::CaptionFrame::CaptionFrame ( MediaPlayerSourceId  sourceId = 0,
std::chrono::milliseconds  duration = std::chrono::milliseconds(0),
std::chrono::milliseconds  delay = std::chrono::milliseconds(0),
const std::vector< CaptionLine > &  captionLines = {} 
)

Constructor

Parameters
sourceIdThe media player source ID. CaptionFrames from the same media source share the same ID.
durationA number in milliseconds to determine how long the caption should be displayed on the screen.
delayThe amount of time that should pass before this frame is shown on the screen.
captionTextLinesOne or more CaptionLine objects.

Member Function Documentation

◆ getCaptionLines()

std::vector<CaptionLine> alexaClientSDK::captions::CaptionFrame::getCaptionLines ( ) const

Getter for the caption text, consisting of one or more pairs of strings of text with the styles present for that text. Each pair represents one styled line of caption text.

Returns
One or more CaptionLine objects, each representing one styled line of caption text.

◆ getDelay()

std::chrono::milliseconds alexaClientSDK::captions::CaptionFrame::getDelay ( ) const

The amount of time that should pass before this frame is shown on the screen.

Returns
The delay, in milliseconds.

◆ getDuration()

std::chrono::milliseconds alexaClientSDK::captions::CaptionFrame::getDuration ( ) const

How long the caption text should be displayed on the screen.

Returns
The display duration, in milliseconds.

◆ getLineWrapLimit()

static int alexaClientSDK::captions::CaptionFrame::getLineWrapLimit ( )
static

Get the maximum number of acceptable line wraps that can occur for a single CaptionFrame. This is useful as a guard value to prevent accidental infinite loops when calculating line wraps.

◆ getSourceId()

MediaPlayerSourceId alexaClientSDK::captions::CaptionFrame::getSourceId ( ) const

Getter to return the source ID for this caption content.

Returns
The media source ID.

◆ operator!=()

bool alexaClientSDK::captions::CaptionFrame::operator!= ( const CaptionFrame rhs) const

Operator != for CaptionFrame.

Parameters
rhsThe right hand side of the != operation.
Returns
Whether or not this instance and rhs are not equivalent.

◆ operator==()

bool alexaClientSDK::captions::CaptionFrame::operator== ( const CaptionFrame rhs) const

Operator == for CaptionFrame.

Parameters
rhsThe right hand side of the == operation.
Returns
Whether or not this instance and rhs are equivalent.

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

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0