Music Hub  ..
A session-wide music playback service
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
track_list.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 
19 #ifndef MPRIS_TRACK_LIST_H_
20 #define MPRIS_TRACK_LIST_H_
21 
22 #include <core/dbus/macros.h>
23 
24 #include <core/dbus/types/any.h>
25 #include <core/dbus/types/object_path.h>
26 #include <core/dbus/types/variant.h>
27 
28 #include <boost/utility/identity_type.hpp>
29 
30 #include <string>
31 #include <tuple>
32 #include <vector>
33 
34 namespace dbus = core::dbus;
35 
36 namespace mpris
37 {
38 struct TrackList
39 {
40  static const std::string& name()
41  {
42  static const std::string s{"core.ubuntu.media.Service.Player.TrackList"};
43  return s;
44  }
45 
46  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(GetTracksMetadata, TrackList, 1000)
47  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(AddTrack, TrackList, 1000)
48  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(RemoveTrack, TrackList, 1000)
49  DBUS_CPP_METHOD_WITH_TIMEOUT_DEF(GoTo, TrackList, 1000)
50 
51  struct Signals
52  {
53  DBUS_CPP_SIGNAL_DEF
54  (
55  TrackListReplaced,
56  TrackList,
57  BOOST_IDENTITY_TYPE((std::tuple<std::vector<dbus::types::ObjectPath>, dbus::types::ObjectPath>))
58  )
59 
60  DBUS_CPP_SIGNAL_DEF
61  (
62  TrackAdded,
63  TrackList,
64  BOOST_IDENTITY_TYPE((std::tuple<std::map<std::string, dbus::types::Variant>, dbus::types::ObjectPath>))
65  )
66 
67  DBUS_CPP_SIGNAL_DEF
68  (
69  TrackRemoved,
70  TrackList,
71  dbus::types::ObjectPath
72  )
73 
74  DBUS_CPP_SIGNAL_DEF
75  (
76  TrackMetadataChanged,
77  TrackList,
78  BOOST_IDENTITY_TYPE((std::tuple<std::map<std::string, dbus::types::Variant>, dbus::types::ObjectPath>))
79  )
80  };
81 
82  struct Properties
83  {
84  DBUS_CPP_READABLE_PROPERTY_DEF(Tracks, TrackList, std::vector<std::string>)
85  DBUS_CPP_READABLE_PROPERTY_DEF(CanEditTracks, TrackList, bool)
86  };
87 };
88 }
89 
90 #endif // MPRIS_TRACK_LIST_H_
STL namespace.
static const std::string & name()
Definition: track_list.h:40