summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/audio/audio_mixer.h
blob: f9489e1c35c3749d25542db3f944fefd1953c545 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// 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 CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_
#define CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_
#pragma once

#include "base/basictypes.h"

namespace chromeos {

class AudioMixer {
 public:
  AudioMixer() {}
  virtual ~AudioMixer() {}

  // Initializes the connection to the device.  This must be called on the UI
  // thread; blocking tasks may take place in the background.  Note that the
  // other methods in this interface can be called before Init().
  virtual void Init() = 0;

  // Returns the most-recently-set volume, in the range [0.0, 100.0].
  virtual double GetVolumePercent() = 0;

  // Sets the volume, possibly asynchronously.
  // |percent| should be in the range [0.0, 100.0].
  virtual void SetVolumePercent(double percent) = 0;

  // Is the device currently muted?
  virtual bool IsMuted() = 0;

  // Mutes or unmutes the device, possibly asynchronously.
  virtual void SetMuted(bool mute) = 0;

 private:
  DISALLOW_COPY_AND_ASSIGN(AudioMixer);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_AUDIO_AUDIO_MIXER_H_