Music Hub  ..
A session-wide music playback service
ostream_reporter.h
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 #ifndef LOMIRI_MEDIAHUBSERVICE_AUDIO_OSTREAM_REPORTER_H
22 #define LOMIRI_MEDIAHUBSERVICE_AUDIO_OSTREAM_REPORTER_H
23 
25 
26 #include <iosfwd>
27 #include <iostream>
28 
29 namespace lomiri
30 {
31 namespace MediaHubService
32 {
33 namespace audio
34 {
35 // A PulseAudioOutputObserver::Reporter implementation printing events to
36 // the configured output stream.
38 {
39 public:
40  // Constructs a new reporter instance, outputting events to the given stream.
41  OStreamReporter(std::ostream& out = std::cout);
42 
43  void connected_to_pulse_audio() override;
44  void query_for_default_sink_failed() override;
45  void query_for_default_sink_finished(const std::string& sink_name) override;
46  void query_for_sink_info_finished(const std::string& name, std::uint32_t index, const std::set<Port>& known_ports) override;
47  void sink_event_with_index(std::uint32_t index) override;
48 
49 private:
50  std::ostream& out;
51 };
52 }
53 }
54 }
55 
56 #endif // LOMIRI_MEDIAHUBSERVICE_AUDIO_OUTPUT_OSTREAM_REPORTER_H
lomiri::MediaHubService::audio::OStreamReporter::OStreamReporter
OStreamReporter(std::ostream &out=std::cout)
Definition: ostream_reporter.cpp:26
lomiri::MediaHubService::audio::OStreamReporter::query_for_default_sink_failed
void query_for_default_sink_failed() override
Definition: ostream_reporter.cpp:35
lomiri::MediaHubService::audio
Definition: ostream_reporter.h:33
lomiri::MediaHubService::audio::OStreamReporter::sink_event_with_index
void sink_event_with_index(std::uint32_t index) override
Definition: ostream_reporter.cpp:54
lomiri::MediaHubService::audio::PulseAudioOutputObserver::Reporter
Definition: pulse_audio_output_observer.h:48
lomiri::MediaHubService::audio::OStreamReporter
Definition: ostream_reporter.h:37
pulse_audio_output_observer.h
lomiri::MediaHubService::audio::OStreamReporter::connected_to_pulse_audio
void connected_to_pulse_audio() override
Definition: ostream_reporter.cpp:30
lomiri::MediaHubService::audio::OStreamReporter::query_for_sink_info_finished
void query_for_sink_info_finished(const std::string &name, std::uint32_t index, const std::set< Port > &known_ports) override
Definition: ostream_reporter.cpp:45
lomiri
Definition: dbus_utils.h:24
lomiri::MediaHubService::audio::OStreamReporter::query_for_default_sink_finished
void query_for_default_sink_finished(const std::string &sink_name) override
Definition: ostream_reporter.cpp:40