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

#include <ModulationAssignerTable.h>

Inheritance diagram for krotos::ModulationAssignerTable:

Classes

struct  ComponentIds
 
class  ModDepthSlider
 

Public Types

enum  ColumnIDs { col_Source = 1 , col_Destination = 2 , col_Depth = 3 , col_Delete = 4 }
 

Public Member Functions

 ModulationAssignerTable (ModulationAssigner &owner, String name, String id)
 
int getNumRows () override
 
void paintRowBackground (Graphics &g, int rowNumber, int width, int height, bool rowIsSelected) override
 
void paintCell (Graphics &g, int rowNumber, int columnId, int width, int height, bool rowIsSelected) override
 
Component * refreshComponentForCell (int rowNumber, int columnId, bool isRowSelected, Component *existingComponentToUpdate) override
 
void paint (Graphics &g)
 
void resized () override
 
void addRow (const ValueTree &modulationInstanceTree)
 
void deleteRow (const ValueTree &modulationInstanceTree, int row, bool notifyAssigner)
 
void deleteRow (int rowNumber, bool notifyAssigner)
 
void deleteRow (const ValueTree &modulationInstanceTree, bool notifyAssigner)
 
const String & getId ()
 

Private Attributes

ModulationAssignerm_assigner
 
const Identifier m_depthIdentifier {"depth"}
 
std::vector< ValueTree > m_modulationTrees
 
TextButton m_backButton
 
Label m_titleLabel
 
std::map< ValueTree, int > m_tableMap
 
StringArray m_sources
 
StringArray m_destinations
 
TableListBox m_table
 
Font m_font {14.0f}
 
const int m_padding {5}
 
int m_numRows
 
const int k_dropTabIndex {0}
 
const int k_maxAppendLength {16}
 
String m_id
 

Member Enumeration Documentation

◆ ColumnIDs

IDs for the table list box columns.

Enumerator
col_Source 
col_Destination 
col_Depth 
col_Delete 

Constructor & Destructor Documentation

◆ ModulationAssignerTable()

krotos::ModulationAssignerTable::ModulationAssignerTable ( ModulationAssigner & owner,
String name,
String id )

Member Function Documentation

◆ addRow()

void krotos::ModulationAssignerTable::addRow ( const ValueTree & modulationInstanceTree)

Adds a row to the table, extracting the modulation and destination info from the modulationInstanceTree ValueTree

Parameters
modulationInstanceTreeA "MODULATION" child tree which contains all modulation info

◆ deleteRow() [1/3]

void krotos::ModulationAssignerTable::deleteRow ( const ValueTree & modulationInstanceTree,
bool notifyAssigner )

Searches the table for a given ValueTree and deletes that row, and if specified, notifies the modulation assigner to delete that modulation instance via the modulationDeleted callback.

Parameters
modulationInstanceTreeA "MODULATION" child tree which contains all modulation info
notifyAssignerCalls modulationDeleted() to notify the ModulationAssigner that something was deleted from the table. This can be used to differentiate between a delete that should just remove the row from the GUI, or remove the row from the GUI and delete the modulation instance as well.

◆ deleteRow() [2/3]

void krotos::ModulationAssignerTable::deleteRow ( const ValueTree & modulationInstanceTree,
int row,
bool notifyAssigner )

Delete a row specifying the row it's on and ValueTree

Parameters
modulationInstanceTreeA "MODULATION" child tree which contains all modulation info
rowNumberThe index of the row to delete.
notifyAssignerCalls modulationDeleted() to notify the ModulationAssigner that something was deleted from the table. This can be used to differentiate between a delete that should just remove the row from the GUI, or remove the row from the GUI and delete the modulation instance as well.

◆ deleteRow() [3/3]

void krotos::ModulationAssignerTable::deleteRow ( int rowNumber,
bool notifyAssigner )

Deletes the given rowNumber

Parameters
rowNumberThe index of the row to delete.
notifyAssignerCalls modulationDeleted() to notify the ModulationAssigner that something was deleted from the table. This can be used to differentiate between a delete that should just remove the row from the GUI, or remove the row from the GUI and delete the modulation instance as well.

◆ getId()

const String & krotos::ModulationAssignerTable::getId ( )
inline

◆ getNumRows()

int krotos::ModulationAssignerTable::getNumRows ( )
override

◆ paint()

void krotos::ModulationAssignerTable::paint ( Graphics & g)

◆ paintCell()

void krotos::ModulationAssignerTable::paintCell ( Graphics & g,
int rowNumber,
int columnId,
int width,
int height,
bool rowIsSelected )
override

◆ paintRowBackground()

void krotos::ModulationAssignerTable::paintRowBackground ( Graphics & g,
int rowNumber,
int width,
int height,
bool rowIsSelected )
override

◆ refreshComponentForCell()

Component * krotos::ModulationAssignerTable::refreshComponentForCell ( int rowNumber,
int columnId,
bool isRowSelected,
Component * existingComponentToUpdate )
override

◆ resized()

void krotos::ModulationAssignerTable::resized ( )
override

Member Data Documentation

◆ k_dropTabIndex

const int krotos::ModulationAssignerTable::k_dropTabIndex {0}
private

◆ k_maxAppendLength

const int krotos::ModulationAssignerTable::k_maxAppendLength {16}
private

◆ m_assigner

ModulationAssigner& krotos::ModulationAssignerTable::m_assigner
private

◆ m_backButton

TextButton krotos::ModulationAssignerTable::m_backButton
private

◆ m_depthIdentifier

const Identifier krotos::ModulationAssignerTable::m_depthIdentifier {"depth"}
private

◆ m_destinations

StringArray krotos::ModulationAssignerTable::m_destinations
private

◆ m_font

Font krotos::ModulationAssignerTable::m_font {14.0f}
private

◆ m_id

String krotos::ModulationAssignerTable::m_id
private

◆ m_modulationTrees

std::vector<ValueTree> krotos::ModulationAssignerTable::m_modulationTrees
private

◆ m_numRows

int krotos::ModulationAssignerTable::m_numRows
private

◆ m_padding

const int krotos::ModulationAssignerTable::m_padding {5}
private

◆ m_sources

StringArray krotos::ModulationAssignerTable::m_sources
private

◆ m_table

TableListBox krotos::ModulationAssignerTable::m_table
private

◆ m_tableMap

std::map<ValueTree, int> krotos::ModulationAssignerTable::m_tableMap
private

◆ m_titleLabel

Label krotos::ModulationAssignerTable::m_titleLabel
private

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