| 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 int32_t Pause(); | |
| 24 int32_t Resume(); | |
| 25 | |
| 26 int32_t PlayBackground(const char* path); | |
| 27 void StopBackground(); | |
| 28 | |
| 29 int32_t PlaySample(const char* path); | |
| 30 | |
| 31 private: | |
| 32 int32_t CreateAudioPlayer(SLEngineItf engine_if, | |
| 33 const SLInterfaceID extra_if, | |
| 34 SLDataSource data_source, | |
| 35 SLDataSink data_sink, | |
| 36 SLObjectItf& player_out, | |
| 37 SLPlayItf& player_if_out); | |
| 38 | |
| 39 int32_t SetBackgroundPlayerState(int state); | |
| 40 int32_t StartSamplePlayer(); | |
| 41 | |
| 42 android_app* application_; | |
| 43 SLObjectItf engine_; | |
| 44 SLEngineItf engine_if_; | |
| 45 SLObjectItf output_mix_; | |
| 46 SLObjectItf background_player_; | |
| 47 SLPlayItf background_player_if_; | |
| 48 SLSeekItf background_player_seek_if_; | |
| 49 SLObjectItf sample_player_; | |
| 50 SLPlayItf sample_player_if_; | |
| 51 SLBufferQueueItf sample_player_queue_; | |
| 52 }; | |
| 53 | |
| 54 #endif // EMBEDDERS_OPENGLUI_ANDROID_ANDROID_SOUND_HANDLER_H_ | |
| 55 | |
| OLD | NEW |