All Classes Namespaces Functions Variables Enumerations Enumerator Modules Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
FactoryType Class Referenceabstract
Inheritance diagram for FactoryType:
EnvelopeModulatorFactoryType MidiProcessorFactoryType ModulatorChainFactoryType TimeVariantModulatorFactoryType VoiceStartModulatorFactoryType

Classes

class  Constrainer
 
struct  ProcessorEntry
 

Public Member Functions

 FactoryType (Processor *owner_)
 
virtual int fillPopupMenu (PopupMenu &m, int startIndex=1)
 
virtual ProcessorcreateProcessor (int typeIndex, const String &ProcessorId)=0
 
Identifier getTypeNameFromPopupMenuResult (int resultFromPopupMenu)
 
String getNameFromPopupMenuResult (int resultFromPopupMenu)
 
virtual int getProcessorTypeIndex (const Identifier &typeName) const
 
virtual int getNumProcessors ()
 
virtual bool allowType (const Identifier &typeName) const
 
virtual Array< ProcessorEntrygetAllowedTypes ()
 
virtual void setConstrainer (Constrainer *newConstrainer, bool ownConstrainer=true)
 

Static Public Member Functions

static String getUniqueName (Processor *id, String name=String())
 

Protected Member Functions

virtual const Array
< ProcessorEntry > & 
getTypeNames () const =0
 

Detailed Description

This interface class lets the MainController do its work.

You can tell a Processor (which should also be a Chain to make sense) to use a specific FactoryType with Processor::setFactoryType(), which will then use it in its popup menu to create the possible Processors. Simply overwrite these two functions in your subclass:

Processor* createProcessor  (int typeIndex, const String &id);
const StringArray& getTypeNames() const;

A FactoryType constrains the number of creatable Processors by

Constructor & Destructor Documentation

FactoryType ( Processor owner_)

Creates a Factory type.

Member Function Documentation

bool allowType ( const Identifier &  typeName) const
virtual

Checks if the type of the processor is found in the type name.

You can overwrite this and add more conditions (in this case, call the base class method first to keep things safe!

virtual Processor* createProcessor ( int  typeIndex,
const String &  ProcessorId 
)
pure virtual

Overwrite this function and return a processor of the specific type index.

int fillPopupMenu ( PopupMenu &  m,
int  startIndex = 1 
)
virtual

Fills a popupmenu with all allowed processor types.

You can pass in a startIndex, if you overwrite this method for nested calls.

It returns the last index that can be used for the next menus.

Array< FactoryType::ProcessorEntry > getAllowedTypes ( )
virtual

Returns a string array with all allowed types that this factory can produce.

String getNameFromPopupMenuResult ( int  resultFromPopupMenu)

Returns the typeName using the result from the previously created popupmenu.

int getNumProcessors ( )
virtual

Returns the number of Processors that this factory can create.

the rules defined in allowType are applied before counting the possible processors.

int getProcessorTypeIndex ( const Identifier &  typeName) const
virtual

Returns the index of the type.

Identifier getTypeNameFromPopupMenuResult ( int  resultFromPopupMenu)

Returns the typeName using the result from the previously created popupmenu.

virtual const Array<ProcessorEntry>& getTypeNames ( ) const
protectedpure virtual

This should only be overwritten by the subclasses. For external usage, use getAllowedTypes().

String getUniqueName ( Processor id,
String  name = String() 
)
static

Returns a unique ID for the new Processor.

It scans all Processors and returns something like "Processor12" if there are 11 other Processors with the same ID

void setConstrainer ( Constrainer newConstrainer,
bool  ownConstrainer = true 
)
virtual

adds a Constrainer to a FactoryType. It will be owned by the FactoryType. You can pass nullptr.

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