DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::plugin::EditorSizeMemory< P > Class Template Reference

The editor size the user last left, in logical pixels, kept by each backend across editor re-opens and saved in the state container (the reserved 'EDSW' / 'EDSH' entries), so a session reopens its editor at that size - in every format, since the size is logical. Only a resizable editor (EditorResize Free or KeepAspect) persists a size; a Fixed one always opens at editorSize. A remembered size is re-checked against the policy, so a later version with another size or policy never opens out of bounds. More...

#include <DSParkPlugin.h>

Public Member Functions

void remember (double logicalWidth, double logicalHeight) noexcept
 
bool remembered (EditorSize &out) const noexcept
 
EditorSize current () const noexcept
 

Static Public Attributes

static constexpr bool kPersists
 

Detailed Description

template<typename P>
class dspark::plugin::EditorSizeMemory< P >

The editor size the user last left, in logical pixels, kept by each backend across editor re-opens and saved in the state container (the reserved 'EDSW' / 'EDSH' entries), so a session reopens its editor at that size - in every format, since the size is logical. Only a resizable editor (EditorResize Free or KeepAspect) persists a size; a Fixed one always opens at editorSize. A remembered size is re-checked against the policy, so a later version with another size or policy never opens out of bounds.

One packed atomic word: the host's UI thread writes it, and state saves (which some hosts run on another thread) read it without tearing.

Definition at line 1460 of file DSParkPlugin.h.

Member Function Documentation

◆ current()

template<typename P >
EditorSize dspark::plugin::EditorSizeMemory< P >::current ( ) const
inlinenoexcept

The size to open the editor at: the remembered one, else editorSize.

Definition at line 1499 of file DSParkPlugin.h.

◆ remember()

template<typename P >
void dspark::plugin::EditorSizeMemory< P >::remember ( double  logicalWidth,
double  logicalHeight 
)
inlinenoexcept

Records the size the editor now has (logical pixels; constrained).

Definition at line 1468 of file DSParkPlugin.h.

◆ remembered()

template<typename P >
bool dspark::plugin::EditorSizeMemory< P >::remembered ( EditorSize &  out) const
inlinenoexcept

The remembered size into out; false when none was recorded.

Definition at line 1489 of file DSParkPlugin.h.

Member Data Documentation

◆ kPersists

template<typename P >
constexpr bool dspark::plugin::EditorSizeMemory< P >::kPersists
staticconstexpr
Initial value:
=
HasEditor<P> && editorResizeOf<P>() != EditorResize::Fixed
Custom-editor switch. With hasEditor = false (or absent) hosts show their generic parameter UI....
@ Fixed
The window is exactly editorSize; hosts cannot drag-resize it.

True when P has a resizable editor, i.e. a size worth keeping.

Definition at line 1464 of file DSParkPlugin.h.


The documentation for this class was generated from the following file: