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  const Track::Id& next();
46  const Track::Id& current();
47 
48  const core::Property<bool>& can_edit_tracks() const;
49  const core::Property<Container>& tracks() const;
50 
51  const core::Signal<ContainerTrackIdTuple>& on_track_list_replaced() const;
52  const core::Signal<Track::Id>& on_track_added() const;
53  const core::Signal<Track::Id>& on_track_removed() const;
54  const core::Signal<Track::Id>& on_track_changed() const;
55  const core::Signal<std::pair<Track::Id, bool>>& on_go_to_track() const;
56  core::Signal<std::pair<Track::Id, bool>>& on_go_to_track();
57  core::Signal<Track::Id>& on_track_removed();
58 
59  core::Property<Container>& tracks();
62 
65  void on_shuffle_changed(bool shuffle);
66 
67 protected:
68  core::Property<bool>& can_edit_tracks();
69 
70  core::Signal<ContainerTrackIdTuple>& on_track_list_replaced();
71  core::Signal<Track::Id>& on_track_added();
72  core::Signal<Track::Id>& on_track_changed();
73 
74 private:
75  struct Private;
76  std::unique_ptr<Private> d;
77 };
78 
79 // operator<< pretty prints the given TrackList status to the given output stream.
80 std::ostream& operator<<(std::ostream& out, const core::ubuntu::media::TrackList& tracklist);
81 
82 }
83 }
84 }
85 #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)