Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
klang::Group

Language Guide / Controls and Parameters

Group

klang::Group

Groups controls in the model interface.

Place a Group inside the control declaration to show related controls together in Studio. A group can hold controls, references to controls, or a nested control collection. Grouping keeps the controls available to the model through the same collection.

Example · Group a filter’s controls

Use this in the model constructor.

controls = {
    { "Filter",
        Dial("Cutoff", 20, 12000, 1000),
        Dial("Resonance", 0.1, 4, 0.7)
    }
};

Optional presentation grouping, independent of value ownership. More...

#include <klang.h>

Public Member Functions

 Group (const char *name, std::initializer_list< ControlEntry > controls)
 
 Group (const char *name, Control::Size size, std::initializer_list< ControlEntry > controls)
 
template<class List , std::enable_if_t< std::is_same_v< std::decay_t< List >, std::initializer_list< Control > >, int > = 0>
 Group (const char *name, List &&list)
 
template<class List , std::enable_if_t< std::is_same_v< std::decay_t< List >, std::initializer_list< Control > >, int > = 0>
 Group (const char *name, Control::Size size, List &&list)
 
template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
 Group (const char *name, Entries &&... entries)
 
template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
 Group (Entries &&... entries)
 
template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
 Group (const char *name, Control::Size size, Entries &&... entries)
 
template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
 Group (Control::Size size, Entries &&... entries)
 

Public Attributes

const char * name
 
Control::Size size
 
std::vector< ControlEntry > controls
 

Detailed Description

Definition at line 2036 of file klang.h.

Constructor & Destructor Documentation

◆ Group() [1/8]

klang::Group::Group ( const char * name,
std::initializer_list< ControlEntry > controls )
inline

Definition at line 2041 of file klang.h.

const Control::Size Automatic
Definition klang.h:1914
Control::Size size
Definition klang.h:2038
std::vector< ControlEntry > controls
Definition klang.h:2039
const char * name
Definition klang.h:2037

◆ Group() [2/8]

klang::Group::Group ( const char * name,
Control::Size size,
std::initializer_list< ControlEntry > controls )
inline

Definition at line 2043 of file klang.h.

◆ Group() [3/8]

template<class List , std::enable_if_t< std::is_same_v< std::decay_t< List >, std::initializer_list< Control > >, int > = 0>
klang::Group::Group ( const char * name,
List && list )
inline

Definition at line 2048 of file klang.h.

2048 : name(name), size(Automatic) {
2049 for (const auto& control : list) controls.emplace_back(control);
2050 }

References controls.

◆ Group() [4/8]

template<class List , std::enable_if_t< std::is_same_v< std::decay_t< List >, std::initializer_list< Control > >, int > = 0>
klang::Group::Group ( const char * name,
Control::Size size,
List && list )
inline

Definition at line 2052 of file klang.h.

2052 : name(name), size(size) {
2053 for (const auto& control : list) controls.emplace_back(control);
2054 }

References controls.

◆ Group() [5/8]

template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
klang::Group::Group ( const char * name,
Entries &&... entries )
inline

Definition at line 2056 of file klang.h.

2057 : name(name), size(Automatic), controls { ControlEntry(std::forward<Entries>(entries))... } {}

◆ Group() [6/8]

template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
klang::Group::Group ( Entries &&... entries)
inline

Definition at line 2059 of file klang.h.

2060 : name(""), size(Automatic), controls { ControlEntry(std::forward<Entries>(entries))... } {}

◆ Group() [7/8]

template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
klang::Group::Group ( const char * name,
Control::Size size,
Entries &&... entries )
inline

Definition at line 2062 of file klang.h.

2063 : name(name), size(size), controls { ControlEntry(std::forward<Entries>(entries))... } {}

◆ Group() [8/8]

template<class... Entries, std::enable_if_t<(std::is_constructible_v< ControlEntry, Entries && > &&...), int > = 0>
klang::Group::Group ( Control::Size size,
Entries &&... entries )
inline

Definition at line 2065 of file klang.h.

2066 : name(""), size(size), controls { ControlEntry(std::forward<Entries>(entries))... } {}

Member Data Documentation

◆ controls

std::vector<ControlEntry> klang::Group::controls

Definition at line 2039 of file klang.h.

Referenced by Group(), and Group().

◆ name

const char* klang::Group::name

Definition at line 2037 of file klang.h.

◆ size

Control::Size klang::Group::size

Definition at line 2038 of file klang.h.