Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

xpbeep.h 1.29 KB
Newer Older
1
/* $Id: xpbeep.h,v 1.16 2020/04/15 15:18:00 deuce Exp $ */
rswindell's avatar
rswindell committed
2

3 4 5
#ifndef _XPBEEP_H_
#define _XPBEEP_H_

deuce's avatar
deuce committed
6
#include "gen_defs.h"
deuce's avatar
deuce committed
7
#include "wrapdll.h"
deuce's avatar
deuce committed
8

9
#if defined(_WIN32)
10
	#if 0
deuce's avatar
deuce committed
11
	#define BEEP(freq,dur)	xpbeep((double)(freq),(DWORD)(dur))
deuce's avatar
deuce committed
12 13 14
	#else
	#define BEEP(freq,dur)	Beep((DWORD)(freq),(DWORD)(dur))
	#endif
15 16 17
#elif defined(__OS2__)
	#define BEEP(freq,dur)	DosBeep(freq,dur)
#elif defined(__unix__) || defined(__APPLE__)
deuce's avatar
deuce committed
18
	#define BEEP(freq,dur)	xpbeep((double)(freq),(DWORD)(dur))
19 20 21 22
#else
	#error "Unsupported Target: Need some macros and/or function prototypes here."
#endif

23 24 25 26 27 28 29 30 31 32 33
enum WAVE_SHAPE {
	 WAVE_SHAPE_SINE
	,WAVE_SHAPE_SAWTOOTH
	,WAVE_SHAPE_SQUARE
	,WAVE_SHAPE_SINE_SAW
	,WAVE_SHAPE_SINE_HARM
	,WAVE_SHAPE_SINE_SAW_CHORD
	,WAVE_SHAPE_SINE_SAW_HARM
};


34 35 36
#ifdef __cplusplus
extern "C" {
#endif
37 38 39 40 41 42 43
DLLEXPORT void xptone_makewave(double freq, unsigned char *wave, int samples, enum WAVE_SHAPE shape);
DLLEXPORT BOOL xptone_open(void);
DLLEXPORT BOOL xptone_close(void);
DLLEXPORT void xpbeep(double freq, DWORD duration);
DLLEXPORT BOOL xp_play_sample(const unsigned char *sample, size_t sample_size, BOOL background);
DLLEXPORT void xptone_complete(void);
DLLEXPORT BOOL xptone(double freq, DWORD duration, enum WAVE_SHAPE);
44
#ifdef __unix__
45
DLLEXPORT void unix_beep(int freq, int dur);
46 47 48 49 50 51
#endif
#ifdef __cplusplus
}
#endif

#endif