Descent3/dd_lnxsound/ddlnxsound.h

55 lines
1.2 KiB
C
Raw Normal View History

2024-04-16 03:43:29 +00:00
#ifndef __LNX__DD_SOUND_H_
#define __LNX__DD_SOUND_H_
2024-04-16 20:59:11 +00:00
// #include <pthread.h>
2024-04-16 03:43:29 +00:00
#include "SDL_thread.h"
// Sound Library Internal Error Codes
2024-04-16 18:56:40 +00:00
#define SSL_OK 0
#define SSL_ERROR_GENERIC -1
#define SSL_ERROR_SAMPLE_NODATA -2
#define SSL_ERROR_STREAMMIXER -3
2024-04-16 03:43:29 +00:00
// Sound Status
2024-04-16 18:56:40 +00:00
#define SSF_UNUSED 0
#define SSF_PLAY_NORMAL 1
#define SSF_PLAY_LOOPING 2
#define SSF_PAUSED 4
2024-04-16 03:43:29 +00:00
#define SSF_PLAY_STREAMING 8
2024-04-16 18:56:40 +00:00
#define SSF_BUFFERED_LOOP 64
#define SSF_BUFFERED_STRM 128
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
#define SBT_PRIMARY 0
#define SBT_2D 1
#define SBT_3D 2
2024-04-16 03:43:29 +00:00
// looping methods
2024-04-16 18:56:40 +00:00
#define DSLOOP_SMART_METHOD 0
#define DSLOOP_BUFFER_METHOD 1
#define DSLOOP_STREAM_METHOD 2
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
#define DSBUFLOOP_INIT_STEP -1
#define DSBUFLOOP_LOOP_STEP 0
#define DSBUFLOOP_FINISH_STEP 1
2024-04-16 03:43:29 +00:00
// used to time threads.
2024-04-16 18:56:40 +00:00
#define DSPB_TICK_INTERVAL .01 // Primary buffer update rate (in seconds)
#define DSPB_TICK_MILLISECONDS (DSPB_TICK_INTERVAL * 1000)
typedef struct LNXSTREAMTAG {
// pthread_t thread_id;
SDL_Thread *thread_id;
unsigned long thread_handle;
volatile bool thread_request_kill;
volatile bool thread_alive;
volatile bool thread_waiting_for_death;
int *sound_device;
void (*fp_SetError)(int code);
void (*fp_ErrorText)(char *fmt, ...);
int *p_error_code;
2024-04-16 03:43:29 +00:00
} LNXSTREAM;
#endif