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

Unified Diff: chrome/browser/chromeos/audio/audio_mixer_cras.h

Issue 10873085: Implement two new policies to control muting the audio I/O. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased to ToT. Created 8 years, 3 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: chrome/browser/chromeos/audio/audio_mixer_cras.h
diff --git a/chrome/browser/chromeos/audio/audio_mixer_cras.h b/chrome/browser/chromeos/audio/audio_mixer_cras.h
index ef002abc8230e32e3db65fb68bcda3f39d403d34..5650fb0cfd6ccc7a7135f4ae03329e5a6a95a43e 100644
--- a/chrome/browser/chromeos/audio/audio_mixer_cras.h
+++ b/chrome/browser/chromeos/audio/audio_mixer_cras.h
@@ -29,7 +29,13 @@ class AudioMixerCras : public AudioMixer {
virtual double GetVolumePercent() OVERRIDE;
virtual void SetVolumePercent(double percent) OVERRIDE;
virtual bool IsMuted() OVERRIDE;
- virtual void SetMuted(bool muted) OVERRIDE;
+ virtual void SetMuted(bool mute) OVERRIDE;
+ virtual bool IsMuteLocked() OVERRIDE;
+ virtual void SetMuteLocked(bool locked) OVERRIDE;
+ virtual bool IsCaptureMuted() OVERRIDE;
+ virtual void SetCaptureMuted(bool mute) OVERRIDE;
+ virtual bool IsCaptureMuteLocked() OVERRIDE;
+ virtual void SetCaptureMuteLocked(bool locked) OVERRIDE;
private:
// Tries to connect to CRAS. On failure, posts a delayed Connect() task to
@@ -40,6 +46,10 @@ class AudioMixerCras : public AudioMixer {
// |is_muted_|. No-op if not connected.
void ApplyState();
+ // Calls ApplyState on the proper thread only if no other call is currently
+ // pending.
+ void ApplyStateIfNeeded();
+
// Interfaces to the audio server.
struct cras_client *client_;
@@ -53,6 +63,9 @@ class AudioMixerCras : public AudioMixer {
// Most recently-requested muting state.
bool is_muted_;
+ bool is_mute_locked_;
+ bool is_capture_muted_;
+ bool is_capture_mute_locked_;
// Is there already a pending call to ApplyState() scheduled on |thread_|?
bool apply_is_pending_;
@@ -60,7 +73,8 @@ class AudioMixerCras : public AudioMixer {
// Background thread used for interacting with CRAS.
scoped_ptr<base::Thread> thread_;
- // Guards |volume_percent_|, |is_muted_|, and |apply_is_pending_|.
+ // Guards |volume_percent_|, |is_muted_|, |is_mute_locked_|,
+ // |is_capture_muted_|, |is_capture_mute_locked_|, and |apply_is_pending_|.
base::Lock lock_;
DISALLOW_COPY_AND_ASSIGN(AudioMixerCras);
« no previous file with comments | « chrome/browser/chromeos/audio/audio_mixer_alsa.cc ('k') | chrome/browser/chromeos/audio/audio_mixer_cras.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698