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

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
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);
+}

Powered by Google App Engine
This is Rietveld 408576698