Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(436)

Unified Diff: runtime/embedders/android/main.cc

Issue 11823034: Backport some work from sample to embedder: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/embedders/android/graphics.cc ('k') | runtime/embedders/android/resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/embedders/android/main.cc
===================================================================
--- runtime/embedders/android/main.cc (revision 16869)
+++ runtime/embedders/android/main.cc (working copy)
@@ -14,26 +14,33 @@
void android_main(android_app* application) {
Timer timer;
Graphics graphics(application, &timer);
- VMGlue vmGlue(&graphics);
- InputService inputService(application, &vmGlue,
+ VMGlue vm_glue(&graphics);
+ InputService input_handler(application, &vm_glue,
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 app_context;
+ app_context.graphics = &graphics;
+ app_context.input_handler = &input_handler;
+ app_context.sound_service = &sound_service;
+ app_context.timer = &timer;
+ app_context.vm_glue = &vm_glue;
EventLoop eventLoop(application);
- DartHost host(&context);
- eventLoop.Run(&host, &context);
+ DartHost host(&app_context);
+ eventLoop.Run(&host, &app_context);
}
-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);
+}
« no previous file with comments | « runtime/embedders/android/graphics.cc ('k') | runtime/embedders/android/resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698