Classes | Public Types | Public Member Functions | List of all members
Table Class Referenceabstract

A table is a data structure that allows editing of a look up table with a TableEditor. More...

Inheritance diagram for Table:
SafeChangeBroadcaster MidiTable SampleLookupTable

Classes

struct  GraphPoint
 A representation of a graph point. More...
 

Public Types

enum  DataType { Midi = 0, SampleLookupTable }
 A Table can use two data types. More...
 

Public Member Functions

void createPath (Path &normalizedPath) const
 This generates a normalized path from the GraphPoint array. More...
 
virtual String exportData () const
 Exports the data as base64 encoded String. More...
 
virtual void fillLookUpTable ()
 Fills the look up table with the graph points generated from calculateGraphPoints() More...
 
GraphPoint getGraphPoint (int pointIndex) const
 Get a copy of the graph point at pointIndex. More...
 
int getNumGraphPoints () const
 Returns the number of graph points.
 
virtual int getTableSize () const =0
 Overwrite this and return the table size. More...
 
virtual float * getWritePointer ()=0
 Overwrite this and return a pointer to the data array. More...
 
String getXValueText (float value)
 This returns a String that can be used for displaying purposes. More...
 
virtual void restoreData (const String &savedString)
 Restores the data from a base64 encoded String. More...
 
void setGraphPoints (const Array< GraphPoint > &newGraphPoints, int numPoints)
 Sets the GraphPoints. More...
 
 Table ()
 Creates a new table of the specified type. More...
 
- Public Member Functions inherited from SafeChangeBroadcaster
void addChangeListener (SafeChangeListener *listener)
 Registers a listener to receive change callbacks from this broadcaster. More...
 
void removeAllChangeListeners ()
 Removes all listeners from the list. More...
 
void removeChangeListener (SafeChangeListener *listener)
 Unregisters a listener from the list. More...
 
void sendAllocationFreeChangeMessage ()
 This will send a message without allocating a message slot. More...
 
void sendChangeMessage (const String &=String())
 Causes an asynchronous change message to be sent to all the registered listeners. More...
 
void sendSynchronousChangeMessage ()
 Sends a synchronous change message to all the registered listeners. More...
 

Detailed Description

A table is a data structure that allows editing of a look up table with a TableEditor.

It uses a list of graph points to create a path which is rendered to a float array of the desired size.

Member Enumeration Documentation

enum DataType

A Table can use two data types.

Enumerator
Midi 

in this mode, the table contains 128 elements and can be used for everything midi-related.

SampleLookupTable 

in this mode, the table contains 2048 elements and can be used for holding everything sample-related (waveforms, envelopes, etc.)

Constructor & Destructor Documentation

Table ( )

Creates a new table of the specified type.

Member Function Documentation

void createPath ( Path &  normalizedPath) const

This generates a normalized path from the GraphPoint array.

This is called by the editor to draw the path under the DragPoints.

virtual String exportData ( ) const
inlinevirtual

Exports the data as base64 encoded String.

This is not a ValueTree (so RestorableObject is no base class from Table), because it needs to be embedded in an XML attribute

See also
restoreData()
void fillLookUpTable ( )
virtual

Fills the look up table with the graph points generated from calculateGraphPoints()

Don't call this too often as it is quite heavy!

GraphPoint getGraphPoint ( int  pointIndex) const
inline

Get a copy of the graph point at pointIndex.

virtual int getTableSize ( ) const
pure virtual

Overwrite this and return the table size.

virtual float* getWritePointer ( )
pure virtual

Overwrite this and return a pointer to the data array.

String getXValueText ( float  value)
inline

This returns a String that can be used for displaying purposes.

You can supply a lambda for the conversion using setTextConverter().

virtual void restoreData ( const String &  savedString)
inlinevirtual

Restores the data from a base64 encoded String.

See also
exportData()
void setGraphPoints ( const Array< GraphPoint > &  newGraphPoints,
int  numPoints 
)

Sets the GraphPoints.

If you need to refresh the internal table, you also have to call fillLookUpTable().

©2017 HISE. This documentation is autogenerated from the HISE source code using Doxygen.