| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "embedders/openglui/android/android_sound_handler.h" | 5 #include "embedders/openglui/android/android_sound_handler.h" |
| 6 | 6 |
| 7 #include "embedders/openglui/android/android_resource.h" | 7 #include "embedders/openglui/android/android_resource.h" |
| 8 #include "embedders/openglui/common/log.h" | 8 #include "embedders/openglui/common/log.h" |
| 9 | 9 |
| 10 AndroidSoundHandler::AndroidSoundHandler(android_app* application) | 10 AndroidSoundHandler::AndroidSoundHandler(android_app* application) |
| 11 : SoundHandler(), | 11 : SoundHandler(), |
| 12 application_(application), | 12 application_(application), |
| 13 engine_(NULL), | 13 engine_(NULL), |
| 14 engine_if_(NULL), | 14 engine_if_(NULL), |
| 15 output_mix_(NULL), | 15 output_mix_(NULL), |
| 16 background_player_(NULL), | 16 background_player_(NULL), |
| 17 background_player_if_(NULL), | 17 background_player_if_(NULL), |
| 18 background_player_seek_if_(NULL), | 18 background_player_seek_if_(NULL), |
| 19 sample_player_(NULL), | 19 sample_player_(NULL), |
| 20 sample_player_if_(NULL), | 20 sample_player_if_(NULL), |
| 21 sample_player_queue_(NULL) { | 21 sample_player_queue_(NULL) { |
| 22 SoundHandler::instance_ = this; | |
| 23 } | 22 } |
| 24 | 23 |
| 25 int32_t AndroidSoundHandler::Start() { | 24 int32_t AndroidSoundHandler::Start() { |
| 26 LOGI("Starting SoundService"); | 25 LOGI("Starting SoundService"); |
| 27 | 26 |
| 28 const SLInterfaceID k_engine_mix_IIDs[] = { SL_IID_ENGINE }; | 27 const SLInterfaceID k_engine_mix_IIDs[] = { SL_IID_ENGINE }; |
| 29 const SLboolean k_engine_mix_reqs[] = { SL_BOOLEAN_TRUE }; | 28 const SLboolean k_engine_mix_reqs[] = { SL_BOOLEAN_TRUE }; |
| 30 const SLInterfaceID k_output_mix_IIDs[] = {}; | 29 const SLInterfaceID k_output_mix_IIDs[] = {}; |
| 31 const SLboolean k_output_mix_reqs[] = {}; | 30 const SLboolean k_output_mix_reqs[] = {}; |
| 32 int32_t res = slCreateEngine(&engine_, 0, NULL, 1, | 31 int32_t res = slCreateEngine(&engine_, 0, NULL, 1, |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 return 0; | 268 return 0; |
| 270 } | 269 } |
| 271 LOGE("Enqueueing sample failed"); | 270 LOGE("Enqueueing sample failed"); |
| 272 } | 271 } |
| 273 } | 272 } |
| 274 } | 273 } |
| 275 return -1; | 274 return -1; |
| 276 } | 275 } |
| 277 | 276 |
| 278 | 277 |
| OLD | NEW |