mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-14 18:15:28 -04:00
Avoid including windows headers for WinMM backend
This commit is contained in:
parent
16ce6c7506
commit
04f9fd932a
59
src/Audio.c
59
src/Audio.c
@ -281,17 +281,56 @@ cc_result Audio_IsFinished(struct AudioContext* ctx, cc_bool* finished) {
|
|||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
*------------------------------------------------------WinMM backend------------------------------------------------------*
|
*------------------------------------------------------WinMM backend------------------------------------------------------*
|
||||||
*#########################################################################################################################*/
|
*#########################################################################################################################*/
|
||||||
#define WIN32_LEAN_AND_MEAN
|
/* == BEGIN WINDOWS TYPEDEFS == */
|
||||||
#define NOSERVICE
|
typedef unsigned long DWORD;
|
||||||
#define NOMCX
|
typedef unsigned short WORD;
|
||||||
#define NOIME
|
typedef unsigned int UINT;
|
||||||
#ifndef UNICODE
|
typedef char CHAR;
|
||||||
#define UNICODE
|
typedef cc_uintptr DWORD_PTR;
|
||||||
#define _UNICODE
|
typedef char* LPSTR;
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <windows.h>
|
#define WINAPI __stdcall
|
||||||
#include <mmsystem.h>
|
#define DECLSPEC_IMPORT __declspec(dllimport)
|
||||||
|
/* == BEGIN mmsyscom.h == */
|
||||||
|
#define CALLBACK_NULL 0x00000000l
|
||||||
|
typedef UINT MMRESULT;
|
||||||
|
#define WINMMAPI DECLSPEC_IMPORT
|
||||||
|
|
||||||
|
/* == BEGIN mmeapi.h == */
|
||||||
|
typedef struct WAVEHDR_ {
|
||||||
|
LPSTR lpData;
|
||||||
|
DWORD dwBufferLength;
|
||||||
|
DWORD dwBytesRecorded;
|
||||||
|
DWORD_PTR dwUser;
|
||||||
|
DWORD dwFlags;
|
||||||
|
DWORD dwLoops;
|
||||||
|
struct WAVEHDR_* lpNext;
|
||||||
|
DWORD_PTR reserved;
|
||||||
|
} WAVEHDR;
|
||||||
|
|
||||||
|
typedef struct WAVEFORMATEX_ {
|
||||||
|
WORD wFormatTag;
|
||||||
|
WORD nChannels;
|
||||||
|
DWORD nSamplesPerSec;
|
||||||
|
DWORD nAvgBytesPerSec;
|
||||||
|
WORD nBlockAlign;
|
||||||
|
WORD wBitsPerSample;
|
||||||
|
WORD cbSize;
|
||||||
|
} WAVEFORMATEX;
|
||||||
|
typedef void* HWAVEOUT;
|
||||||
|
|
||||||
|
#define WAVE_MAPPER ((UINT)-1)
|
||||||
|
#define WAVE_FORMAT_PCM 1
|
||||||
|
#define WHDR_DONE 0x00000001
|
||||||
|
#define WHDR_PREPARED 0x00000002
|
||||||
|
|
||||||
|
WINMMAPI MMRESULT WINAPI waveOutOpen(HWAVEOUT* phwo, UINT uDeviceID, const WAVEFORMATEX* pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen);
|
||||||
|
WINMMAPI MMRESULT WINAPI waveOutClose(HWAVEOUT hwo);
|
||||||
|
WINMMAPI MMRESULT WINAPI waveOutPrepareHeader(HWAVEOUT hwo, WAVEHDR* pwh, UINT cbwh);
|
||||||
|
WINMMAPI MMRESULT WINAPI waveOutUnprepareHeader(HWAVEOUT hwo, WAVEHDR* pwh, UINT cbwh);
|
||||||
|
WINMMAPI MMRESULT WINAPI waveOutWrite(HWAVEOUT hwo, WAVEHDR* pwh, UINT cbwh);
|
||||||
|
WINMMAPI MMRESULT WINAPI waveOutReset(HWAVEOUT hwo);
|
||||||
|
/* == END WINDOWS HEADERS == */
|
||||||
|
|
||||||
struct AudioContext {
|
struct AudioContext {
|
||||||
HWAVEOUT handle;
|
HWAVEOUT handle;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user