-typedef struct sfx_bgload sfx_bgload_t;
-struct sfx_bgload
-{
- char *path;
- u32 channels;
-
- float *buffer;
- u32 samples;
-
- void *user;
-
- void(*OnComplete)(sfx_bgload_t *inf);
-};
-
-// Thread worker for background load job
-void *sfx_vorbis_a_t( void *_inf )
-{
- sfx_bgload_t *info = _inf;
-
- // Load the ogg clip
- info->buffer = sfx_vorbis( info->path, info->channels, &info->samples );
- info->OnComplete( info );
-
- return NULL;
-}
-
-// Asynchronous resource load
-int sfx_vorbis_a( const char *path, int channels, void(*OnComplete)(sfx_bgload_t *inf), void *user )
-{
- vg_info( "background job started for: %s\n", path );
-
- sfx_bgload_t *params = malloc( sizeof( sfx_bgload_t ) );
- params->path = malloc( strlen( path ) + 1 );
- strcpy( params->path, path );
- params->OnComplete = OnComplete;
- params->user = user;
- params->channels = channels;
-
- return vg_thread_run( sfx_vorbis_a_t, params );
-}
-
-// Asynchronous load-to-system callback
-struct sfx_vorbis_a_to_inf
-{
- sfx_system *sys;
- u32 flags;
-};
-
-#define SFX_A_FLAG_AUTOSTART 0x1
-#define SFX_A_FLAG_AUTOFREE 0x2
-
-/*
-static int sfx_save( sfx_system *sys );
-
-// Asynchronous load-to-system callback
-void sfx_vorbis_a_to_c( sfx_bgload_t *loadinf )
-{
- struct sfx_vorbis_a_to_inf *inf = loadinf->user;
-
- // Mark buffer for deallocation if autofree is set
- if( inf->flags & SFX_A_FLAG_AUTOFREE )
- inf->sys->replacement = loadinf->buffer;
- else
- inf->sys->source = loadinf->buffer;
-
- inf->sys->end = loadinf->samples;
-
- if( inf->flags & SFX_A_FLAG_AUTOSTART )
- sfx_save( inf->sys );
-
- free( loadinf->path );
- free( loadinf );
- free( inf );
-}
-
-// Asynchronous vorbis load into audio system
-void sfx_vorbis_a_to( sfx_system *sys, const char *strFileName, int channels, u32 flags )
-{
- struct sfx_vorbis_a_to_inf *inf = malloc( sizeof( struct sfx_vorbis_a_to_inf ) );
- inf->flags = flags;
- inf->sys = sys;
-
- sys->ch = channels;
-
- if( !sfx_vorbis_a( strFileName, channels, sfx_vorbis_a_to_c, inf ) )
- free( inf );
-}*/
-
-// 0
-// ======================================================
-