| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // MSVC++ requires this to be set before any other includes to get M_PI. | 4 // MSVC++ requires this to be set before any other includes to get M_PI. |
| 5 #define _USE_MATH_DEFINES | 5 #define _USE_MATH_DEFINES |
| 6 | 6 |
| 7 #include "media/audio/simple_sources.h" | 7 #include "media/audio/simple_sources.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Stop playing if we've played out the whole file. | 216 // Stop playing if we've played out the whole file. |
| 217 if (wav_audio_handler_->AtEnd(wav_file_read_pos_)) | 217 if (wav_audio_handler_->AtEnd(wav_file_read_pos_)) |
| 218 return 0; | 218 return 0; |
| 219 | 219 |
| 220 // This pulls data from ProvideInput. | 220 // This pulls data from ProvideInput. |
| 221 file_audio_converter_->Convert(audio_bus); | 221 file_audio_converter_->Convert(audio_bus); |
| 222 return audio_bus->frames(); | 222 return audio_bus->frames(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 double FileSource::ProvideInput(AudioBus* audio_bus_into_converter, | 225 double FileSource::ProvideInput(AudioBus* audio_bus_into_converter, |
| 226 base::TimeDelta buffer_delay) { | 226 uint32_t frames_delayed) { |
| 227 // Unfilled frames will be zeroed by CopyTo. | 227 // Unfilled frames will be zeroed by CopyTo. |
| 228 size_t bytes_written; | 228 size_t bytes_written; |
| 229 wav_audio_handler_->CopyTo(audio_bus_into_converter, wav_file_read_pos_, | 229 wav_audio_handler_->CopyTo(audio_bus_into_converter, wav_file_read_pos_, |
| 230 &bytes_written); | 230 &bytes_written); |
| 231 wav_file_read_pos_ += bytes_written; | 231 wav_file_read_pos_ += bytes_written; |
| 232 return 1.0; | 232 return 1.0; |
| 233 } | 233 } |
| 234 | 234 |
| 235 void FileSource::OnError(AudioOutputStream* stream) { | 235 void FileSource::OnError(AudioOutputStream* stream) { |
| 236 } | 236 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 } | 302 } |
| 303 | 303 |
| 304 void BeepingSource::OnError(AudioOutputStream* stream) { | 304 void BeepingSource::OnError(AudioOutputStream* stream) { |
| 305 } | 305 } |
| 306 | 306 |
| 307 void BeepingSource::BeepOnce() { | 307 void BeepingSource::BeepOnce() { |
| 308 g_beep_context.Pointer()->SetBeepOnce(true); | 308 g_beep_context.Pointer()->SetBeepOnce(true); |
| 309 } | 309 } |
| 310 | 310 |
| 311 } // namespace media | 311 } // namespace media |
| OLD | NEW |