From 145149bd21f5328681f47d82ad0cf8241e5fab36 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 11 Feb 2022 04:44:30 +0000 Subject: [PATCH] Update to latest DPF state API Signed-off-by: falkTX --- dpf | 2 +- src/CardinalPlugin.cpp | 34 +++++++++++++--------------------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/dpf b/dpf index 4ebd02b..bc57421 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit 4ebd02b0ee1a019d46bcd065e21dc68f8af80031 +Subproject commit bc57421bf76caab1581ded21d0b0aa66543c21bf diff --git a/src/CardinalPlugin.cpp b/src/CardinalPlugin.cpp index b8da754..2c7efb9 100644 --- a/src/CardinalPlugin.cpp +++ b/src/CardinalPlugin.cpp @@ -715,38 +715,30 @@ protected: #endif } - void initState(const uint32_t index, String& stateKey, String& defaultStateValue) override + void initState(const uint32_t index, State& state) override { - defaultStateValue = ""; - switch (index) { case 0: - stateKey = "patch"; + state.hints = kStateIsBase64Blob | kStateIsOnlyForDSP; + state.key = "patch"; + state.label = "Patch"; break; case 1: - stateKey = "screenshot"; + state.hints = kStateIsHostReadable | kStateIsBase64Blob; + state.key = "screenshot"; + state.label = "Screenshot"; break; case 2: - stateKey = "comment"; + state.hints = kStateIsHostWritable; + state.key = "comment"; + state.label = "Comment"; break; - #ifndef HEADLESS case 3: - stateKey = "windowSize"; + state.hints = kStateIsOnlyForUI; + state.key = "windowSize"; + state.label = "Window size"; break; - #endif - } - } - - uint32_t getStateHints(const uint32_t index) override - { - switch (index) - { - case 1: // screenshot - case 2: // comment - return kStateIsHostVisible; - default: - return 0x0; } }