Music Hub  ..
A session-wide music playback service
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
engine.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-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  * Jim Hodapp <jim.hodapp@canonical.com>
18  */
19 #ifndef CORE_UBUNTU_MEDIA_GSTREAMER_ENGINE_H_
20 #define CORE_UBUNTU_MEDIA_GSTREAMER_ENGINE_H_
21 
22 #include "../engine.h"
23 
24 namespace gstreamer
25 {
27 {
28 public:
29  Engine();
30  ~Engine();
31 
32  const std::shared_ptr<MetaDataExtractor>& meta_data_extractor() const;
33 
34  const core::Property<State>& state() const;
35 
37  void create_video_sink(uint32_t texture_id);
38 
39  bool play();
40  bool stop();
41  bool pause();
42  bool seek_to(const std::chrono::microseconds& ts);
43 
44  const core::Property<bool>& is_video_source() const;
45  const core::Property<bool>& is_audio_source() const;
46 
47  const core::Property<uint64_t>& position() const;
48  const core::Property<uint64_t>& duration() const;
49 
50  const core::Property<core::ubuntu::media::Engine::Volume>& volume() const;
51  core::Property<core::ubuntu::media::Engine::Volume>& volume();
52 
53  const core::Property<core::ubuntu::media::Player::AudioStreamRole>& audio_stream_role() const;
54  core::Property<core::ubuntu::media::Player::AudioStreamRole>& audio_stream_role();
55 
56  const core::Property<std::tuple<core::ubuntu::media::Track::UriType, core::ubuntu::media::Track::MetaData>>& track_meta_data() const;
57 
58  const core::Signal<void>& about_to_finish_signal() const;
59  const core::Signal<uint64_t>& seeked_to_signal() const;
60  const core::Signal<void>& client_disconnected_signal() const;
61  const core::Signal<void>& end_of_stream_signal() const;
62  const core::Signal<core::ubuntu::media::Player::PlaybackStatus>& playback_status_changed_signal() const;
63 
64 private:
65  struct Private;
66  std::unique_ptr<Private> d;
67 };
68 }
69 
70 #endif // CORE_UBUNTU_MEDIA_GSTREAMER_ENGINE_H_
bool open_resource_for_uri(const core::ubuntu::media::Track::UriType &uri)
const core::Property< core::ubuntu::media::Engine::Volume > & volume() const
Definition: engine.cpp:296
const core::Signal< core::ubuntu::media::Player::PlaybackStatus > & playback_status_changed_signal() const
Definition: engine.cpp:342
const core::Property< core::ubuntu::media::Player::AudioStreamRole > & audio_stream_role() const
Definition: engine.cpp:306
const core::Property< bool > & is_video_source() const
Definition: engine.cpp:262
const core::Signal< void > & client_disconnected_signal() const
Definition: engine.cpp:332
Definition: bus.h:33
const core::Property< State > & state() const
Definition: engine.cpp:195
bool seek_to(const std::chrono::microseconds &ts)
Definition: engine.cpp:257
const core::Signal< uint64_t > & seeked_to_signal() const
Definition: engine.cpp:327
void create_video_sink(uint32_t texture_id)
Definition: engine.cpp:206
const core::Property< std::tuple< core::ubuntu::media::Track::UriType, core::ubuntu::media::Track::MetaData > > & track_meta_data() const
Definition: engine.cpp:317
const core::Property< bool > & is_audio_source() const
Definition: engine.cpp:273
const core::Property< uint64_t > & duration() const
Definition: engine.cpp:290
const core::Signal< void > & about_to_finish_signal() const
Definition: engine.cpp:322
const core::Signal< void > & end_of_stream_signal() const
Definition: engine.cpp:337
const std::shared_ptr< MetaDataExtractor > & meta_data_extractor() const
Definition: engine.cpp:190
std::string UriType
Definition: track.h:40
const core::Property< uint64_t > & position() const
Definition: engine.cpp:284