25 lines
624 B
C++
25 lines
624 B
C++
#pragma once
|
|
|
|
#include <giomm.h>
|
|
#include <vector>
|
|
|
|
class MprisController {
|
|
public:
|
|
|
|
MprisController();
|
|
|
|
void toggle_play();
|
|
void next_song();
|
|
void previous_song();
|
|
|
|
private:
|
|
Glib::RefPtr<Gio::DBus::Connection> m_connection;
|
|
Glib::RefPtr<Gio::DBus::Proxy> m_proxy;
|
|
|
|
void on_bus_connected(const Glib::RefPtr<Gio::AsyncResult> &result);
|
|
void launchNotification();
|
|
|
|
// Called when the song changes
|
|
void on_properties_changed(const Gio::DBus::Proxy::MapChangedProperties &changed_properties,
|
|
const std::vector<Glib::ustring> &invalidated_properties);
|
|
}; |