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

Unified Diff: runtime/embedders/android/sound_service.h

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/sound_service.h
===================================================================
--- runtime/embedders/android/sound_service.h (revision 16869)
+++ runtime/embedders/android/sound_service.h (working copy)
@@ -9,6 +9,8 @@
#include <SLES/OpenSLES.h>
#include <SLES/OpenSLES_Android.h>
#include <SLES/OpenSLES_AndroidConfiguration.h>
+#include <vector>
+#include "embedders/android/sample.h"
#include "embedders/android/types.h"
class SoundService {
@@ -20,7 +22,26 @@
int32_t PlayBackground(const char* path);
void StopBackground();
+ // Optional, for preloading.
+ int32_t LoadSample(const char* path) {
+ return (GetSample(path) == NULL) ? -1 : 0;
+ }
+
+ int32_t PlaySample(const char* path);
+
private:
+ typedef std::vector<Sample*> samples_t;
+
+ int32_t CreateAudioPlayer(SLEngineItf engine_if,
+ const SLInterfaceID extra_if,
+ SLDataSource data_source,
+ SLDataSink data_sink,
+ SLObjectItf& player_out,
+ SLPlayItf& player_if_out);
+
+ int32_t StartSamplePlayer();
+ Sample* GetSample(const char* path);
+
android_app* application_;
SLObjectItf engine_;
SLEngineItf engine_if_;
@@ -28,8 +49,12 @@
SLObjectItf background_player_;
SLPlayItf background_player_if_;
SLSeekItf background_player_seek_if_;
+ SLObjectItf sample_player_;
+ SLPlayItf sample_player_if_;
+ SLBufferQueueItf sample_player_queue_;
+ samples_t samples_;
};
-void PlayBackground(const char* path);
-void StopBackground();
+int32_t PlayBackgroundSound(const char* path);
+void StopBackgroundSound();
#endif // EMBEDDERS_ANDROID_SOUND_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698