sound: move related function declarations to platform header. Remove unused.

This commit is contained in:
Alibek Omarov 2019-01-07 04:07:01 +03:00
parent 908082097f
commit 80fc7209ed
6 changed files with 22 additions and 31 deletions

View File

@ -19,6 +19,7 @@ GNU General Public License for more details.
#include "con_nprint.h"
#include "gl_local.h"
#include "pm_local.h"
#include "platform/platform.h"
#define SND_CLIP_DISTANCE 1000.0f

View File

@ -237,22 +237,6 @@ typedef struct
int source; // may be game, menu, etc
} bg_track_t;
/*
====================================================================
SYSTEM SPECIFIC FUNCTIONS
====================================================================
*/
// initializes cycling through a DMA buffer and returns information on it
qboolean SNDDMA_Init( void *hInst );
int SNDDMA_GetSoundtime( void );
void SNDDMA_Shutdown( void );
void SNDDMA_BeginPainting( void );
void SNDDMA_Submit( void );
void SNDDMA_LockSound( void );
void SNDDMA_UnlockSound( void );
//====================================================================
#define MAX_DYNAMIC_CHANNELS (60 + NUM_AMBIENTS)

View File

@ -1080,7 +1080,6 @@ void Cmd_Null_f( void );
// soundlib shared exports
qboolean S_Init( void );
void S_Shutdown( void );
void S_Activate( qboolean active );
void S_StopSound( int entnum, int channel, const char *soundname );
int S_GetCurrentStaticSounds( soundlist_t *pout, int size );
void S_StopBackgroundTrack( void );

View File

@ -90,6 +90,22 @@ int R_MaxVideoModes();
vidmode_t*R_GetVideoMode( int num );
void* GL_GetProcAddress( const char *name ); // RenderAPI requirement
/*
==============================================================================
AUDIO INPUT/OUTPUT
==============================================================================
*/
// initializes cycling through a DMA buffer and returns information on it
qboolean SNDDMA_Init( void *hInst );
int SNDDMA_GetSoundtime( void );
void SNDDMA_Shutdown( void );
void SNDDMA_BeginPainting( void );
void SNDDMA_Submit( void );
void SNDDMA_Activate( qboolean active ); // pause audio
// void SNDDMA_PrintDeviceName( void ); // unused
// void SNDDMA_LockSound( void ); // unused
// void SNDDMA_UnlockSound( void ); // unused
#endif // PLATFORM_H

View File

@ -408,7 +408,7 @@ static void SDLash_EventFilter( SDL_Event *event )
IN_ActivateMouse(true);
if( snd_mute_losefocus->value )
{
S_Activate( true );
SNDDMA_Activate( true );
}
host.force_draw_version = true;
host.force_draw_version_time = host.realtime + FORCE_DRAW_VERSION_TIME;
@ -427,7 +427,7 @@ static void SDLash_EventFilter( SDL_Event *event )
IN_DeactivateMouse();
if( snd_mute_losefocus->value )
{
S_Activate( false );
SNDDMA_Activate( false );
}
host.force_draw_version = true;
host.force_draw_version_time = host.realtime + 2;

View File

@ -14,6 +14,7 @@ GNU General Public License for more details.
*/
#include "common.h"
#include "platform/platform.h"
#if XASH_SOUND == SOUND_SDL
#include "sound.h"
@ -238,23 +239,13 @@ void SNDDMA_Shutdown( void )
/*
===========
S_PrintDeviceName
===========
*/
void S_PrintDeviceName( void )
{
Msg( "Audio: SDL (driver: %s)\n", SDL_GetCurrentAudioDriver( ) );
}
/*
===========
S_Activate
SNDDMA_Activate
Called when the main window gains or loses focus.
The window have been destroyed and recreated
between a deactivate and an activate.
===========
*/
void S_Activate( qboolean active )
void SNDDMA_Activate( qboolean active )
{
SDL_PauseAudioDevice( sdl_dev, !active );
}