looper/dbus.hpp

26 lines
731 B
C++
Raw Normal View History

#pragma once
#include <sdbus-c++/sdbus-c++.h>
#include "playback.h"
class DBusAPI {
friend class DBusAPISender;
static const char *serviceName;
static const char *objectPath;
static const char *interfaceName;
std::unique_ptr<sdbus::IConnection> connection;
std::unique_ptr<sdbus::IObject> api;
public:
Playback *playback;
DBusAPI(Playback *playback);
};
class DBusAPISender {
std::unique_ptr<sdbus::IProxy> proxy;
std::unique_ptr<sdbus::IConnection> connection;
bool connected = true;
public:
void playFile(std::string file);
void setPitch(double pitch);
void setTempo(double tempo);
void setSpeed(double speed);
bool isOnlyInstance();
DBusAPISender();
};