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  */
18 #ifndef CORE_UBUNTU_MEDIA_GSTREAMER_ENGINE_H_
19 #define CORE_UBUNTU_MEDIA_GSTREAMER_ENGINE_H_
20 
21 #include "../engine.h"
22 
23 namespace gstreamer
24 {
26 {
27 public:
28  Engine();
29  ~Engine();
30 
31  const std::shared_ptr<MetaDataExtractor>& meta_data_extractor() const;
32 
33  const core::Property<State>& state() const;
34 
36  void create_video_sink(uint32_t texture_id);
37 
38  bool play();
39  bool stop();
40  bool pause();
41  bool seek_to(const std::chrono::microseconds& ts);
42 
43  const core::Property<bool>& is_video_source() const;
44  const core::Property<bool>& is_audio_source() const;
45 
46  const core::Property<uint64_t>& position() const;
47  const core::Property<uint64_t>& duration() const;
48 
49  const core::Property<core::ubuntu::media::Engine::Volume>& volume() const;
50  core::Property<core::ubuntu::media::Engine::Volume>& volume();
51 
52  const core::Property<std::tuple<core::ubuntu::media::Track::UriType, core::ubuntu::media::Track::MetaData>>& track_meta_data() const;
53 
54  const core::Signal<void>& about_to_finish_signal() const;
55  const core::Signal<uint64_t>& seeked_to_signal() const;
56  const core::Signal<void>& client_disconnected_signal() const;
57  const core::Signal<void>& end_of_stream_signal() const;
58  const core::Signal<core::ubuntu::media::Player::PlaybackStatus>& playback_status_changed_signal() const;
59 
60 private:
61  struct Private;
62  std::unique_ptr<Private> d;
63 };
64 }
65 
66 #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:372
const core::Signal< core::ubuntu::media::Player::PlaybackStatus > & playback_status_changed_signal() const
Definition: engine.cpp:408
const core::Property< bool > & is_video_source() const
Definition: engine.cpp:338
const core::Signal< void > & client_disconnected_signal() const
Definition: engine.cpp:398
const core::Property< State > & state() const
Definition: engine.cpp:275
bool seek_to(const std::chrono::microseconds &ts)
Definition: engine.cpp:333
const core::Signal< uint64_t > & seeked_to_signal() const
Definition: engine.cpp:393
void create_video_sink(uint32_t texture_id)
Definition: engine.cpp:286
const core::Property< std::tuple< core::ubuntu::media::Track::UriType, core::ubuntu::media::Track::MetaData > > & track_meta_data() const
Definition: engine.cpp:383
const core::Property< bool > & is_audio_source() const
Definition: engine.cpp:349
const core::Property< uint64_t > & duration() const
Definition: engine.cpp:366
const core::Signal< void > & about_to_finish_signal() const
Definition: engine.cpp:388
const core::Signal< void > & end_of_stream_signal() const
Definition: engine.cpp:403
const std::shared_ptr< MetaDataExtractor > & meta_data_extractor() const
Definition: engine.cpp:270
std::string UriType
Definition: track.h:40
const core::Property< uint64_t > & position() const
Definition: engine.cpp:360