![]() |
Klang C++ 0.7.15
Language Reference (draft)
|
Variable-sized array, pre-allocated to a max. capacity. More...
#include <klang.h>
Public Member Functions | |
| unsigned int | size () const |
| The current number of items in the array. | |
| void | add (const TYPE &item) |
| Add the specified item to the end of the array. | |
| TYPE * | add () |
| Add a blank item to the end of the array, returning a pointer that allows the item to be modified. | |
| void | clear () |
| Clear the array contents. Only resets the item count, without wiping memory. | |
| float | max () const |
| Find the maximum value in the array. | |
| float | mean () const |
| Find the mean average of values in the array. | |
| float | rms () const |
| Find the root mean squared (RMS) average of values in the array. | |
| void | normalise (float target=1.f, int mode=Peak) |
| Normalises values in the array to the specified target, based on peak, mean, or RMS value;. | |
| TYPE & | operator[] (int index) |
| Returns a reference to the array item at the given index. | |
| const TYPE & | operator[] (int index) const |
| Returns a read-only reference to the array item at the given index. | |
| Array (std::initializer_list< TYPE > init_list) | |
| Construct an array given the specified values. | |
| Array ()=default | |
| Construct an empty array. | |
Static Public Member Functions | |
| static int | capacity () |
| The maximum capacity of the array. | |
Public Attributes | |
| unsigned int | count = 0 |
| TYPE | items [CAPACITY] |
|
inline |
Definition at line 375 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, and klang::Array< TYPE, CAPACITY >::items.
|
default |
|
inline |
Definition at line 324 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, and klang::Array< TYPE, CAPACITY >::items.
|
inline |
Definition at line 318 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, and klang::Array< TYPE, CAPACITY >::items.
Referenced by klang::Generic::Graph< SIZE >::add(), klang::Generic::Graph< SIZE >::add(), klang::Menu(), klang::Menu(), klang::Generic::Graph< SIZE >::plot(), klang::Generic::Graph< SIZE >::plot(), and klang::Generic::Graph< SIZE >::plot().
|
inlinestatic |
|
inline |
Definition at line 331 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count.
Referenced by klang::Generic::Graph< SIZE >::clear().
|
inline |
Definition at line 334 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, klang::Array< TYPE, CAPACITY >::items, and klang::Array< TYPE, CAPACITY >::max().
Referenced by klang::Array< TYPE, CAPACITY >::max(), and klang::Array< TYPE, CAPACITY >::normalise().
|
inline |
Definition at line 343 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, and klang::Array< TYPE, CAPACITY >::items.
Referenced by klang::Array< TYPE, CAPACITY >::normalise().
|
inline |
Definition at line 359 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, klang::Array< TYPE, CAPACITY >::items, klang::Array< TYPE, CAPACITY >::max(), klang::Mean, klang::Array< TYPE, CAPACITY >::mean(), klang::Peak, and klang::Array< TYPE, CAPACITY >::rms().
|
inline |
|
inline |
|
inline |
Definition at line 351 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count, and klang::Array< TYPE, CAPACITY >::items.
Referenced by klang::Array< TYPE, CAPACITY >::normalise().
|
inline |
Definition at line 315 of file klang.h.
References klang::Array< TYPE, CAPACITY >::count.
Referenced by klang::Menu(), and klang::Menu().
| unsigned int klang::Array< TYPE, CAPACITY >::count = 0 |
Definition at line 308 of file klang.h.
Referenced by klang::Array< TYPE, CAPACITY >::Array(), klang::Array< TYPE, CAPACITY >::add(), klang::Array< TYPE, CAPACITY >::add(), klang::Synth::allNotesOff(), klang::Array< TYPE, CAPACITY >::clear(), klang::Generic::Graph< SIZE >::Axis::from(), klang::Array< TYPE, CAPACITY >::max(), klang::Array< TYPE, CAPACITY >::mean(), klang::Array< TYPE, CAPACITY >::normalise(), klang::Synth::noteOff(), klang::Synth::onControl(), klang::Synth::onMIDI(), klang::Synth::onPreset(), klang::Controls::operator=(), klang::Synth::playing(), klang::Synth::process(), klang::Array< TYPE, CAPACITY >::rms(), klang::Controls::set(), klang::Array< TYPE, CAPACITY >::size(), and klang::Generic::Graph< SIZE >::truncate().
| TYPE klang::Array< TYPE, CAPACITY >::items[CAPACITY] |
Definition at line 309 of file klang.h.
Referenced by klang::Array< TYPE, CAPACITY >::Array(), klang::Array< TYPE, CAPACITY >::add(), klang::Array< TYPE, CAPACITY >::add(), klang::Synth::indexOf(), klang::Array< TYPE, CAPACITY >::max(), klang::Array< TYPE, CAPACITY >::mean(), klang::Array< TYPE, CAPACITY >::normalise(), klang::Array< TYPE, CAPACITY >::operator[](), klang::Array< TYPE, CAPACITY >::operator[](), and klang::Array< TYPE, CAPACITY >::rms().