AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
CaptionFrame.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_CAPTIONS_INTERFACE_INCLUDE_CAPTIONS_CAPTIONFRAME_H_
17 #define ALEXA_CLIENT_SDK_CAPTIONS_INTERFACE_INCLUDE_CAPTIONS_CAPTIONFRAME_H_
18 
19 #include <chrono>
20 #include <iostream>
21 #include <vector>
22 
24 
25 #include "CaptionLine.h"
26 
27 namespace alexaClientSDK {
28 namespace captions {
29 
33 class CaptionFrame {
34 public:
37 
42  static int getLineWrapLimit();
43 
53  MediaPlayerSourceId sourceId = 0,
54  std::chrono::milliseconds duration = std::chrono::milliseconds(0),
55  std::chrono::milliseconds delay = std::chrono::milliseconds(0),
56  const std::vector<CaptionLine>& captionLines = {});
57 
63  std::chrono::milliseconds getDuration() const;
64 
70  std::chrono::milliseconds getDelay() const;
71 
78 
85  std::vector<CaptionLine> getCaptionLines() const;
86 
93  bool operator==(const CaptionFrame& rhs) const;
94 
101  bool operator!=(const CaptionFrame& rhs) const;
102 
103 private:
105  MediaPlayerSourceId m_id;
106 
108  std::chrono::milliseconds m_duration;
109 
111  std::chrono::milliseconds m_delay;
112 
114  std::vector<CaptionLine> m_captionLines;
115 };
116 
124 std::ostream& operator<<(std::ostream& stream, const CaptionFrame& frame);
125 
126 } // namespace captions
127 } // namespace alexaClientSDK
128 
129 #endif // ALEXA_CLIENT_SDK_CAPTIONS_INTERFACE_INCLUDE_CAPTIONS_CAPTIONFRAME_H_
bool operator==(const CaptionFrame &rhs) const
std::ostream & operator<<(std::ostream &stream, const CaptionFormat &format)
Definition: CaptionFormat.h:59
uint64_t SourceId
A type that identifies which source is currently being operated on. This must be unique across all in...
Definition: MediaPlayerInterface.h:69
Definition: CaptionFrame.h:33
std::vector< CaptionLine > getCaptionLines() const
bool operator!=(const CaptionFrame &rhs) const
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
avsCommon::utils::mediaPlayer::MediaPlayerInterface::SourceId MediaPlayerSourceId
Type alias to the media player source ID.
Definition: CaptionFrame.h:36
std::chrono::milliseconds getDuration() const
std::chrono::milliseconds getDelay() const
MediaPlayerSourceId getSourceId() const
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={})

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