| 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 #include "embedders/openglui/common/sound_handler.h" | 5 #include "embedders/openglui/common/sound_handler.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "embedders/openglui/common/log.h" | 9 #include "embedders/openglui/common/log.h" |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 Sample* sample = new Sample(path); | 26 Sample* sample = new Sample(path); |
| 27 if (sample->Load() != 0) { | 27 if (sample->Load() != 0) { |
| 28 LOGI("Failed to load sample %s", path); | 28 LOGI("Failed to load sample %s", path); |
| 29 delete sample; | 29 delete sample; |
| 30 return NULL; | 30 return NULL; |
| 31 } | 31 } |
| 32 samples_.push_back(sample); | 32 samples_.push_back(sample); |
| 33 return sample; | 33 return sample; |
| 34 } | 34 } |
| 35 | 35 |
| 36 | |
| 37 int32_t PlayBackgroundSound(const char* path) { | 36 int32_t PlayBackgroundSound(const char* path) { |
| 38 return SoundHandler::instance()->PlayBackground(path); | 37 return SoundHandler::instance()->PlayBackground(path); |
| 39 } | 38 } |
| 40 | 39 |
| 41 void StopBackgroundSound() { | 40 void StopBackgroundSound() { |
| 42 SoundHandler::instance()->StopBackground(); | 41 SoundHandler::instance()->StopBackground(); |
| 43 } | 42 } |
| 44 | 43 |
| 45 int32_t LoadSoundSample(const char* path) { | 44 int32_t LoadSoundSample(const char* path) { |
| 46 return SoundHandler::instance()->LoadSample(path); | 45 return SoundHandler::instance()->LoadSample(path); |
| 47 } | 46 } |
| 48 | 47 |
| 49 int32_t PlaySoundSample(const char* path) { | 48 int32_t PlaySoundSample(const char* path) { |
| 50 return SoundHandler::instance()->PlaySample(path); | 49 return SoundHandler::instance()->PlaySample(path); |
| 51 } | 50 } |
| 52 | 51 |
| OLD | NEW |