19 #ifndef MPRIS_TRACK_LIST_H_
20 #define MPRIS_TRACK_LIST_H_
22 #include <core/dbus/macros.h>
24 #include <core/dbus/types/any.h>
25 #include <core/dbus/macros.h>
26 #include <core/dbus/types/object_path.h>
27 #include <core/dbus/object.h>
28 #include <core/dbus/property.h>
29 #include <core/dbus/types/variant.h>
31 #include <boost/utility/identity_type.hpp>
43 typedef std::map<std::string, core::dbus::types::Variant>
Dictionary;
45 static const std::string&
name()
47 static const std::string s{
"org.mpris.MediaPlayer2.TrackList"};
51 DBUS_CPP_METHOD_DEF(GetTracksMetadata,
TrackList)
52 DBUS_CPP_METHOD_DEF(GetTracksUri,
TrackList)
54 DBUS_CPP_METHOD_DEF(RemoveTrack,
TrackList)
94 BOOST_IDENTITY_TYPE((
std::tuple<
std::map<
std::
string,
dbus::types::Variant>,
dbus::types::ObjectPath>))
100 Properties() =
delete;
102 DBUS_CPP_READABLE_PROPERTY_DEF(Tracks, TrackList, std::vector<core::ubuntu::media::Track::Id>)
103 DBUS_CPP_READABLE_PROPERTY_DEF(CanEditTracks, TrackList,
bool)
110 static const std::vector<std::string> instance;
return instance;
121 Properties::Tracks::ValueType
tracks{std::vector<core::ubuntu::media::Track::Id>()};
127 : configuration(configuration),
130 configuration.
object->template get_property<Properties::Tracks>(),
131 configuration.
object->template get_property<Properties::CanEditTracks>(),
140 configuration.
object->template get_signal<core::dbus::interfaces::Properties::Signals::PropertiesChanged>()
148 template<
typename Property>
152 dict[Property::name()] = dbus::types::Variant::encode(value);
154 signals.properties_changed->emit(std::make_tuple(
155 dbus::traits::Service<TrackList>::interface_name(),
162 std::map<std::string, core::dbus::types::Variant> dict;
163 dict[Properties::Tracks::name()] = core::dbus::types::Variant::encode(
properties.tracks->get());
164 dict[Properties::CanEditTracks::name()] = core::dbus::types::Variant::encode(
properties.can_edit_tracks->get());
173 std::shared_ptr<core::dbus::Property<Properties::Tracks>>
tracks;
179 core::dbus::Signal<Signals::TrackListReplaced, Signals::TrackListReplaced::ArgumentType>::Ptr
tracklist_replaced;
180 core::dbus::Signal<Signals::TrackAdded, Signals::TrackAdded::ArgumentType>::Ptr
track_added;
181 core::dbus::Signal<Signals::TrackRemoved, Signals::TrackRemoved::ArgumentType>::Ptr
track_removed;
182 core::dbus::Signal<Signals::TrackChanged, Signals::TrackChanged::ArgumentType>::Ptr
track_changed;
183 core::dbus::Signal<Signals::TrackMetadataChanged, Signals::TrackMetadataChanged::ArgumentType>::Ptr
track_metadata_changed;
185 dbus::Signal <core::dbus::interfaces::Properties::Signals::PropertiesChanged,
186 core::dbus::interfaces::Properties::Signals::PropertiesChanged::ArgumentType
193 #endif // MPRIS_TRACK_LIST_H_
core::dbus::Object::Ptr object
struct mpris::TrackList::Skeleton::@20 signals
std::shared_ptr< core::dbus::Property< Properties::Tracks > > tracks
dbus::Signal< core::dbus::interfaces::Properties::Signals::PropertiesChanged, core::dbus::interfaces::Properties::Signals::PropertiesChanged::ArgumentType >::Ptr properties_changed
static const std::vector< std::string > & the_empty_list_of_invalidated_properties()
core::dbus::Signal< Signals::TrackListReplaced, Signals::TrackListReplaced::ArgumentType >::Ptr tracklist_replaced
core::dbus::Signal< Signals::TrackMetadataChanged, Signals::TrackMetadataChanged::ArgumentType >::Ptr track_metadata_changed
std::map< std::string, core::dbus::types::Variant > get_all_properties()
Properties::CanEditTracks::ValueType can_edit_tracks
Skeleton(const Configuration &configuration)
core::dbus::Signal< Signals::TrackAdded, Signals::TrackAdded::ArgumentType >::Ptr track_added
struct mpris::TrackList::Skeleton::Configuration::Defaults defaults
static const std::string & name()
std::map< std::string, core::dbus::types::Variant > Dictionary
void on_property_value_changed(const typename Property::ValueType &value)
Configuration configuration
Properties::Tracks::ValueType tracks
core::dbus::Signal< Signals::TrackRemoved, Signals::TrackRemoved::ArgumentType >::Ptr track_removed
struct mpris::TrackList::Skeleton::@19 properties
core::dbus::Signal< Signals::TrackChanged, Signals::TrackChanged::ArgumentType >::Ptr track_changed
std::shared_ptr< core::dbus::Property< Properties::CanEditTracks > > can_edit_tracks