d5e827112a
- Created PROTOCOL.md to outline the MusicBridge protocol v1, detailing setup, TLS, pairing, state management, and command structure. - Implemented SystemVolume class for managing system audio levels, including methods for setting, reading, changing, and muting volume. - Added unit tests for the MusicBridge agent, covering pairing, identity storage, command validation, and media state management. - Included tests for real-time media reading from Windows and ensured proper handling of artwork caching and retrieval.
14 lines
371 B
C#
14 lines
371 B
C#
using QRCoder;
|
|
|
|
namespace MusicBridge.Agent.Network;
|
|
|
|
internal static class PairingQr
|
|
{
|
|
public static byte[] Render(ConnectionInvitation invitation)
|
|
{
|
|
using var data = QRCodeGenerator.GenerateQrCode(invitation.ToQrPayload(), QRCodeGenerator.ECCLevel.M);
|
|
using var renderer = new PngByteQRCode(data);
|
|
return renderer.GetGraphic(6);
|
|
}
|
|
}
|