19 #ifndef MPRIS_PLAYLISTS_H_
20 #define MPRIS_PLAYLISTS_H_
22 #include <core/dbus/macros.h>
23 #include <core/dbus/object.h>
24 #include <core/dbus/property.h>
25 #include <core/dbus/interfaces/properties.h>
26 #include <core/dbus/types/struct.h>
27 #include <core/dbus/types/variant.h>
41 return lhs.value != rhs.value;
54 static const std::string&
name()
56 static const std::string s{
"org.mpris.MediaPlayer2.Playlists"};
return s;
75 typedef core::dbus::types::Struct
81 core::dbus::types::ObjectPath,
90 typedef core::dbus::types::Struct
109 DBUS_CPP_METHOD_DEF(ActivatePlaylist,
Playlists)
125 DBUS_CPP_METHOD_DEF(GetPlaylists,
Playlists)
142 DBUS_CPP_READABLE_PROPERTY_DEF(PlaylistCount,
Playlists, std::uint32_t)
168 core::dbus::types::ObjectPath{
"/"},
177 : configuration(configuration),
180 configuration.
object->get_property<Properties::PlaylistCount>(),
181 configuration.
object->get_property<Properties::Orderings>()
194 std::map<std::string, core::dbus::types::Variant> dict;
195 dict[Properties::PlaylistCount::name()] = core::dbus::types::Variant::encode(
properties.playlist_count->get());
196 dict[Properties::Orderings::name()] = core::dbus::types::Variant::encode(
properties.orderings->get());
206 std::shared_ptr<core::dbus::Property<Properties::Orderings>>
orderings;
211 core::dbus::Signal<Signals::PlaylistsChanged, Signals::PlaylistsChanged::ArgumentType>::Ptr
playlist_changed;
216 #endif // MPRIS_PLAYLISTS_H_
core::dbus::types::Struct< std::tuple< bool, Playlist > > MaybePlaylist
core::dbus::Signal< Signals::PlaylistsChanged, Signals::PlaylistsChanged::ArgumentType >::Ptr playlist_changed
struct mpris::Playlists::Skeleton::@17 signals
std::shared_ptr< core::dbus::Property< Properties::PlaylistCount > > playlist_count
std::shared_ptr< core::dbus::Property< Properties::Orderings > > orderings
bool operator!=(const Struct< T > &lhs, const Struct< T > &rhs)
static constexpr const char * creation_date
Properties::ActivePlaylist::ValueType active_playlist
static constexpr const char * alphabetical
std::map< std::string, core::dbus::types::Variant > get_all_properties()
Properties::PlaylistCount::ValueType playlist_count
static constexpr const char * user_defined
static constexpr const char * last_play_date
static constexpr const char * modified_date
Properties::Orderings::ValueType orderings
core::dbus::types::Struct< std::tuple< core::dbus::types::ObjectPath, std::string, std::string > > Playlist
Skeleton(const Configuration &configuration)
struct mpris::Playlists::Skeleton::@16 properties
struct mpris::Playlists::Skeleton::Configuration::Defaults defaults
core::dbus::Object::Ptr object
Configuration configuration
static const std::string & name()