| 1 |
/* Copyright (c) 2002, John Edwards |
| 2 |
|
| 3 |
Redistribution and use in source and binary forms, with or without |
| 4 |
modification, are permitted provided that the following conditions |
| 5 |
are met: |
| 6 |
|
| 7 |
- Redistributions of source code must retain the above copyright |
| 8 |
notice, this list of conditions and the following disclaimer. |
| 9 |
|
| 10 |
- Redistributions in binary form must reproduce the above copyright |
| 11 |
notice, this list of conditions and the following disclaimer in the |
| 12 |
documentation and/or other materials provided with the distribution. |
| 13 |
|
| 14 |
- Neither the name of the Xiph.org Foundation nor the names of its |
| 15 |
contributors may be used to endorse or promote products derived from |
| 16 |
this software without specific prior written permission. |
| 17 |
|
| 18 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 19 |
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 20 |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 21 |
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR |
| 22 |
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 23 |
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 24 |
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 25 |
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 26 |
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 27 |
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 28 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 |
*/ |
| 30 |
|
| 31 |
// WAVE_OUT.H - Necessary stuff for WIN_AUDIO |
| 32 |
|
| 33 |
#ifndef WAVE_OUT_H |
| 34 |
#define WAVE_OUT_H |
| 35 |
|
| 36 |
#include <stdio.h> |
| 37 |
#include <windows.h> |
| 38 |
#ifdef __MINGW32__ |
| 39 |
#include <mmsystem.h> |
| 40 |
#endif |
| 41 |
|
| 42 |
#define VERSION_STRING "\n 0.7.0\n" |
| 43 |
|
| 44 |
#define Cdecl __cdecl |
| 45 |
#define __attribute__(x) |
| 46 |
#define sleep(__sec) Sleep ((__sec) * 1000) |
| 47 |
#define inline __inline |
| 48 |
#define restrict |
| 49 |
|
| 50 |
//// constants ///////////////////////////////////////////////////// |
| 51 |
|
| 52 |
#define CD_SAMPLE_FREQ 44.1e3 |
| 53 |
#define SAMPLE_SIZE 16 |
| 54 |
#define SAMPLE_SIZE_STRING "" |
| 55 |
#define WINAUDIO_FD ((FILE_T)-128) |
| 56 |
#define FILE_T FILE* |
| 57 |
#define INVALID_FILEDESC NULL |
| 58 |
|
| 59 |
//// Simple types ////////////////////////////////////////////////// |
| 60 |
|
| 61 |
typedef signed int Int; // at least -32767...+32767, fast type |
| 62 |
typedef unsigned int Uint; // at least 0...65535, fast type |
| 63 |
typedef long double Ldouble; // most exact floating point format |
| 64 |
|
| 65 |
//// procedures/functions ////////////////////////////////////////// |
| 66 |
// wave_out.c |
| 67 |
Int Set_WIN_Params ( FILE_T dummyFile , Ldouble SampleFreq, Uint BitsPerSample, Uint Channels); |
| 68 |
int WIN_Play_Samples ( const void* buff, size_t len ); |
| 69 |
int WIN_Audio_close ( void ); |
| 70 |
|
| 71 |
#endif /* WAVE_OUT_H */ |