diff options
Diffstat (limited to 'chrome/browser/chromeos/audio_mixer_alsa.h')
| -rw-r--r-- | chrome/browser/chromeos/audio_mixer_alsa.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/audio_mixer_alsa.h b/chrome/browser/chromeos/audio_mixer_alsa.h index d365a22..2cd8489 100644 --- a/chrome/browser/chromeos/audio_mixer_alsa.h +++ b/chrome/browser/chromeos/audio_mixer_alsa.h @@ -12,6 +12,7 @@ #include "base/scoped_ptr.h" #include "base/threading/thread.h" #include "chrome/browser/chromeos/audio_mixer.h" +#include "chrome/browser/prefs/pref_member.h" struct _snd_mixer_elem; struct _snd_mixer; @@ -33,17 +34,25 @@ class AudioMixerAlsa : public AudioMixer { virtual void SetMute(bool mute); virtual State GetState() const; + // Registers volume and mute in preferences + static void RegisterPrefs(PrefService* local_state); + private: // Called to do initialization in background from worker thread. void DoInit(InitDoneCallback* callback); - // Helper function to just get our message loop thread going. + // Helper functions to get our message loop thread and prefs initialized. bool InitThread(); + void InitPrefs(); // Try to connect to the ALSA mixer through their simple controls interface, // and cache mixer handle and mixer elements we'll be using. bool InitializeAlsaMixer(); void FreeAlsaMixer(); + void DoSetVolumeMute(double pref_volume, int pref_mute); + + // Access to PrefMember variables must be done on UI thread. + void RestoreVolumeMuteOnUIThread(); // All these internal volume commands must be called with the lock held. double DoGetVolumeDb_Locked() const; @@ -87,6 +96,9 @@ class AudioMixerAlsa : public AudioMixer { _snd_mixer_elem* elem_master_; _snd_mixer_elem* elem_pcm_; + IntegerPrefMember mute_pref_; + RealPrefMember volume_pref_; + scoped_ptr<base::Thread> thread_; DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa); |
