Chromium Code Reviews| Index: runtime/embedders/android/main.cc |
| =================================================================== |
| --- runtime/embedders/android/main.cc (revision 16869) |
| +++ runtime/embedders/android/main.cc (working copy) |
| @@ -18,22 +18,30 @@ |
| InputService inputService(application, &vmGlue, |
| graphics.width(), graphics.height()); |
| SoundService sound_service(application); |
| - psound_service = &sound_service; |
| - Context context; |
| - context.graphics = &graphics; |
| - context.input_handler = &inputService; |
| - context.sound_service = psound_service; |
| - context.timer = &timer; |
| - context.vm_glue = &vmGlue; |
| + Context appContext = { |
|
vsm
2013/01/09 21:17:21
I was getting a compiler warning with this style o
gram
2013/01/09 22:33:28
I just did field init instead.
|
| + &graphics, |
| + &inputService, |
| + &sound_service, |
| + &timer, |
| + &vmGlue |
| + }; |
| EventLoop eventLoop(application); |
| - DartHost host(&context); |
| - eventLoop.Run(&host, &context); |
| + DartHost host(&appContext); |
| + eventLoop.Run(&host, &appContext); |
| } |
| -void PlayBackground(const char* path) { |
| - psound_service->PlayBackground(path); |
| +int32_t PlayBackgroundSound(const char* path) { |
| + return psound_service->PlayBackground(path); |
| } |
| -void StopBackground() { |
| +void StopBackgroundSound() { |
| psound_service->StopBackground(); |
| } |
| + |
| +int32_t LoadSoundSample(const char* path) { |
| + return psound_service->LoadSample(path); |
| +} |
| + |
| +int32_t PlaySoundSample(const char* path) { |
| + return psound_service->PlaySample(path); |
| +} |