-/* Play a clip using player. If its already playing something, it will
- * fadeout quickly and start the next sound */
-VG_STATIC void audio_player_playclip( audio_player *player, audio_clip *clip )
-{
- audio_require_lock();
- audio_require_init( player );
- audio_require_clip_loaded( clip );
-
- if( player->info.flags & AUDIO_FLAG_KILL )
- {
- vg_error( "Can't start audio clip on player that is/has disconnected" );
- return;
- }
-
- if( player->enqued )
- {
- vg_warn( "[1] Audio commit spamming; already enqued (%s)\n",
- player->name );
- return;
- }
-
- player->info.source = clip;
- audio_player_commit( player );
-}
-
-VG_STATIC void audio_play_oneshot( audio_clip *clip, float volume )
-{
- audio_require_lock();
- audio_require_clip_loaded( clip );
-
- if( vg_audio.queue_len >= vg_list_size( vg_audio.entity_queue ) )
- {
- vg_warn( "Audio commit queue full\n" );
- return;
- }
-
- audio_entity *ent = &vg_audio.entity_queue[ vg_audio.queue_len ++ ];
-
- ent->info.flags = AUDIO_FLAG_ONESHOT;
- ent->info.pan = 0.0f;
- ent->info.source = clip;
- ent->info.vol = volume;
- ent->player = NULL;
-}
-
-VG_STATIC void audio_player_init( audio_player *player )
-{
- player->active_entity = AATREE_PTR_NIL;
- player->init = 1;
-}
-
-/*
- * Effects
- */
-
-/*
- * Safety enforced Get/set attributes
- */
-
-VG_STATIC int audio_player_is_playing( audio_player *sys )
-{
- audio_require_lock();
-
- if( sys->active_entity != AATREE_PTR_NIL )
- return 1;
- else
- return 0;
-}
-
-VG_STATIC void audio_player_set_position( audio_player *sys, v3f pos )
-{
- audio_require_lock();
- v3_copy( pos, sys->info.world_position );
-}
-
-VG_STATIC void audio_player_set_vol( audio_player *sys, float vol )
-{
- audio_require_lock();
- sys->info.vol = vol;
-}
-
-VG_STATIC float audio_player_get_vol( audio_player *sys )
-{
- audio_require_lock();
- return sys->info.vol;
-}
-
-VG_STATIC void audio_player_set_pan( audio_player *sys, float pan )
-{
- audio_require_lock();
- sys->info.pan = pan;
-}
-
-VG_STATIC float audio_player_get_pan( audio_player *sys )
-{
- audio_require_lock();
- return sys->info.pan;
-}
-
-VG_STATIC void audio_player_set_flags( audio_player *sys, u32 flags )
-{
- audio_require_lock();
- sys->info.flags = flags;
-}
-
-VG_STATIC u32 audio_player_get_flags( audio_player *sys )
-{
- audio_require_lock();
- return sys->info.flags;
-}
-
-