Music Hub  ..
A session-wide music playback service
ostream_reporter.cpp
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voß <thomas.voss@canonical.com>
17  */
18 
20 
22 
23 audio::OStreamReporter::OStreamReporter(std::ostream &out) : out{out}
24 {
25 }
26 
28 {
29  out << "Connection to PulseAudio has been successfully established." << std::endl;
30 }
31 
33 {
34  out << "Query for default sink failed." << std::endl;
35 }
36 
38 {
39  out << "Default PulseAudio sync has been identified: " << sink_name << std::endl;
40 }
41 
42 void audio::OStreamReporter::query_for_sink_info_finished(const std::string& name, std::uint32_t index, const std::set<Port>& known_ports)
43 {
44  out << "PulseAudio sink details for " << name << " with index " << index << " is available:" << std::endl;
45  for (const auto& port : known_ports)
46  {
47  if (port.is_monitored)
48  out << " " << port.description << ": " << std::boolalpha << port.is_available << "\n";
49  }
50 }
52 {
53  out << "PulseAudio event for sink with index " << index << " received." << std::endl;
54 }
void query_for_sink_info_finished(const std::string &name, std::uint32_t index, const std::set< Port > &known_ports) override
void sink_event_with_index(std::uint32_t index) override
OStreamReporter(std::ostream &out=std::cout)
void query_for_default_sink_finished(const std::string &sink_name) override