Krotos Modules 3
Loading...
Searching...
No Matches
krotos::SamplesTree::Sample Class Reference

A wrapper around an individual sample in the tree, with parameters for mute, solo, path and name. You can set these values directly and their value in the tree will be updated, and listeners will be called. More...

#include <SampleDataTree.h>

Inheritance diagram for krotos::SamplesTree::Sample:

Public Member Functions

 Sample (ValueTree tree, UndoManager *undoManager=nullptr)
 Creates a Sample wrapper object.
 
void valueTreePropertyChanged (ValueTree &treeWhosePropertyHasChanged, const Identifier &property) override
 
int getIndex () const
 Returns the index of the sample within the parent tree.
 

Public Attributes

std::function< void(Identifier parameterProperty, const var &value)> onChanged {nullptr}
 Assign a lambda to be called when the sample is changed.
 
std::function< void()> muteChanged {nullptr}
 Assign a lambda to this to get a callback when the mute parameter changes.
 
std::function< void()> soloChanged {nullptr}
 
CachedValue< bool > muteValue
 
CachedValue< bool > soloValue
 
CachedValue< String > pathValue
 
CachedValue< String > nameValue
 
ValueTree valueTree
 

Private Attributes

UndoManager * m_undoManager {nullptr}
 

Detailed Description

A wrapper around an individual sample in the tree, with parameters for mute, solo, path and name. You can set these values directly and their value in the tree will be updated, and listeners will be called.

Constructor & Destructor Documentation

◆ Sample()

krotos::SamplesTree::Sample::Sample ( ValueTree tree,
UndoManager * undoManager = nullptr )

Creates a Sample wrapper object.

Parameters
treeThe parent tree
undoManagerA pointer to the UndoManager in use.

Member Function Documentation

◆ getIndex()

int krotos::SamplesTree::Sample::getIndex ( ) const
inline

Returns the index of the sample within the parent tree.

◆ valueTreePropertyChanged()

void krotos::SamplesTree::Sample::valueTreePropertyChanged ( ValueTree & treeWhosePropertyHasChanged,
const Identifier & property )
override

Member Data Documentation

◆ m_undoManager

UndoManager* krotos::SamplesTree::Sample::m_undoManager {nullptr}
private

◆ muteChanged

std::function<void()> krotos::SamplesTree::Sample::muteChanged {nullptr}

Assign a lambda to this to get a callback when the mute parameter changes.

◆ muteValue

CachedValue<bool> krotos::SamplesTree::Sample::muteValue

◆ nameValue

CachedValue<String> krotos::SamplesTree::Sample::nameValue

◆ onChanged

std::function<void(Identifier parameterProperty, const var& value)> krotos::SamplesTree::Sample::onChanged {nullptr}

Assign a lambda to be called when the sample is changed.

◆ pathValue

CachedValue<String> krotos::SamplesTree::Sample::pathValue

◆ soloChanged

std::function<void()> krotos::SamplesTree::Sample::soloChanged {nullptr}

◆ soloValue

CachedValue<bool> krotos::SamplesTree::Sample::soloValue

◆ valueTree

ValueTree krotos::SamplesTree::Sample::valueTree

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