KDE Connect: Musik-Anzeige mit Uhr, Koppeln mehrerer Geraete
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
3907b07171
commit
f74d8c8c59
6 files changed
+976
-9
No files matched your search
@@ -0,0 +1,27 @@
|
||||
// Minimal KDE Connect client: pairing + MPRIS (what is playing where).
|
||||
// Runs in its own FreeRTOS task; the functions below are safe to call from the UI loop.
|
||||
#pragma once
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
struct NowPlaying {
|
||||
bool valid = false; // something is known (playing or paused)
|
||||
bool playing = false;
|
||||
char device[33] = "";
|
||||
char player[33] = "";
|
||||
char title[97] = "";
|
||||
char artist[65] = "";
|
||||
int32_t posMs = 0, lenMs = 0; // position at atMs (millis())
|
||||
uint32_t atMs = 0;
|
||||
uint32_t seq = 0; // changes whenever title/artist/state/device change
|
||||
};
|
||||
|
||||
void kdeStart(const char* deviceName);
|
||||
void kdeGetNowPlaying(NowPlaying& out);
|
||||
// Returns a non-zero id while a pairing request waits for an answer and copies the device name.
|
||||
uint32_t kdePairRequest(char* name, size_t n);
|
||||
void kdeAnswerPair(bool accept);
|
||||
// "PlayPause", "Next", "Previous" for the player shown in kdeGetNowPlaying.
|
||||
void kdeMediaAction(const char* action);
|
||||
// Number of paired devices currently connected.
|
||||
int kdeConnectedCount();
|
||||
Reference in new issue
Block a user