| 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 | 4 |
| 5 #include "media/audio/mac/audio_unified_mac.h" | 5 #include "media/audio/mac/audio_unified_mac.h" |
| 6 | 6 |
| 7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 OSSTATUS_DCHECK(result == noErr, result); | 271 OSSTATUS_DCHECK(result == noErr, result); |
| 272 | 272 |
| 273 if (result == noErr) | 273 if (result == noErr) |
| 274 is_playing_ = true; | 274 is_playing_ = true; |
| 275 } | 275 } |
| 276 | 276 |
| 277 void AudioHardwareUnifiedStream::Stop() { | 277 void AudioHardwareUnifiedStream::Stop() { |
| 278 if (!is_playing_) | 278 if (!is_playing_) |
| 279 return; | 279 return; |
| 280 | 280 |
| 281 source_ = NULL; | |
| 282 | |
| 283 if (device_ != kAudioObjectUnknown) { | 281 if (device_ != kAudioObjectUnknown) { |
| 284 OSStatus result = AudioDeviceStop(device_, io_proc_id_); | 282 OSStatus result = AudioDeviceStop(device_, io_proc_id_); |
| 285 OSSTATUS_DCHECK(result == noErr, result); | 283 OSSTATUS_DCHECK(result == noErr, result); |
| 286 } | 284 } |
| 287 | 285 |
| 288 is_playing_ = false; | 286 is_playing_ = false; |
| 287 source_ = NULL; |
| 289 } | 288 } |
| 290 | 289 |
| 291 void AudioHardwareUnifiedStream::SetVolume(double volume) { | 290 void AudioHardwareUnifiedStream::SetVolume(double volume) { |
| 292 volume_ = static_cast<float>(volume); | 291 volume_ = static_cast<float>(volume); |
| 293 // TODO(crogers): set volume property | 292 // TODO(crogers): set volume property |
| 294 } | 293 } |
| 295 | 294 |
| 296 void AudioHardwareUnifiedStream::GetVolume(double* volume) { | 295 void AudioHardwareUnifiedStream::GetVolume(double* volume) { |
| 297 *volume = volume_; | 296 *volume = volume_; |
| 298 } | 297 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 return audio_output->Render( | 389 return audio_output->Render( |
| 391 device, | 390 device, |
| 392 now, | 391 now, |
| 393 input_data, | 392 input_data, |
| 394 input_time, | 393 input_time, |
| 395 output_data, | 394 output_data, |
| 396 output_time); | 395 output_time); |
| 397 } | 396 } |
| 398 | 397 |
| 399 } // namespace media | 398 } // namespace media |
| OLD | NEW |