16 #ifndef ACSDK_SAMPLE_TEMPLATERUNTIME_TEMPLATERUNTIMEPRESENTATIONADAPTER_H_ 17 #define ACSDK_SAMPLE_TEMPLATERUNTIME_TEMPLATERUNTIMEPRESENTATIONADAPTER_H_ 22 #include <rapidjson/document.h> 23 #include <rapidjson/writer.h> 36 namespace sampleApplications {
46 ,
public std::enable_shared_from_this<TemplateRuntimePresentationAdapter> {
52 static std::shared_ptr<TemplateRuntimePresentationAdapter>
create();
63 std::shared_ptr<presentationOrchestratorInterfaces::PresentationInterface> presentation)
override;
93 void setExecutor(std::shared_ptr<avsCommon::utils::threading::Executor> executor);
100 const std::weak_ptr<TemplateRuntimePresentationAdapterObserverInterface>& observer);
107 const std::weak_ptr<TemplateRuntimePresentationAdapterObserverInterface>& observer);
126 std::shared_ptr<presentationOrchestratorInterfaces::PresentationOrchestratorClientInterface> poClient);
146 struct DisplayCardSession {
150 DisplayCardSession() =
default;
156 explicit DisplayCardSession(
std::string jsonPayload) :
158 presentation{
nullptr},
165 std::shared_ptr<presentationOrchestratorInterfaces::PresentationInterface> presentation;
172 using DisplayCardSessionPtr = std::shared_ptr<DisplayCardSession>;
177 struct PlayerInfoCardSession : DisplayCardSession {
181 PlayerInfoCardSession() =
default;
188 PlayerInfoCardSession(
192 audioPlayerInfo{
std::move(audioPlayerInfo)} {};
202 using PlayerInfoCardSessionPtr = std::shared_ptr<PlayerInfoCardSession>;
211 std::shared_ptr<TemplateRuntimePresentationAdapterNotifier> m_templateRuntimePresentationAdapterNotifier;
214 std::shared_ptr<presentationOrchestratorInterfaces::PresentationOrchestratorClientInterface>
215 m_presentationOrchestratorClient;
224 DisplayCardSessionPtr m_displayCardSession;
227 PlayerInfoCardSessionPtr m_playerInfoCardSession;
230 std::chrono::milliseconds m_audioPlaybackFinishedTimeout;
233 std::chrono::milliseconds m_audioPlaybackStoppedPausedTimeout;
242 std::shared_ptr<avsCommon::utils::threading::Executor> m_executor;
248 #endif // ACSDK_SAMPLE_TEMPLATERUNTIME_TEMPLATERUNTIMEPRESENTATIONADAPTER_H_
void onPresentationStateChanged(presentationOrchestratorInterfaces::PresentationRequestToken id, presentationOrchestratorInterfaces::PresentationState newState) override
virtual ~TemplateRuntimePresentationAdapter()=default
Definition: TemplateRuntimeObserverInterface.h:39
void renderTemplateCard(const std::string &jsonPayload) override
::std::string string
Definition: gtest-port.h:1097
void renderPlayerInfoCard(const std::string &jsonPayload, templateRuntimeInterfaces::TemplateRuntimeObserverInterface::AudioPlayerInfo audioPlayerInfo) override
void removeTemplateRuntimePresentationAdapterObserver(const std::weak_ptr< TemplateRuntimePresentationAdapterObserverInterface > &observer)
The context of the AudioPlayer when the observer is notified of the PlayerActivity state change...
Definition: AudioPlayerObserverInterface.h:39
Definition: PresentationObserverInterface.h:30
void setRenderPlayerInfoWindowId(const std::string &renderPlayerInfoWindowId)
Definition: AudioPlayerObserverInterface.h:31
void onPlayerActivityChanged(avsCommon::avs::PlayerActivity state, const acsdkAudioPlayerInterfaces::AudioPlayerObserverInterface::Context &context) override
void onPresentationAvailable(presentationOrchestratorInterfaces::PresentationRequestToken id, std::shared_ptr< presentationOrchestratorInterfaces::PresentationInterface > presentation) override
Generic implementation of NotifierInterface.
Definition: Notifier.h:38
void setPresentationOrchestrator(std::shared_ptr< presentationOrchestratorInterfaces::PresentationOrchestratorClientInterface > poClient)
Definition: TemplateRuntimePresentationAdapter.h:42
PresentationState
Definition: PresentationTypes.h:48
Definition: TemplateRuntimeObserverInterface.h:33
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
static std::shared_ptr< TemplateRuntimePresentationAdapter > create()
bool onNavigateBack(presentationOrchestratorInterfaces::PresentationRequestToken id) override
uint64_t PresentationRequestToken
Definition: PresentationTypes.h:25
void addTemplateRuntimePresentationAdapterObserver(const std::weak_ptr< TemplateRuntimePresentationAdapterObserverInterface > &observer)
void setRenderTemplateWindowId(const std::string &renderTemplateWindowId)
void setExecutor(std::shared_ptr< avsCommon::utils::threading::Executor > executor)
PlayerActivity
Identifies the player state.
Definition: PlayerActivity.h:27
const T & move(const T &t)
Definition: gtest-port.h:1317