Musik-Ansicht zum Durchwischen: Cover, Lautstaerke/Spulen, Quellenwahl; Zeitzone von HA
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
f74d8c8c59
commit
bc1afc4f23
4 files changed
+651
-80
No files matched your search
+27
-2
@@ -1,27 +1,52 @@
|
||||
// Minimal KDE Connect client: pairing + MPRIS (what is playing where).
|
||||
// Minimal KDE Connect client: pairing + MPRIS (what is playing where, album art, control).
|
||||
// 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>
|
||||
|
||||
static constexpr int KDE_ART_SIZE = 120; // album art is scaled/cropped to this square (RGB565)
|
||||
|
||||
struct NowPlaying {
|
||||
bool valid = false; // something is known (playing or paused)
|
||||
bool playing = false;
|
||||
bool canSeek = false;
|
||||
bool pinned = false; // the user picked this source manually
|
||||
int volume = -1; // 0..100, -1 = unknown
|
||||
char device[33] = "";
|
||||
char player[33] = "";
|
||||
char title[97] = "";
|
||||
char artist[65] = "";
|
||||
char album[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
|
||||
uint32_t seq = 0; // changes whenever title/artist/state/device/volume change
|
||||
uint32_t artSeq = 0; // changes whenever the album art buffer changes
|
||||
bool hasArt = false;
|
||||
};
|
||||
|
||||
struct PlayerEntry {
|
||||
char key[72];
|
||||
char device[33];
|
||||
char player[33];
|
||||
char title[49];
|
||||
bool playing;
|
||||
bool selected;
|
||||
};
|
||||
|
||||
void kdeStart(const char* deviceName);
|
||||
void kdeGetNowPlaying(NowPlaying& out);
|
||||
// Album art of the current track, KDE_ART_SIZE x KDE_ART_SIZE RGB565 (nullptr if none yet).
|
||||
const uint16_t* kdeArt();
|
||||
// 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);
|
||||
void kdeSetVolume(int volume);
|
||||
void kdeSeek(int32_t posMs);
|
||||
// All known players of connected, paired devices.
|
||||
int kdeListPlayers(PlayerEntry* out, int max);
|
||||
// Show this player instead of picking automatically (nullptr = automatic again).
|
||||
void kdeSelectPlayer(const char* key);
|
||||
// Number of paired devices currently connected.
|
||||
int kdeConnectedCount();
|
||||
Reference in new issue
Block a user