looper/assets/mpris_stub_adaptor.hpp

215 lines
11 KiB
C++
Raw Permalink Normal View History

2024-04-09 10:15:05 -07:00
/*
* This file was automatically generated by sdbus-c++-xml2cpp; DO NOT EDIT!
*/
#ifndef __sdbuscpp__mpris_stub_adaptor_hpp__adaptor__H__
#define __sdbuscpp__mpris_stub_adaptor_hpp__adaptor__H__
#include <sdbus-c++/sdbus-c++.h>
#include <string>
#include <tuple>
namespace org {
namespace mpris {
class MediaPlayer2_adaptor
{
public:
static constexpr const char* INTERFACE_NAME = "org.mpris.MediaPlayer2";
protected:
MediaPlayer2_adaptor(sdbus::IObject& object)
: object_(&object)
{
object_->registerMethod("Raise").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->Raise(); });
object_->registerMethod("Quit").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->Quit(); });
object_->registerProperty("CanRaise").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanRaise(); });
object_->registerProperty("CanQuit").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanQuit(); });
object_->registerProperty("HasTrackList").onInterface(INTERFACE_NAME).withGetter([this](){ return this->HasTrackList(); });
object_->registerProperty("Identity").onInterface(INTERFACE_NAME).withGetter([this](){ return this->Identity(); });
object_->registerProperty("SupportedUriSchemes").onInterface(INTERFACE_NAME).withGetter([this](){ return this->SupportedUriSchemes(); });
object_->registerProperty("SupportedMimeTypes").onInterface(INTERFACE_NAME).withGetter([this](){ return this->SupportedMimeTypes(); });
}
MediaPlayer2_adaptor(const MediaPlayer2_adaptor&) = delete;
MediaPlayer2_adaptor& operator=(const MediaPlayer2_adaptor&) = delete;
MediaPlayer2_adaptor(MediaPlayer2_adaptor&&) = default;
MediaPlayer2_adaptor& operator=(MediaPlayer2_adaptor&&) = default;
~MediaPlayer2_adaptor() = default;
private:
virtual void Raise() = 0;
virtual void Quit() = 0;
private:
virtual bool CanRaise() = 0;
virtual bool CanQuit() = 0;
virtual bool HasTrackList() = 0;
virtual std::string Identity() = 0;
virtual std::vector<std::string> SupportedUriSchemes() = 0;
virtual std::vector<std::string> SupportedMimeTypes() = 0;
private:
sdbus::IObject* object_;
};
}} // namespaces
namespace org {
namespace mpris {
namespace MediaPlayer2 {
class Player_adaptor
{
public:
static constexpr const char* INTERFACE_NAME = "org.mpris.MediaPlayer2.Player";
protected:
Player_adaptor(sdbus::IObject& object)
: object_(&object)
{
object_->registerMethod("Next").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->Next(); });
object_->registerMethod("Previous").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->Previous(); });
object_->registerMethod("Pause").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->Pause(); });
object_->registerMethod("PlayPause").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->PlayPause(); });
object_->registerMethod("Stop").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->Stop(); });
object_->registerMethod("Play").onInterface(INTERFACE_NAME).implementedAs([this](){ return this->Play(); });
object_->registerMethod("Seek").onInterface(INTERFACE_NAME).withInputParamNames("Offset").implementedAs([this](const int64_t& Offset){ return this->Seek(Offset); });
object_->registerMethod("SetPosition").onInterface(INTERFACE_NAME).withInputParamNames("TrackId", "Position").implementedAs([this](const sdbus::ObjectPath& TrackId, const int64_t& Position){ return this->SetPosition(TrackId, Position); });
object_->registerMethod("OpenUri").onInterface(INTERFACE_NAME).withInputParamNames("Uri").implementedAs([this](const std::string& Uri){ return this->OpenUri(Uri); });
object_->registerSignal("Seeked").onInterface(INTERFACE_NAME).withParameters<int64_t>("Position");
object_->registerProperty("PlaybackStatus").onInterface(INTERFACE_NAME).withGetter([this](){ return this->PlaybackStatus(); });
object_->registerProperty("Rate").onInterface(INTERFACE_NAME).withGetter([this](){ return this->Rate(); }).withSetter([this](const double& value){ this->Rate(value); });
object_->registerProperty("Metadata").onInterface(INTERFACE_NAME).withGetter([this](){ return this->Metadata(); });
object_->registerProperty("Volume").onInterface(INTERFACE_NAME).withGetter([this](){ return this->Volume(); }).withSetter([this](const double& value){ this->Volume(value); });
object_->registerProperty("Position").onInterface(INTERFACE_NAME).withGetter([this](){ return this->Position(); });
object_->registerProperty("MinimumRate").onInterface(INTERFACE_NAME).withGetter([this](){ return this->MinimumRate(); });
object_->registerProperty("MaximumRate").onInterface(INTERFACE_NAME).withGetter([this](){ return this->MaximumRate(); });
object_->registerProperty("CanGoNext").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanGoNext(); });
object_->registerProperty("CanGoPrevious").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanGoPrevious(); });
object_->registerProperty("CanPlay").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanPlay(); });
object_->registerProperty("CanPause").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanPause(); });
object_->registerProperty("CanSeek").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanSeek(); });
object_->registerProperty("CanControl").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanControl(); });
}
Player_adaptor(const Player_adaptor&) = delete;
Player_adaptor& operator=(const Player_adaptor&) = delete;
Player_adaptor(Player_adaptor&&) = default;
Player_adaptor& operator=(Player_adaptor&&) = default;
~Player_adaptor() = default;
public:
void emitSeeked(const int64_t& Position)
{
object_->emitSignal("Seeked").onInterface(INTERFACE_NAME).withArguments(Position);
}
private:
virtual void Next() = 0;
virtual void Previous() = 0;
virtual void Pause() = 0;
virtual void PlayPause() = 0;
virtual void Stop() = 0;
virtual void Play() = 0;
virtual void Seek(const int64_t& Offset) = 0;
virtual void SetPosition(const sdbus::ObjectPath& TrackId, const int64_t& Position) = 0;
virtual void OpenUri(const std::string& Uri) = 0;
private:
virtual std::string PlaybackStatus() = 0;
virtual double Rate() = 0;
virtual void Rate(const double& value) = 0;
virtual std::map<std::string, sdbus::Variant> Metadata() = 0;
virtual double Volume() = 0;
virtual void Volume(const double& value) = 0;
virtual int64_t Position() = 0;
virtual double MinimumRate() = 0;
virtual double MaximumRate() = 0;
virtual bool CanGoNext() = 0;
virtual bool CanGoPrevious() = 0;
virtual bool CanPlay() = 0;
virtual bool CanPause() = 0;
virtual bool CanSeek() = 0;
virtual bool CanControl() = 0;
private:
sdbus::IObject* object_;
};
}}} // namespaces
namespace org {
namespace mpris {
namespace MediaPlayer2 {
class TrackList_adaptor
{
public:
static constexpr const char* INTERFACE_NAME = "org.mpris.MediaPlayer2.TrackList";
protected:
TrackList_adaptor(sdbus::IObject& object)
: object_(&object)
{
object_->registerMethod("GetTracksMetadata").onInterface(INTERFACE_NAME).withInputParamNames("TrackIds").withOutputParamNames("Metadata").implementedAs([this](const std::vector<sdbus::ObjectPath>& TrackIds){ return this->GetTracksMetadata(TrackIds); });
object_->registerMethod("AddTrack").onInterface(INTERFACE_NAME).withInputParamNames("Uri", "AfterTrack", "SetAsCurrent").implementedAs([this](const std::string& Uri, const sdbus::ObjectPath& AfterTrack, const bool& SetAsCurrent){ return this->AddTrack(Uri, AfterTrack, SetAsCurrent); });
object_->registerMethod("RemoveTrack").onInterface(INTERFACE_NAME).withInputParamNames("TrackId").implementedAs([this](const sdbus::ObjectPath& TrackId){ return this->RemoveTrack(TrackId); });
object_->registerMethod("GoTo").onInterface(INTERFACE_NAME).withInputParamNames("TrackId").implementedAs([this](const sdbus::ObjectPath& TrackId){ return this->GoTo(TrackId); });
object_->registerSignal("TrackListReplaced").onInterface(INTERFACE_NAME).withParameters<std::vector<sdbus::ObjectPath>, sdbus::ObjectPath>("Tracks", "CurrentTrack");
object_->registerSignal("TrackAdded").onInterface(INTERFACE_NAME).withParameters<std::map<std::string, sdbus::Variant>, sdbus::ObjectPath>("Metadata", "AfterTrack");
object_->registerSignal("TrackRemoved").onInterface(INTERFACE_NAME).withParameters<sdbus::ObjectPath>("TrackId");
object_->registerSignal("TrackMetadataChanged").onInterface(INTERFACE_NAME).withParameters<sdbus::ObjectPath, std::map<std::string, sdbus::Variant>>("TrackId", "Metadata");
object_->registerProperty("Tracks").onInterface(INTERFACE_NAME).withGetter([this](){ return this->Tracks(); });
object_->registerProperty("CanEditTracks").onInterface(INTERFACE_NAME).withGetter([this](){ return this->CanEditTracks(); });
}
TrackList_adaptor(const TrackList_adaptor&) = delete;
TrackList_adaptor& operator=(const TrackList_adaptor&) = delete;
TrackList_adaptor(TrackList_adaptor&&) = default;
TrackList_adaptor& operator=(TrackList_adaptor&&) = default;
~TrackList_adaptor() = default;
public:
void emitTrackListReplaced(const std::vector<sdbus::ObjectPath>& Tracks, const sdbus::ObjectPath& CurrentTrack)
{
object_->emitSignal("TrackListReplaced").onInterface(INTERFACE_NAME).withArguments(Tracks, CurrentTrack);
}
void emitTrackAdded(const std::map<std::string, sdbus::Variant>& Metadata, const sdbus::ObjectPath& AfterTrack)
{
object_->emitSignal("TrackAdded").onInterface(INTERFACE_NAME).withArguments(Metadata, AfterTrack);
}
void emitTrackRemoved(const sdbus::ObjectPath& TrackId)
{
object_->emitSignal("TrackRemoved").onInterface(INTERFACE_NAME).withArguments(TrackId);
}
void emitTrackMetadataChanged(const sdbus::ObjectPath& TrackId, const std::map<std::string, sdbus::Variant>& Metadata)
{
object_->emitSignal("TrackMetadataChanged").onInterface(INTERFACE_NAME).withArguments(TrackId, Metadata);
}
private:
virtual std::vector<std::map<std::string, sdbus::Variant>> GetTracksMetadata(const std::vector<sdbus::ObjectPath>& TrackIds) = 0;
virtual void AddTrack(const std::string& Uri, const sdbus::ObjectPath& AfterTrack, const bool& SetAsCurrent) = 0;
virtual void RemoveTrack(const sdbus::ObjectPath& TrackId) = 0;
virtual void GoTo(const sdbus::ObjectPath& TrackId) = 0;
private:
virtual std::vector<sdbus::ObjectPath> Tracks() = 0;
virtual bool CanEditTracks() = 0;
private:
sdbus::IObject* object_;
};
}}} // namespaces
#endif