C# Class GAudio.GATActiveSampleBank

Adds processed samples caching functionnalities to GATSampleBank.
Inheritance: GATSampleBank
Mostra file Open project: gregzo/G-Audio Class Usage Examples

Public Methods

Method Description
AddSample ( GATData data, string sampleName ) : void
FlushCacheForEnvelope ( GATEnvelope envelope ) : void

Flushs all cached samples associated with the specified envelope.

GetProcessedSample ( int indexInBank, GATEnvelope envelope, double pitch = 1d ) : IGATProcessedSample
GetProcessedSample ( string sampleName, GATEnvelope envelope, double pitch = 1d ) : IGATProcessedSample

Gets a processed sample container that will automatically update according to the envelope. Play it directly, not via GATPlayer : all envelope updates will be handled, even when overlapping sounds have their envelope changed. Note that the pitch parameter will only be taken into account by GATResamplingSampleBank instances.

RemoveSample ( string name ) : void

Protected Methods

Method Description
CleanUpCache ( ) : void

Only call when destroying!

OnDestroy ( ) : void

Method Details

AddSample() public method

public AddSample ( GATData data, string sampleName ) : void
data GATData
sampleName string
return void

CleanUpCache() protected method

Only call when destroying!
protected CleanUpCache ( ) : void
return void

FlushCacheForEnvelope() public method

Flushs all cached samples associated with the specified envelope.
public FlushCacheForEnvelope ( GATEnvelope envelope ) : void
envelope GATEnvelope Envelope.
return void

GetProcessedSample() public method

public GetProcessedSample ( int indexInBank, GATEnvelope envelope, double pitch = 1d ) : IGATProcessedSample
indexInBank int
envelope GATEnvelope
pitch double
return IGATProcessedSample

GetProcessedSample() public method

Gets a processed sample container that will automatically update according to the envelope. Play it directly, not via GATPlayer : all envelope updates will be handled, even when overlapping sounds have their envelope changed. Note that the pitch parameter will only be taken into account by GATResamplingSampleBank instances.
public GetProcessedSample ( string sampleName, GATEnvelope envelope, double pitch = 1d ) : IGATProcessedSample
sampleName string /// The sample's name in the loaded SoundBank ///
envelope GATEnvelope /// The envelope may be null if you need the whole, unprocessed sample. ///
pitch double
return IGATProcessedSample

OnDestroy() protected method

protected OnDestroy ( ) : void
return void

RemoveSample() public method

public RemoveSample ( string name ) : void
name string
return void