Index: media/audio/mac/audio_device_listener_mac.h |
diff --git a/media/audio/mac/audio_device_listener_mac.h b/media/audio/mac/audio_device_listener_mac.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..7e8f6c5d9a759856c4271cac450b9899e2f990f6 |
--- /dev/null |
+++ b/media/audio/mac/audio_device_listener_mac.h |
@@ -0,0 +1,39 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef MEDIA_AUDIO_MAC_AUDIO_DEVICE_LISTENER_MAC_H_ |
+#define MEDIA_AUDIO_MAC_AUDIO_DEVICE_LISTENER_MAC_H_ |
+ |
+#include <CoreAudio/CoreAudio.h> |
+ |
+#include "base/callback.h" |
+#include "base/threading/thread_checker.h" |
+#include "media/base/media_export.h" |
+ |
+namespace media { |
+ |
+// Listens for default device changes and forwards them to AudioManagerMac so it |
+// can notify downstream clients. Only output device changes are supported |
+// currently. |
+class MEDIA_EXPORT AudioDeviceListenerMac { |
+ public: |
+ explicit AudioDeviceListenerMac(const base::Closure& listener_cb); |
DaleCurtis
2012/10/29 01:58:45
Include comment from the Windows version that |lis
sail
2012/10/29 04:21:46
Done.
|
+ ~AudioDeviceListenerMac(); |
+ |
+ private: |
+ friend class AudioDeviceListenerMacTest; |
+ |
+ static OSStatus OnDefaultDeviceChanged( |
DaleCurtis
2012/10/29 01:58:45
Just make this a static method within the class si
sail
2012/10/29 04:21:46
Done.
|
+ AudioObjectID object, |
+ UInt32 size, |
+ const AudioObjectPropertyAddress addresses[], |
+ void* context); |
+ |
+ base::Closure listener_cb_; |
+ base::ThreadChecker thread_checker_; |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_AUDIO_MAC_AUDIO_DEVICE_LISTENER_MAC_H_ |