LinuxSampler::InstrumentManager Class Reference

Abstract interface class for InstrumentManagers. More...

#include <InstrumentManager.h>

List of all members.

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_t
Instruments ()=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 (instrument_id_t ID, void *pUserData=NULL)=0 throw (InstrumentManagerException)
 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_t
GetInstrumentFileContent (String File)=0 throw (InstrumentManagerException)
 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)=0 throw (InstrumentManagerException)
 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

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

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.

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.

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:
InstrumentManagerException if the format of the provided instrument file is not supported
virtual instrument_info_t LinuxSampler::InstrumentManager::GetInstrumentInfo ( instrument_id_t  ID  )  throw (InstrumentManagerException) [pure virtual]

Get detailed informations about the provided instrument file.

Exceptions:
InstrumentManagerException if the format of the provided instrument file is not supported
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.

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.

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

Returns all managed instruments.

This method has to be implemented by the descendant.

virtual InstrumentEditor* LinuxSampler::InstrumentManager::LaunchInstrumentEditor ( 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:
ID - the instrument for which an editor should be spawned for
Parameters:
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
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
Parameters:
pEngineChannel - on which engine channel the instrument should be loaded
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.

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.

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:
Generated on Sat Jan 28 11:44:02 2012 for linuxsampler by  doxygen 1.6.3