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

Side by Side Diff: runtime/embedders/openglui/common/sound_handler.h

Issue 11883013: Refactored OpenGL embedder that works on Android, Mac or Linux. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 #ifndef EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_
6 #define EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_
7
8 #include <stdint.h>
9 #include <vector>
10
11 #include "embedders/openglui/common/sample.h"
12
13 class SoundHandler {
14 public:
15 SoundHandler();
16
17 virtual ~SoundHandler() {
18 }
19
20 virtual int32_t Start() {
21 return 0;
22 }
23
24 virtual void Stop() {
25 }
26
27 virtual int32_t PlayBackground(const char* path) {
28 return 0;
29 }
30
31 virtual void StopBackground() {
32 }
33
34 // Optional, for preloading.
35 int32_t LoadSample(const char* path) {
36 return (GetSample(path) == NULL) ? -1 : 0;
37 }
38
39 virtual int32_t PlaySample(const char* path) {
40 return 0;
41 }
42
43 static SoundHandler* instance() {
44 return instance_;
45 }
46
47 protected:
48 typedef std::vector<Sample*> samples_t;
49
50 Sample* GetSample(const char* path);
51
52 samples_t samples_;
53
54 static SoundHandler* instance_;
55 };
56
57 int32_t PlayBackgroundSound(const char* path);
58 void StopBackgroundSound();
59 int32_t LoadSoundSample(const char* path);
60 int32_t PlaySoundSample(const char* path);
61
62 #endif // EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_
63
OLDNEW
« no previous file with comments | « runtime/embedders/openglui/common/sample.h ('k') | runtime/embedders/openglui/common/sound_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698