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