C# Class GAudio.GATAudioLoader

Singleton class for loading of ogg and wav files from disk. Both async and sync operations supported ( sync operations are in GATAudioLoaderSync.cs ). Use to load user files or files in the StreamingAssets folder.
显示文件 Open project: gregzo/G-Audio Class Usage Examples

Public Methods

Method Description
CancelPendingOperations ( ) : void

Cancels the current operation as well as all pending operations.

EnqueueOperation ( AGATLoadingOperation operation ) : void

The operation queue is serial: queued operations will be executed one by one.

LoadFilesToSampleBank ( string filePaths, PathRelativeType pathType, GATSampleBank targetBank, GATDataAllocationMode allocationMode, OperationCompletedHandler onOperationCompleted, bool forceMono = false ) : void

Convenience method for loading files asynchronously to a sample bank. This method instantiates, configures and enqueues a AGATLoadingOperation. Use NewOperation if you need more control over progress callbacks.

LoadFolderToSampleBank ( string folderPath, PathRelativeType pathType, GATSampleBank targetBank, GATDataAllocationMode allocationMode, OperationCompletedHandler onOperationCompleted, bool forceMono = false ) : void

Convenience method for loading files asynchronously to a sample bank. All wav and ogg files of the specified folder will be loaded. This method instantiates, configures and enqueues a AGATLoadingOperation. Use the NewOperation method if you need more control over progress callbacks.

LoadSync ( AGATAudioFile file, GATDataAllocationMode allocationMode ) : GAudio.GATData[]

Blocking load of wav and ogg files.

NewOperation ( int numFilesToLoad, GATDataAllocationMode allocationMode, FileLoadedHandler onFileWasLoaded, bool forceMono = false ) : AGATLoadingOperation

Gets a LoadingOperation object to which you may add files and callbacks. To start the operation, call EnqueueOperation.

Private Methods

Method Description
GATAudioLoader ( ) : System.ComponentModel
SetupWorker ( ) : void
bw_Completed ( object sender, RunWorkerCompletedEventArgs e ) : void
bw_Progress ( object sender, ProgressChangedEventArgs e ) : void
bw_Work ( object sender, DoWorkEventArgs e ) : void

Method Details

CancelPendingOperations() public method

Cancels the current operation as well as all pending operations.
public CancelPendingOperations ( ) : void
return void

EnqueueOperation() public method

The operation queue is serial: queued operations will be executed one by one.
public EnqueueOperation ( AGATLoadingOperation operation ) : void
operation AGATLoadingOperation
return void

LoadFilesToSampleBank() public method

Convenience method for loading files asynchronously to a sample bank. This method instantiates, configures and enqueues a AGATLoadingOperation. Use NewOperation if you need more control over progress callbacks.
public LoadFilesToSampleBank ( string filePaths, PathRelativeType pathType, GATSampleBank targetBank, GATDataAllocationMode allocationMode, OperationCompletedHandler onOperationCompleted, bool forceMono = false ) : void
filePaths string
pathType PathRelativeType
targetBank GATSampleBank
allocationMode GATDataAllocationMode
onOperationCompleted OperationCompletedHandler
forceMono bool
return void

LoadFolderToSampleBank() public method

Convenience method for loading files asynchronously to a sample bank. All wav and ogg files of the specified folder will be loaded. This method instantiates, configures and enqueues a AGATLoadingOperation. Use the NewOperation method if you need more control over progress callbacks.
public LoadFolderToSampleBank ( string folderPath, PathRelativeType pathType, GATSampleBank targetBank, GATDataAllocationMode allocationMode, OperationCompletedHandler onOperationCompleted, bool forceMono = false ) : void
folderPath string
pathType PathRelativeType
targetBank GATSampleBank
allocationMode GATDataAllocationMode
onOperationCompleted OperationCompletedHandler
forceMono bool
return void

LoadSync() public method

Blocking load of wav and ogg files.
public LoadSync ( AGATAudioFile file, GATDataAllocationMode allocationMode ) : GAudio.GATData[]
file AGATAudioFile
allocationMode GATDataAllocationMode
return GAudio.GATData[]

NewOperation() public method

Gets a LoadingOperation object to which you may add files and callbacks. To start the operation, call EnqueueOperation.
public NewOperation ( int numFilesToLoad, GATDataAllocationMode allocationMode, FileLoadedHandler onFileWasLoaded, bool forceMono = false ) : AGATLoadingOperation
numFilesToLoad int
allocationMode GATDataAllocationMode
onFileWasLoaded FileLoadedHandler
forceMono bool
return AGATLoadingOperation