Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(811)

Unified Diff: media/audio/audio_system.h

Issue 2687853002: Switching VirtualKeyboardPrivate keyboard config call stack to receive HasInputDevices() responce a… (Closed)
Patch Set: Fix for compilation error on linux_chromium_chromeos Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_system.h
diff --git a/media/audio/audio_system.h b/media/audio/audio_system.h
index 9db19314e3f929626330d6472ec609e8b245ca50..a11b030c742ab22e6b195f2a40388decd7df488c 100644
--- a/media/audio/audio_system.h
+++ b/media/audio/audio_system.h
@@ -6,7 +6,6 @@
#define MEDIA_AUDIO_AUDIO_SYSTEM_H_
#include "base/callback.h"
-#include "media/audio/audio_device_description.h"
#include "media/base/audio_parameters.h"
#include "media/base/media_export.h"
@@ -20,16 +19,28 @@ class MEDIA_EXPORT AudioSystem {
public:
// Replies are asynchronously sent to the thread the call is issued on.
using OnAudioParamsCallback = base::Callback<void(const AudioParameters&)>;
+ using OnBoolCallback = base::Callback<void(bool)>;
- virtual ~AudioSystem(){};
+ static AudioSystem* Get();
+
+ virtual ~AudioSystem();
// Callback will receive invalid parameters if the device is not found.
virtual void GetInputStreamParameters(
const std::string& device_id,
OnAudioParamsCallback on_params_cb) const = 0;
+ virtual void HasInputDevices(OnBoolCallback on_has_devices_cb) const = 0;
+
// Must not be used for anything but stream creation.
virtual AudioManager* GetAudioManager() const = 0;
+
+ protected:
+ // Sets the global AudioSystem pointer to the specified non-null value.
+ static void SetInstance(AudioSystem* audio_system);
+
+ // Sets the global AudioSystem pointer to null if it equals the specified one.
+ static void ClearInstance(const AudioSystem* audio_system);
};
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698