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  *
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 #ifndef CORE_UBUNTU_MEDIA_AUDIO_OSTREAM_REPORTER_H_
19 #define CORE_UBUNTU_MEDIA_AUDIO_OSTREAM_REPORTER_H_
20 
22 
23 #include <iosfwd>
24 
25 namespace core
26 {
27 namespace ubuntu
28 {
29 namespace media
30 {
31 namespace audio
32 {
33 // A PulseAudioOutputObserver::Reporter implementation printing events to
34 // the configured output stream.
36 {
37 public:
38  // Constructs a new reporter instance, outputting events to the given stream.
39  OStreamReporter(std::ostream& out = std::cout);
40 
41  void connected_to_pulse_audio() override;
42  void query_for_default_sink_failed() override;
43  void query_for_default_sink_finished(const std::string& sink_name) override;
44  void query_for_sink_info_finished(const std::string& name, std::uint32_t index, const std::set<Port>& known_ports) override;
45  void sink_event_with_index(std::uint32_t index) override;
46 
47 private:
48  std::ostream& out;
49 };
50 }
51 }
52 }
53 }
54 
55 #endif // CORE_UBUNTU_MEDIA_AUDIO_OUTPUT_OSTREAM_REPORTER_H_
Definition: player.h:33
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