summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/volume_state.cc
blob: 9f105c4f19a021f0182b1b3fcae9f8d52900714b (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
// Copyright (c) 2013 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.

#include "chromeos/dbus/volume_state.h"

#include "base/format_macros.h"
#include "base/strings/stringprintf.h"

namespace chromeos {

VolumeState::VolumeState()
    : output_volume(0),
      output_system_mute(false),
      input_gain(0),
      input_mute(false),
      output_user_mute(false) {
}

std::string VolumeState::ToString() const {
  std::string result;
  base::StringAppendF(&result,
                      "output_volume = %d ",
                      output_volume);
  base::StringAppendF(&result,
                      "output_system_mute = %s ",
                      output_system_mute ? "true" : "false");
  base::StringAppendF(&result,
                      "input_gain = %d ",
                      input_gain);
  base::StringAppendF(&result,
                      "input_mute = %s ",
                      input_mute ? "true" : "false");
  base::StringAppendF(&result,
                      "output_user_mute = %s ",
                      output_user_mute ? "true" : "false");
  return result;
}

}  // namespace chromeos