linuxsampler 2.3.1
LinuxSampler::InstrumentManager Class Referenceabstract

Abstract interface class for InstrumentManagers. More...

#include <InstrumentManager.h>

Classes

struct  instrument_id_t
 Reflects unique ID of an instrument. More...
 
struct  instrument_info_t
 Rather abstract informations about an instrument. More...
 

Public Types

enum  mode_t { ON_DEMAND = 0 , ON_DEMAND_HOLD = 1 , PERSISTENT = 2 }
 Defines life-time of an instrument. More...
 

Public Member Functions

virtual std::vector< instrument_id_tInstruments ()=0
 Returns all managed instruments.
 
virtual mode_t GetMode (const instrument_id_t &ID)=0
 Returns the current life-time strategy for the given instrument.
 
virtual void SetMode (const instrument_id_t &ID, mode_t Mode)=0
 Change the current life-time strategy for the given instrument.
 
void SetModeInBackground (const instrument_id_t &ID, mode_t Mode)
 Same as SetMode(), but with the difference that this method won't block.
 
virtual String GetInstrumentName (instrument_id_t ID)=0
 Returns the name of the given instrument as reflected by its file.
 
virtual String GetInstrumentDataStructureName (instrument_id_t ID)=0
 Returns a textual identifier of the data structure for the given loaded instrument, which usually reflects the name of of the library used to load the instrument (i.e.
 
virtual String GetInstrumentDataStructureVersion (instrument_id_t ID)=0
 Returns the version of the data structure for the given loaded instrument, which usually reflects the version of the library which was used to load the instrument (i.e.
 
virtual InstrumentEditorLaunchInstrumentEditor (EngineChannel *pEngineChannel, instrument_id_t ID, void *pUserData=NULL) throw (InstrumentManagerException) =0
 Spawn an appropriate editor for the given instrument that is actually capable to handle the instrument's format and data structure.
 
virtual std::vector< instrument_id_tGetInstrumentFileContent (String File) throw (InstrumentManagerException) =0
 Returns a list of instrument IDs of the provided instrument file in case the provided file's format is supported.
 
virtual instrument_info_t GetInstrumentInfo (instrument_id_t ID) throw (InstrumentManagerException) =0
 Get detailed informations about the provided instrument file.
 

Static Public Member Functions

static void LoadInstrumentInBackground (instrument_id_t ID, EngineChannel *pEngineChannel)
 Same as loading the given instrument directly on the given EngineChannel, but this method will not block, instead it will load the instrument in a separate thread.
 
static void StopBackgroundThread ()
 Stops the background thread that has been started by LoadInstrumentInBackground.
 

Detailed Description

Abstract interface class for InstrumentManagers.

Sampler engines should provide an InstrumentManager for allowing detailed information retrieval and setting of its managed instruments through this general API.

Definition at line 52 of file InstrumentManager.h.

Member Enumeration Documentation

◆ mode_t

Defines life-time of an instrument.

Enumerator
ON_DEMAND 

Instrument will be loaded when needed, freed once not needed anymore.

ON_DEMAND_HOLD 

Instrument will be loaded when needed and kept even if not needed anymore.

PERSISTENT 

Instrument will immediately be loaded and kept all the time.

Definition at line 57 of file InstrumentManager.h.

Member Function Documentation

◆ GetInstrumentDataStructureName()

virtual String LinuxSampler::InstrumentManager::GetInstrumentDataStructureName ( instrument_id_t  ID)
pure virtual

Returns a textual identifier of the data structure for the given loaded instrument, which usually reflects the name of of the library used to load the instrument (i.e.

"libgig").

This method has to be implemented by the descendant.

◆ GetInstrumentDataStructureVersion()

virtual String LinuxSampler::InstrumentManager::GetInstrumentDataStructureVersion ( instrument_id_t  ID)
pure virtual

Returns the version of the data structure for the given loaded instrument, which usually reflects the version of the library which was used to load the instrument (i.e.

"3.1.0").

This method has to be implemented by the descendant.

◆ GetInstrumentFileContent()

virtual std::vector< instrument_id_t > LinuxSampler::InstrumentManager::GetInstrumentFileContent ( String  File)
throw (InstrumentManagerException
)
pure virtual

Returns a list of instrument IDs of the provided instrument file in case the provided file's format is supported.

Exceptions
InstrumentManagerExceptionif the format of the provided instrument file is not supported

◆ GetInstrumentInfo()

virtual instrument_info_t LinuxSampler::InstrumentManager::GetInstrumentInfo ( instrument_id_t  ID)
throw (InstrumentManagerException
)
pure virtual

Get detailed informations about the provided instrument file.

Exceptions
InstrumentManagerExceptionif the format of the provided instrument file is not supported

◆ GetInstrumentName()

virtual String LinuxSampler::InstrumentManager::GetInstrumentName ( instrument_id_t  ID)
pure virtual

Returns the name of the given instrument as reflected by its file.

This method has to be implemented by the descendant.

◆ GetMode()

virtual mode_t LinuxSampler::InstrumentManager::GetMode ( const instrument_id_t ID)
pure virtual

Returns the current life-time strategy for the given instrument.

This method has to be implemented by the descendant.

◆ Instruments()

virtual std::vector< instrument_id_t > LinuxSampler::InstrumentManager::Instruments ( )
pure virtual

Returns all managed instruments.

This method has to be implemented by the descendant.

◆ LaunchInstrumentEditor()

virtual InstrumentEditor * LinuxSampler::InstrumentManager::LaunchInstrumentEditor ( EngineChannel pEngineChannel,
instrument_id_t  ID,
void pUserData = NULL 
)
throw (InstrumentManagerException
)
pure virtual

Spawn an appropriate editor for the given instrument that is actually capable to handle the instrument's format and data structure.

The instrument editor will be hosted in the sampler's own process to allow immediate live-editing of the instrument while playing the instrument in parallel by the sampler.

For this to work, instrument editor applications have to implement the abstract interface class InstrumentEditor and have to generate a plugin DLL that has to be placed into the appropriate plugin directory of the sampler.

This method has to be implemented by the descendant.

Parameters
pEngineChannel- engine channel for which an instrument editor shall be launched for
ID- the instrument for which an editor should be spawned for
pUserData- (optional) arbitrary 3rd party user data that will blindly be passed to InstrumentEditor::Main()
Returns
pointer to the launched editor
Exceptions
InstrumentManagerException- in case no compatible instrument editor is registered to the sampler

◆ LoadInstrumentInBackground()

static void LinuxSampler::InstrumentManager::LoadInstrumentInBackground ( instrument_id_t  ID,
EngineChannel pEngineChannel 
)
static

Same as loading the given instrument directly on the given EngineChannel, but this method will not block, instead it will load the instrument in a separate thread.

Parameters
ID- the instrument to be loaded
pEngineChannel- on which engine channel the instrument should be loaded

◆ SetMode()

virtual void LinuxSampler::InstrumentManager::SetMode ( const instrument_id_t ID,
mode_t  Mode 
)
pure virtual

Change the current life-time strategy for the given instrument.

This method has to be implemented by the descendant.

◆ SetModeInBackground()

void LinuxSampler::InstrumentManager::SetModeInBackground ( const instrument_id_t ID,
mode_t  Mode 
)

Same as SetMode(), but with the difference that this method won't block.

◆ StopBackgroundThread()

static void LinuxSampler::InstrumentManager::StopBackgroundThread ( )
static

Stops the background thread that has been started by LoadInstrumentInBackground.


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