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 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>& end_of_stream_signal() const;
57  const core::Signal<core::ubuntu::media::Player::PlaybackStatus>& playback_status_changed_signal() const;
58 
59 private:
60  struct Private;
61  std::unique_ptr<Private> d;
62 };
63 }
64 
65 #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:360
const core::Signal< core::ubuntu::media::Player::PlaybackStatus > & playback_status_changed_signal() const
Definition: engine.cpp:391
const core::Property< bool > & is_video_source() const
Definition: engine.cpp:326
const core::Property< State > & state() const
Definition: engine.cpp:263
bool seek_to(const std::chrono::microseconds &ts)
Definition: engine.cpp:321
const core::Signal< uint64_t > & seeked_to_signal() const
Definition: engine.cpp:381
void create_video_sink(uint32_t texture_id)
Definition: engine.cpp:274
const core::Property< std::tuple< core::ubuntu::media::Track::UriType, core::ubuntu::media::Track::MetaData > > & track_meta_data() const
Definition: engine.cpp:371
const core::Property< bool > & is_audio_source() const
Definition: engine.cpp:337
const core::Property< uint64_t > & duration() const
Definition: engine.cpp:354
const core::Signal< void > & about_to_finish_signal() const
Definition: engine.cpp:376
const core::Signal< void > & end_of_stream_signal() const
Definition: engine.cpp:386
const std::shared_ptr< MetaDataExtractor > & meta_data_extractor() const
Definition: engine.cpp:258
std::string UriType
Definition: track.h:40
const core::Property< uint64_t > & position() const
Definition: engine.cpp:348