OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 #ifndef EMBEDDERS_OPENGLUI_ANDROID_ANDROID_SOUND_HANDLER_H_ |
| 6 #define EMBEDDERS_OPENGLUI_ANDROID_ANDROID_SOUND_HANDLER_H_ |
| 7 |
| 8 #include <android_native_app_glue.h> |
| 9 #include <SLES/OpenSLES.h> |
| 10 #include <SLES/OpenSLES_Android.h> |
| 11 #include <SLES/OpenSLES_AndroidConfiguration.h> |
| 12 #include <vector> |
| 13 |
| 14 #include "embedders/openglui/common/sample.h" |
| 15 #include "embedders/openglui/common/sound_handler.h" |
| 16 #include "embedders/openglui/common/types.h" |
| 17 |
| 18 class AndroidSoundHandler : public SoundHandler { |
| 19 public: |
| 20 explicit AndroidSoundHandler(android_app* application); |
| 21 int32_t Start(); |
| 22 void Stop(); |
| 23 |
| 24 int32_t PlayBackground(const char* path); |
| 25 void StopBackground(); |
| 26 |
| 27 int32_t PlaySample(const char* path); |
| 28 |
| 29 private: |
| 30 int32_t CreateAudioPlayer(SLEngineItf engine_if, |
| 31 const SLInterfaceID extra_if, |
| 32 SLDataSource data_source, |
| 33 SLDataSink data_sink, |
| 34 SLObjectItf& player_out, |
| 35 SLPlayItf& player_if_out); |
| 36 |
| 37 int32_t StartSamplePlayer(); |
| 38 |
| 39 android_app* application_; |
| 40 SLObjectItf engine_; |
| 41 SLEngineItf engine_if_; |
| 42 SLObjectItf output_mix_; |
| 43 SLObjectItf background_player_; |
| 44 SLPlayItf background_player_if_; |
| 45 SLSeekItf background_player_seek_if_; |
| 46 SLObjectItf sample_player_; |
| 47 SLPlayItf sample_player_if_; |
| 48 SLBufferQueueItf sample_player_queue_; |
| 49 }; |
| 50 |
| 51 #endif // EMBEDDERS_OPENGLUI_ANDROID_ANDROID_SOUND_HANDLER_H_ |
| 52 |
OLD | NEW |