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

Unified Diff: chrome/browser/chromeos/audio_mixer_alsa.h

Issue 6118006: Save/Restore ALSA volume/mute (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/chromeos
Patch Set: final fixing up Created 9 years, 11 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_mixer_alsa.h
diff --git a/chrome/browser/chromeos/audio_mixer_alsa.h b/chrome/browser/chromeos/audio_mixer_alsa.h
index d365a223dd080a1837c769c28924136d6bdb7715..7a36acc6a03992a3828d0c70baa96ca327330c3d 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 volume, bool 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_;
+ BooleanPrefMember mute_pref_;
+ RealPrefMember volume_pref_;
+
scoped_ptr<base::Thread> thread_;
DISALLOW_COPY_AND_ASSIGN(AudioMixerAlsa);
« no previous file with comments | « no previous file | chrome/browser/chromeos/audio_mixer_alsa.cc » ('j') | chrome/browser/chromeos/audio_mixer_alsa.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698