Subversion Repositories eduke32

Rev

Rev 8741 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1471 terminx 1
/*
2
Copyright (C) 1994-1995 Apogee Software, Ltd.
3
 
4
This program is free software; you can redistribute it and/or
5
modify it under the terms of the GNU General Public License
6
as published by the Free Software Foundation; either version 2
7
of the License, or (at your option) any later version.
8
 
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
 
13
See the GNU General Public License for more details.
14
 
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
4541 hendricks2 17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
1471 terminx 18
 
19
*/
20
/**********************************************************************
21
   file:   MULTIVOC.H
22
 
23
   author: James R. Dose
24
   date:   December 20, 1993
25
 
26
   Public header for MULTIVOC.C
27
 
28
   (c) Copyright 1993 James R. Dose.  All Rights Reserved.
29
**********************************************************************/
30
 
4747 terminx 31
#ifndef MULTIVOC_H_
32
#define MULTIVOC_H_
1471 terminx 33
 
6067 hendricks2 34
#include "compat.h"
35
 
5270 terminx 36
#ifdef __cplusplus
37
extern "C" {
38
#endif
39
 
8783 terminx 40
typedef enum wavefmt_t : char
3338 hendricks2 41
{
5270 terminx 42
    FMT_UNKNOWN,
43
    FMT_RAW,
44
    FMT_VOC,
45
    FMT_WAV,
46
    FMT_VORBIS,
47
    FMT_FLAC,
48
    FMT_XA,
5927 hendricks2 49
    FMT_XMP,
5270 terminx 50
    FMT_MAX
51
} wavefmt_t;
3338 hendricks2 52
 
4747 terminx 53
#define MV_MINVOICEHANDLE 1
1471 terminx 54
 
8216 terminx 55
extern int MV_ErrorCode;
1471 terminx 56
 
57
enum MV_Errors
4747 terminx 58
{
5814 terminx 59
    MV_Error = -1,
4747 terminx 60
    MV_Ok = 0,
61
    MV_NotInstalled,
62
    MV_DriverError,
63
    MV_NoVoices,
64
    MV_NoMem,
65
    MV_VoiceNotFound,
5814 terminx 66
    MV_InvalidFile,
4747 terminx 67
};
1471 terminx 68
 
2652 terminx 69
extern void (*MV_Printf)(const char *fmt, ...);
8213 terminx 70
 
8216 terminx 71
const char *MV_ErrorString(int ErrorNumber);
4928 hendricks2 72
 
8463 hendricks2 73
extern int MV_Locked;
74
static inline void MV_Lock(void)
75
{
76
    extern void SoundDriver_PCM_Lock(void);
77
 
78
    if (!MV_Locked++)
79
        SoundDriver_PCM_Lock();
80
}
81
static inline void MV_Unlock(void)
82
{
83
    extern void SoundDriver_PCM_Unlock(void);
84
 
85
    if (!--MV_Locked)
86
        SoundDriver_PCM_Unlock();
87
    else if (MV_Locked < 0)
88
        MV_Printf("MV_Unlock(): lockdepth < 0!\n");
89
}
90
 
8216 terminx 91
int  MV_VoicePlaying(int handle);
92
int  MV_KillAllVoices(void);
93
int  MV_Kill(int handle);
94
int  MV_VoicesPlaying(void);
95
int  MV_VoiceAvailable(int priority);
96
int  MV_SetPitch(int handle, int pitchoffset);
97
int  MV_SetFrequency(int handle, int frequency);
8449 hendricks2 98
int  MV_GetFrequency(int handle, int *frequency);
8216 terminx 99
int  MV_PauseVoice(int handle, int pause);
100
int  MV_EndLooping(int handle);
101
int  MV_SetPan(int handle, int vol, int left, int right);
102
int  MV_Pan3D(int handle, int angle, int distance);
103
void MV_SetReverb(int reverb);
104
int  MV_GetMaxReverbDelay(void);
105
int  MV_GetReverbDelay(void);
106
void MV_SetReverbDelay(int delay);
107
 
108
int MV_PlayVOC3D(char *ptr, uint32_t length, int loophow, int pitchoffset, int angle, int distance,
8427 hendricks2 109
                 int priority, fix16_t volume, intptr_t callbackval);
8216 terminx 110
int MV_PlayVOC(char *ptr, uint32_t length, int loopstart, int loopend, int pitchoffset, int vol,
8427 hendricks2 111
               int left, int right, int priority, fix16_t volume, intptr_t callbackval);
8216 terminx 112
 
8741 hendricks2 113
int MV_StartDemandFeedPlayback(void (*function)(const char** ptr, uint32_t* length, void* userdata), int bitdepth, int channels, int rate,
114
    int pitchoffset, int vol, int left, int right, int priority, fix16_t volume, intptr_t callbackval, void* userdata);
8451 hendricks2 115
 
8216 terminx 116
decltype(MV_PlayVOC3D) MV_PlayWAV3D;
117
decltype(MV_PlayVOC)   MV_PlayWAV;
118
decltype(MV_PlayVOC3D) MV_PlayVorbis3D;
119
decltype(MV_PlayVOC)   MV_PlayVorbis;
120
decltype(MV_PlayVOC3D) MV_PlayFLAC3D;
121
decltype(MV_PlayVOC)   MV_PlayFLAC;
122
decltype(MV_PlayVOC3D) MV_PlayXA3D;
123
decltype(MV_PlayVOC)   MV_PlayXA;
124
decltype(MV_PlayVOC3D) MV_PlayXMP3D;
125
decltype(MV_PlayVOC)   MV_PlayXMP;
126
 
8450 hendricks2 127
int MV_PlayRAW(char *ptr, uint32_t length, int rate, char *loopstart, char *loopend, int pitchoffset, int vol,
128
               int left, int right, int priority, fix16_t volume, intptr_t callbackval);
129
 
8216 terminx 130
int  MV_IdentifyXMP(char const *ptr, uint32_t length);
131
int  MV_GetPosition(int handle, int *position);
132
int  MV_SetPosition(int handle, int position);
133
void MV_SetVolume(int volume);
134
int  MV_GetVolume(void);
8427 hendricks2 135
void MV_SetCallBack(void (*function)(intptr_t));
8480 hendricks2 136
 
137
#ifdef __MSDOS__
138
#define ASS_REVERSESTEREO
139
void MV_SetReverseStereo(int setting);
140
int  MV_GetReverseStereo(void);
141
#endif
142
 
8216 terminx 143
int  MV_Init(int soundcard, int MixRate, int Voices, int numchannels, void *initdata);
144
int  MV_Shutdown(void);
8218 terminx 145
void MV_HookMusicRoutine(void (*callback)(void));
8216 terminx 146
void MV_UnhookMusicRoutine(void);
8383 terminx 147
void MV_SetXMPInterpolation(void);
8216 terminx 148
 
8266 hendricks2 149
struct MV_MusicRoutineBuffer
150
{
151
    char * buffer;
152
    int32_t size;
153
};
154
struct MV_MusicRoutineBuffer MV_GetMusicRoutineBuffer(void);
155
 
8213 terminx 156
static inline void MV_SetPrintf(void (*function)(const char *, ...)) { if (function) MV_Printf = function; }
1471 terminx 157
 
5270 terminx 158
#ifdef __cplusplus
159
}
1471 terminx 160
#endif
5270 terminx 161
 
162
#endif