16 #ifndef SAMPLEAPP_SAMPLEAPPLICATION_H_ 17 #define SAMPLEAPP_SAMPLEAPPLICATION_H_ 23 #include <unordered_map> 47 #ifdef GSTREAMER_MEDIA_PLAYER 49 #elif defined(ANDROID_MEDIA_PLAYER) 53 #ifdef BLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS 73 static std::unique_ptr<SampleApplication>
create(
74 std::shared_ptr<alexaClientSDK::sampleApp::ConsoleReader> consoleReader,
75 const std::vector<std::string>& configFiles,
77 std::shared_ptr<avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface> diagnostics =
nullptr);
94 bool initiateRestart();
105 std::shared_ptr<alexaClientSDK::defaultClient::DefaultClient>
getDefaultClient();
115 const std::shared_ptr<avsCommon::sdkInterfaces::HTTPContentFetcherInterfaceFactoryInterface>&
116 httpContentFetcherFactory,
117 std::shared_ptr<defaultClient::EqualizerRuntimeSetup> equalizerRuntimeSetup);
166 std::shared_ptr<alexaClientSDK::sampleApp::ConsoleReader> consoleReader,
167 const std::vector<std::string>& configFiles,
169 std::shared_ptr<avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface> diagnostics);
180 std::shared_ptr<avsCommon::sdkInterfaces::ApplicationMediaInterfaces> createApplicationMediaPlayer(
181 const std::shared_ptr<avsCommon::sdkInterfaces::HTTPContentFetcherInterfaceFactoryInterface>&
182 httpContentFetcherFactory,
183 bool enableEqualizer,
185 bool enableLiveMode =
false);
187 #ifdef ENABLE_ENDPOINT_CONTROLLERS 196 bool addControllersToDefaultEndpoint(
197 std::shared_ptr<avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface> defaultEndpointBuilder);
207 bool addControllersToPeripheralEndpoint(
208 std::shared_ptr<avsCommon::sdkInterfaces::endpoints::EndpointBuilderInterface> peripheralEndpointBuilder,
209 std::shared_ptr<avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface> diagnostics);
211 std::shared_ptr<acsdkShutdownManagerInterfaces::ShutdownManagerInterface> m_shutdownManager;
215 std::shared_ptr<avsCommon::avs::initialization::AlexaClientSDKInit> m_sdkInit;
218 std::shared_ptr<alexaClientSDK::defaultClient::DefaultClient> m_client;
221 std::shared_ptr<sampleApplications::common::InteractionManager> m_interactionManager;
224 std::shared_ptr<UserInputManager> m_userInputManager;
227 std::shared_ptr<GuiRenderer> m_guiRenderer;
230 std::unordered_map<std::string, std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface>>
231 m_externalMusicProviderMediaPlayersMap;
234 std::unordered_map<std::string, std::shared_ptr<avsCommon::sdkInterfaces::SpeakerInterface>>
235 m_externalMusicProviderSpeakersMap;
238 std::vector<std::shared_ptr<avsCommon::utils::RequiresShutdown>> m_shutdownRequiredList;
241 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_speakMediaPlayer;
244 std::vector<std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface>> m_audioMediaPlayerPool;
247 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_alertsMediaPlayer;
250 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_notificationsMediaPlayer;
253 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_bluetoothMediaPlayer;
256 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_systemSoundMediaPlayer;
258 #ifdef ENABLE_COMMS_AUDIO_PROXY 259 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_commsMediaPlayer;
264 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_phoneMediaPlayer;
269 std::shared_ptr<alexaClientSDK::capabilitiesDelegate::CapabilitiesDelegate> m_capabilitiesDelegate;
272 std::shared_ptr<avsCommon::utils::mediaPlayer::MediaPlayerInterface> m_ringtoneMediaPlayer;
275 static std::unordered_map<std::string, avsCommon::sdkInterfaces::ChannelVolumeInterface::Type>
276 m_playerToSpeakerTypeMap;
281 #if defined(ANDROID_MEDIA_PLAYER) || defined(ANDROID_MICROPHONE) 282 std::shared_ptr<applicationUtilities::androidUtilities::AndroidSLESEngine> m_openSlEngine;
286 #ifdef BLUETOOTH_BLUEZ_PULSEAUDIO_OVERRIDE_ENDPOINTS 287 std::shared_ptr<bluetoothImplementations::blueZ::PulseAudioBluetoothInitializer> m_pulseAudioInitializer;
291 #ifdef POWER_CONTROLLER 292 std::shared_ptr<sampleApplications::common::PeripheralEndpointPowerControllerHandler>
294 m_peripheralEndpointPowerHandler;
297 #ifdef TOGGLE_CONTROLLER 298 std::shared_ptr<sampleApplications::common::PeripheralEndpointToggleControllerHandler>
300 m_peripheralEndpointToggleHandler;
303 #ifdef RANGE_CONTROLLER 304 std::shared_ptr<sampleApplications::common::PeripheralEndpointRangeControllerHandler>
306 m_peripheralEndpointRangeHandler;
309 #ifdef MODE_CONTROLLER 310 std::shared_ptr<sampleApplications::common::PeripheralEndpointModeControllerHandler>
312 m_peripheralEndpointModeHandler;
316 std::shared_ptr<acsdkAuthorization::AuthorizationManager> m_authManager;
319 std::shared_ptr<acsdkAuthorization::lwa::LWAAuthorizationAdapter> m_lwaAdapter;
325 #endif // SAMPLEAPP_SAMPLEAPPLICATION_H_ std::shared_ptr< alexaClientSDK::defaultClient::DefaultClient > getDefaultClient()
::std::string string
Definition: gtest-port.h:1097
Type
Definition: ChannelVolumeInterface.h:37
SampleAppReturnCode run()
~SampleApplication()
Destructor which manages the SampleApplication shutdown sequence.
SampleAppReturnCode
Definition: SampleApplicationReturnCodes.h:24
AdapterRegistration(const std::string &playerId, acsdkExternalMediaPlayer::ExternalMediaPlayer::AdapterCreateFunction createFunction)
Class to manage the top-level components of the AVS Client Application.
Definition: SampleApplication.h:61
bool createMediaPlayersForAdapters(const std::shared_ptr< avsCommon::sdkInterfaces::HTTPContentFetcherInterfaceFactoryInterface > &httpContentFetcherFactory, std::shared_ptr< defaultClient::EqualizerRuntimeSetup > equalizerRuntimeSetup)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
static std::unique_ptr< SampleApplication > create(std::shared_ptr< alexaClientSDK::sampleApp::ConsoleReader > consoleReader, const std::vector< std::string > &configFiles, const std::string &logLevel="", std::shared_ptr< avsCommon::sdkInterfaces::diagnostics::DiagnosticsInterface > diagnostics=nullptr)
Definition: SampleApplication.h:123