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)
53 DBUS_CPP_METHOD_DEF(RemoveTrack,
TrackList)
85 BOOST_IDENTITY_TYPE((
std::tuple<
std::map<
std::
string,
dbus::types::Variant>,
dbus::types::ObjectPath>))
91 Properties() =
delete;
93 DBUS_CPP_READABLE_PROPERTY_DEF(Tracks, TrackList, std::vector<core::ubuntu::media::Track::Id>)
94 DBUS_CPP_READABLE_PROPERTY_DEF(CanEditTracks, TrackList,
bool)
101 static const std::vector<std::string> instance;
return instance;
112 Properties::Tracks::ValueType
tracks{std::vector<core::ubuntu::media::Track::Id>()};
118 : configuration(configuration),
121 configuration.
object->get_property<Properties::Tracks>(),
122 configuration.
object->get_property<Properties::CanEditTracks>(),
130 configuration.
object->template get_signal<core::dbus::interfaces::Properties::Signals::PropertiesChanged>()
138 template<
typename Property>
142 dict[Property::name()] = dbus::types::Variant::encode(value);
144 signals.properties_changed->emit(std::make_tuple(
145 dbus::traits::Service<TrackList>::interface_name(),
152 std::map<std::string, core::dbus::types::Variant> dict;
153 dict[Properties::Tracks::name()] = core::dbus::types::Variant::encode(
properties.tracks->get());
154 dict[Properties::CanEditTracks::name()] = core::dbus::types::Variant::encode(
properties.can_edit_tracks->get());
163 std::shared_ptr<core::dbus::Property<Properties::Tracks>>
tracks;
169 core::dbus::Signal<Signals::TrackListReplaced, Signals::TrackListReplaced::ArgumentType>::Ptr
tracklist_replaced;
170 core::dbus::Signal<Signals::TrackAdded, Signals::TrackAdded::ArgumentType>::Ptr
track_added;
171 core::dbus::Signal<Signals::TrackRemoved, Signals::TrackRemoved::ArgumentType>::Ptr
track_removed;
172 core::dbus::Signal<Signals::TrackMetadataChanged, Signals::TrackMetadataChanged::ArgumentType>::Ptr
track_metadata_changed;
174 dbus::Signal <core::dbus::interfaces::Properties::Signals::PropertiesChanged,
175 core::dbus::interfaces::Properties::Signals::PropertiesChanged::ArgumentType
182 #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
std::shared_ptr< core::dbus::Property< Properties::CanEditTracks > > can_edit_tracks