Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
property_panel.hpp File Reference

PropertyPanel — typed property editor with Boolean / Choice / Slider / Button / MultiChoice / Text variants and optional PropertiesFile persistence. More...

#include <algorithm>
#include <cstdint>
#include <functional>
#include <optional>
#include <string>
#include <string_view>
#include <unordered_set>
#include <utility>
#include <variant>
#include <vector>
#include <pulp/state/properties_file.hpp>
#include <pulp/view/view.hpp>

Go to the source code of this file.

Classes

class  pulp::view::PropertyPanel
struct  pulp::view::PropertyPanel::Property

Namespaces

namespace  pulp
namespace  pulp::view
 Hover-cursor tracking for platform window hosts.

Detailed Description

PropertyPanel — typed property editor with Boolean / Choice / Slider / Button / MultiChoice / Text variants and optional PropertiesFile persistence.

PropertyPanel is a sister widget to PreferencesPanel: while PreferencesPanel manages "which page is shown", PropertyPanel hosts the typed property editors on a page. Each property has a stable key, a display label, a kind (BooleanToggle, Choice, Slider, Button, MultiChoice, Text), and a typed value. The panel exposes:

  • add_* builders for each typed variant,
  • value_for(key) / set_value(key, ...) typed getters/setters,
  • simulate_* test helpers (toggle, choose, slide, click, multi-check, set-text) that fire the same logic a real UI event would,
  • bind_persistence(PropertiesFile*) to read all current values from a PropertiesFile lane (one-shot at bind time) and to write every subsequent change back under each property's key.

The persistence keys are the property keys verbatim — callers typically pass a "section.field" form (e.g. "audio.input_gain"). bind_persistence is idempotent: a second bind to a different store drops the first.

PropertyPanel extends View so it can sit in a PreferencesPanel page. It does not paint chrome in the headless / fallback path — hosts can render the typed editors however they want by observing properties() + per-property on_change. The widget is the authoritative state holder.

License-lineage note: the typed variants mirror the conceptual menu of the reference framework's PropertyPanel, but the surface (add_boolean, add_choice, …, bind_persistence) is Pulp-native and the persistence story leans on Pulp's existing state::PropertiesFile.