| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 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 | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_ | 5 #ifndef EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_ |
| 6 #define EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_ | 6 #define EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "embedders/openglui/common/sample.h" | 11 #include "embedders/openglui/common/sample.h" |
| 12 | 12 |
| 13 class SoundHandler { | 13 class SoundHandler { |
| 14 public: | 14 public: |
| 15 SoundHandler(); | 15 SoundHandler(); |
| 16 | 16 |
| 17 virtual ~SoundHandler() { | 17 virtual ~SoundHandler() { |
| 18 } | 18 } |
| 19 | 19 |
| 20 virtual int32_t Start() { | 20 virtual int32_t Start() { |
| 21 return 0; | 21 return 0; |
| 22 } | 22 } |
| 23 | 23 |
| 24 virtual void Stop() { | 24 virtual void Stop() { |
| 25 } | 25 } |
| 26 | 26 |
| 27 virtual int32_t Suspend() { |
| 28 return 0; |
| 29 } |
| 30 |
| 31 virtual int32_t Resume() { |
| 32 return 0; |
| 33 } |
| 34 |
| 27 virtual int32_t PlayBackground(const char* path) { | 35 virtual int32_t PlayBackground(const char* path) { |
| 28 return 0; | 36 return 0; |
| 29 } | 37 } |
| 30 | 38 |
| 31 virtual void StopBackground() { | 39 virtual void StopBackground() { |
| 32 } | 40 } |
| 33 | 41 |
| 34 // Optional, for preloading. | 42 // Optional, for preloading. |
| 35 int32_t LoadSample(const char* path) { | 43 int32_t LoadSample(const char* path) { |
| 36 return (GetSample(path) == NULL) ? -1 : 0; | 44 return (GetSample(path) == NULL) ? -1 : 0; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 54 static SoundHandler* instance_; | 62 static SoundHandler* instance_; |
| 55 }; | 63 }; |
| 56 | 64 |
| 57 int32_t PlayBackgroundSound(const char* path); | 65 int32_t PlayBackgroundSound(const char* path); |
| 58 void StopBackgroundSound(); | 66 void StopBackgroundSound(); |
| 59 int32_t LoadSoundSample(const char* path); | 67 int32_t LoadSoundSample(const char* path); |
| 60 int32_t PlaySoundSample(const char* path); | 68 int32_t PlaySoundSample(const char* path); |
| 61 | 69 |
| 62 #endif // EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_ | 70 #endif // EMBEDDERS_OPENGLUI_COMMON_SOUND_HANDLER_H_ |
| 63 | 71 |
| OLD | NEW |