• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "chromeos/dbus/volume_state.h"
6 
7 #include "base/format_macros.h"
8 #include "base/strings/stringprintf.h"
9 
10 namespace chromeos {
11 
VolumeState()12 VolumeState::VolumeState()
13     : output_volume(0),
14       output_system_mute(false),
15       input_gain(0),
16       input_mute(false),
17       output_user_mute(false) {
18 }
19 
ToString() const20 std::string VolumeState::ToString() const {
21   std::string result;
22   base::StringAppendF(&result,
23                       "output_volume = %d ",
24                       output_volume);
25   base::StringAppendF(&result,
26                       "output_system_mute = %s ",
27                       output_system_mute ? "true" : "false");
28   base::StringAppendF(&result,
29                       "input_gain = %d ",
30                       input_gain);
31   base::StringAppendF(&result,
32                       "input_mute = %s ",
33                       input_mute ? "true" : "false");
34   base::StringAppendF(&result,
35                       "output_user_mute = %s ",
36                       output_user_mute ? "true" : "false");
37   return result;
38 }
39 
40 }  // namespace chromeos
41