summaryrefslogtreecommitdiffstats
path: root/ash/system/audio/audio_observer.h
blob: 7a18e17d56845bfdc195f1ebbdaa2f27c7902c40 (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
// Copyright 2014 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 ASH_SYSTEM_AUDIO_AUDIO_OBSERVER_H_
#define ASH_SYSTEM_AUDIO_AUDIO_OBSERVER_H_

#include <stdint.h>

namespace ash {

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

  // Called when an active output device's volume changed.
  // |node_id|: id of the active node.
  // |volume|: volume as a percentage, 0.0 -- 100.0.
  virtual void OnOutputNodeVolumeChanged(uint64_t node_id, double volume) = 0;

  // Called when output mute state changed.
  // |mute_on|: True if output is muted.
  // |system_adjust|: True if the mute state is adjusted by the system
  // automatically, UI should be consistent with the system's mute state,
  // but it should not be too loud, e.g., the volume pop up window should not
  // be triggered.
  virtual void OnOutputMuteChanged(bool mute_on, bool system_adjust) = 0;

  // Called when audio nodes changed.
  virtual void OnAudioNodesChanged() = 0;

  // Called when active audio output node changed.
  virtual void OnActiveOutputNodeChanged() = 0;

  // Called when active audio input node changed.
  virtual void OnActiveInputNodeChanged() = 0;
};

}  // namespace ash

#endif  // ASH_SYSTEM_AUDIO_AUDIO_OBSERVER_H_