Music Hub  ..
A session-wide music playback service
track_list_skeleton.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_TRACK_LIST_SKELETON_H_
19 #define CORE_UBUNTU_MEDIA_TRACK_LIST_SKELETON_H_
20 
21 #include "apparmor/ubuntu.h"
22 
23 #include <core/media/track_list.h>
24 
25 #include <core/media/player.h>
26 
27 #include <core/dbus/object.h>
28 #include <core/dbus/skeleton.h>
29 
30 namespace core
31 {
32 namespace ubuntu
33 {
34 namespace media
35 {
37 {
38 public:
39  TrackListSkeleton(const core::dbus::Bus::Ptr& bus, const core::dbus::Object::Ptr& object,
43 
44  bool has_next() const;
45  bool has_previous() const;
46  Track::Id next();
48  const Track::Id& current();
49 
50  const core::Property<bool>& can_edit_tracks() const;
51  const core::Property<Container>& tracks() const;
52 
53  const core::Signal<ContainerTrackIdTuple>& on_track_list_replaced() const;
54  const core::Signal<Track::Id>& on_track_added() const;
55  const core::Signal<Track::Id>& on_track_removed() const;
56  const core::Signal<Track::Id>& on_track_changed() const;
57  const core::Signal<std::pair<Track::Id, bool>>& on_go_to_track() const;
58  core::Signal<std::pair<Track::Id, bool>>& on_go_to_track();
59  core::Signal<Track::Id>& on_track_removed();
60 
61  core::Property<Container>& tracks();
64 
67  void on_shuffle_changed(bool shuffle);
68 
69 protected:
70  core::Property<bool>& can_edit_tracks();
71 
72  core::Signal<ContainerTrackIdTuple>& on_track_list_replaced();
73  core::Signal<Track::Id>& on_track_added();
74  core::Signal<Track::Id>& on_track_changed();
75 
76 private:
77  struct Private;
78  std::unique_ptr<Private> d;
79 };
80 
81 // operator<< pretty prints the given TrackList status to the given output stream.
82 std::ostream& operator<<(std::ostream& out, const core::ubuntu::media::TrackList& tracklist);
83 
84 }
85 }
86 }
87 #endif // CORE_UBUNTU_MEDIA_PROPERTY_H_
const core::Property< Container > & tracks() const
const core::Signal< std::pair< Track::Id, bool > > & on_go_to_track() const
const core::Signal< Track::Id > & on_track_changed() const
Definition: player.h:33
const core::Signal< Track::Id > & on_track_removed() const
std::ostream & operator<<(std::ostream &out, Player::PlaybackStatus status)
Definition: player.h:188
std::shared_ptr< RequestContextResolver > Ptr
Definition: ubuntu.h:87
core::ubuntu::media::Player::LoopStatus loop_status() const
const core::Signal< ContainerTrackIdTuple > & on_track_list_replaced() const
const core::Signal< Track::Id > & on_track_added() const
void on_loop_status_changed(const core::ubuntu::media::Player::LoopStatus &loop_status)
std::shared_ptr< RequestAuthenticator > Ptr
Definition: ubuntu.h:127
const core::Property< bool > & can_edit_tracks() const
TrackListSkeleton(const core::dbus::Bus::Ptr &bus, const core::dbus::Object::Ptr &object, const core::ubuntu::media::apparmor::ubuntu::RequestContextResolver::Ptr &request_context_resolver, const core::ubuntu::media::apparmor::ubuntu::RequestAuthenticator::Ptr &request_authenticator)