Music Hub  ..
A session-wide music playback service
player_implementation.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2013-2015 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 
19 #ifndef CORE_UBUNTU_MEDIA_PLAYER_IMPLEMENTATION_H_
20 #define CORE_UBUNTU_MEDIA_PLAYER_IMPLEMENTATION_H_
21 
22 #include "player_skeleton.h"
23 
24 #include <memory>
25 
26 namespace core
27 {
28 namespace ubuntu
29 {
30 namespace media
31 {
32 class Engine;
33 class Service;
34 
36 {
37 public:
39  const std::string& identity,
40  const std::shared_ptr<core::dbus::Bus>& bus,
41  const std::shared_ptr<core::dbus::Object>& session,
42  const std::shared_ptr<Service>& service,
43  PlayerKey key);
45 
46  virtual std::shared_ptr<TrackList> track_list();
47  virtual PlayerKey key() const;
48 
49  virtual bool open_uri(const Track::UriType& uri);
50  virtual bool open_uri(const Track::UriType& uri, const Player::HeadersType& headers);
51  virtual void create_video_sink(uint32_t texture_id);
52  virtual GLConsumerWrapperHybris gl_consumer() const;
53  virtual void next();
54  virtual void previous();
55  virtual void play();
56  virtual void pause();
57  virtual void stop();
58  virtual void set_frame_available_callback(FrameAvailableCb cb, void *context);
59  virtual void set_playback_complete_callback(PlaybackCompleteCb cb, void *context);
60  virtual void seek_to(const std::chrono::microseconds& offset);
61 
62  const core::Signal<>& on_client_disconnected() const;
63 private:
64  struct Private;
65  std::shared_ptr<Private> d;
66 };
67 }
68 }
69 }
70 #endif // CORE_UBUNTU_MEDIA_PLAYER_IMPLEMENTATION_H_
71 
void * GLConsumerWrapperHybris
Definition: player.h:44
virtual void set_playback_complete_callback(PlaybackCompleteCb cb, void *context)
const core::Signal & on_client_disconnected() const
virtual GLConsumerWrapperHybris gl_consumer() const
Definition: player.h:29
std::map< std::string, std::string > HeadersType
Definition: player.h:45
PlayerImplementation(const std::string &identity, const std::shared_ptr< core::dbus::Bus > &bus, const std::shared_ptr< core::dbus::Object > &session, const std::shared_ptr< Service > &service, PlayerKey key)
void(* FrameAvailableCb)(void *context)
Definition: player.h:49
virtual void create_video_sink(uint32_t texture_id)
void(* PlaybackCompleteCb)(void *context)
Definition: player.h:50
virtual bool open_uri(const Track::UriType &uri)
virtual void seek_to(const std::chrono::microseconds &offset)
virtual void set_frame_available_callback(FrameAvailableCb cb, void *context)
std::string UriType
Definition: track.h:40
virtual std::shared_ptr< TrackList > track_list()