16 #ifndef ACSDKNOTIFICATIONS_NOTIFICATIONRENDERER_H_ 17 #define ACSDKNOTIFICATIONS_NOTIFICATIONRENDERER_H_ 20 #include <unordered_set> 36 namespace acsdkNotifications {
50 ,
public std::enable_shared_from_this<NotificationRenderer> {
67 const std::shared_ptr<acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface>&
72 const std::shared_ptr<acsdkShutdownManagerInterfaces::ShutdownNotifierInterface>& shutdownNotifier);
83 static std::shared_ptr<NotificationRenderer>
create(
84 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> mediaPlayer,
85 std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface> focusManager);
90 std::shared_ptr<acsdkNotificationsInterfaces::NotificationRendererObserverInterface> observer)
override;
92 std::shared_ptr<acsdkNotificationsInterfaces::NotificationRendererObserverInterface> observer)
override;
174 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> mediaPlayer,
175 std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface> focusManager);
184 void onRenderingFinished(
SourceId sourceId);
192 bool setState(State newState);
201 bool setStateLocked(State newState);
214 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_mediaPlayer;
218 std::shared_ptr<avsCommon::sdkInterfaces::FocusManagerInterface> m_focusManager;
226 std::unordered_set<std::shared_ptr<acsdkNotificationsInterfaces::NotificationRendererObserverInterface>>
233 std::condition_variable m_wakeTrigger;
248 std::future<void> m_renderFallbackFuture;
261 friend std::ostream&
operator<<(std::ostream& stream,
const NotificationRenderer::State state);
267 #endif // ACSDKNOTIFICATIONS_NOTIFICATIONRENDERER_H_ Definition: AudioFocusAnnotation.h:25
bool renderNotification(std::function< std::pair< std::unique_ptr< std::istream >, const avsCommon::utils::MediaType >()> audioFactory, const std::string &url) override
MixingBehavior
Definition: MixingBehavior.h:25
void onPlaybackFinished(SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
::std::string string
Definition: gtest-port.h:1097
Single-thread executor implementation.
Definition: Executor.h:45
Definition: RequiresShutdown.h:32
Definition: NotificationRenderer.h:45
MediaType
Definition: MediaType.h:29
static const constexpr char * NOTIFICATIONS_MEDIA_PLAYER_NAME
String to identify the notifications media player to render audio.
Definition: NotificationRenderer.h:39
void onPlaybackStopped(SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
FocusState
Definition: FocusState.h:29
Definition: FocusManagerInterface.h:54
friend std::ostream & operator<<(std::ostream &stream, const NotificationRenderer::State state)
void onPlaybackStarted(SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
static std::shared_ptr< NotificationRendererInterface > createNotificationRendererInterface(const std::shared_ptr< acsdkApplicationAudioPipelineFactoryInterfaces::ApplicationAudioPipelineFactoryInterface > &audioPipelineFactory, acsdkManufactory::Annotated< avsCommon::sdkInterfaces::AudioFocusAnnotation, avsCommon::sdkInterfaces::FocusManagerInterface > audioFocusManager, const std::shared_ptr< acsdkShutdownManagerInterfaces::ShutdownNotifierInterface > &shutdownNotifier)
Definition: Annotated.h:35
void onFocusChanged(alexaClientSDK::avsCommon::avs::FocusState newFocus, avsCommon::avs::MixingBehavior behavior) override
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void onPlaybackError(SourceId sourceId, const avsCommon::utils::mediaPlayer::ErrorType &type, std::string error, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
Definition: ChannelObserverInterface.h:29
void onFirstByteRead(SourceId sourceId, const avsCommon::utils::mediaPlayer::MediaPlayerState &state) override
static std::shared_ptr< NotificationRenderer > create(std::shared_ptr< avsCommon::utils::mediaPlayer::MediaPlayerInterface > mediaPlayer, std::shared_ptr< avsCommon::sdkInterfaces::FocusManagerInterface > focusManager)
type
Definition: upload.py:443
void doShutdown() override
bool cancelNotificationRendering() override
void addObserver(std::shared_ptr< acsdkNotificationsInterfaces::NotificationRendererObserverInterface > observer) override
void removeObserver(std::shared_ptr< acsdkNotificationsInterfaces::NotificationRendererObserverInterface > observer) override
Definition: NotificationRendererInterface.h:34