| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
#ifndef __PVFILEIO_H_INCLUDED |
| 28 |
#define __PVFILEIO_H_INCLUDED |
| 29 |
|
| 30 |
#include "sysdep.h" |
| 31 |
|
| 32 |
#if defined(WIN32) || defined(_WIN32) || defined(_MSC_VER) |
| 33 |
|
| 34 |
#include <windows.h> |
| 35 |
|
| 36 |
#else |
| 37 |
|
| 38 |
typedef struct |
| 39 |
{ |
| 40 |
uint32_t Data1; |
| 41 |
uint16_t Data2; |
| 42 |
uint16_t Data3; |
| 43 |
unsigned char Data4[8]; |
| 44 |
} GUID; |
| 45 |
|
| 46 |
typedef struct { |
| 47 |
uint16_t wFormatTag; |
| 48 |
uint16_t nChannels; |
| 49 |
uint32_t nSamplesPerSec; |
| 50 |
uint32_t nAvgBytesPerSec; |
| 51 |
uint16_t nBlockAlign; |
| 52 |
uint16_t wBitsPerSample; |
| 53 |
uint16_t cbSize; |
| 54 |
} WAVEFORMATEX; |
| 55 |
|
| 56 |
#endif |
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
typedef enum pvoc_wordformat { |
| 61 |
PVOC_IEEE_FLOAT, |
| 62 |
PVOC_IEEE_DOUBLE |
| 63 |
} pvoc_wordformat; |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
typedef enum pvoc_frametype { |
| 68 |
PVOC_AMP_FREQ = 0, |
| 69 |
PVOC_AMP_PHASE, |
| 70 |
PVOC_COMPLEX |
| 71 |
} pvoc_frametype; |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
typedef enum pvoc_windowtype { |
| 76 |
PVOC_DEFAULT = 0, |
| 77 |
PVOC_HAMMING = 0, |
| 78 |
PVOC_HANN, |
| 79 |
PVOC_KAISER, |
| 80 |
PVOC_RECT, |
| 81 |
PVOC_CUSTOM |
| 82 |
} pv_wtype; |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
typedef enum pvoc_sampletype { |
| 87 |
STYPE_16, |
| 88 |
STYPE_24, |
| 89 |
STYPE_32, |
| 90 |
STYPE_IEEE_FLOAT |
| 91 |
} pv_stype; |
| 92 |
|
| 93 |
typedef struct pvoc_data { |
| 94 |
uint16_t wWordFormat; |
| 95 |
uint16_t wAnalFormat; |
| 96 |
uint16_t wSourceFormat; |
| 97 |
uint16_t wWindowType; |
| 98 |
uint32_t nAnalysisBins; |
| 99 |
uint32_t dwWinlen; |
| 100 |
|
| 101 |
uint32_t dwOverlap; |
| 102 |
uint32_t dwFrameAlign; |
| 103 |
float fAnalysisRate; |
| 104 |
float fWindowParam; |
| 105 |
} PVOCDATA; |
| 106 |
|
| 107 |
typedef struct { |
| 108 |
WAVEFORMATEX Format; |
| 109 |
|
| 110 |
union { |
| 111 |
uint16_t wValidBitsPerSample; |
| 112 |
|
| 113 |
uint16_t wSamplesPerBlock; |
| 114 |
uint16_t wReserved; |
| 115 |
} Samples; |
| 116 |
uint32_t dwChannelMask; |
| 117 |
|
| 118 |
GUID SubFormat; |
| 119 |
} WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE; |
| 120 |
|
| 121 |
typedef struct { |
| 122 |
WAVEFORMATEXTENSIBLE wxFormat; |
| 123 |
uint32_t dwVersion; |
| 124 |
uint32_t dwDataSize; |
| 125 |
PVOCDATA data; |
| 126 |
} WAVEFORMATPVOCEX; |
| 127 |
|
| 128 |
|
| 129 |
|
| 130 |
#define SIZEOF_FMTPVOCEX (80) |
| 131 |
|
| 132 |
#define SIZEOF_WFMTEX (18) |
| 133 |
#define PVX_VERSION (1) |
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
#ifndef CSOUND_CSDL_H |
| 142 |
|
| 143 |
extern const GUID KSDATAFORMAT_SUBTYPE_PVOC; |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
const char *pvoc_errorstr(CSOUND *); |
| 148 |
int init_pvsys(CSOUND *); |
| 149 |
int pvoc_createfile(CSOUND *, const char *, |
| 150 |
uint32, uint32, uint32, |
| 151 |
uint32, int32, int, int, |
| 152 |
float, float *, uint32); |
| 153 |
int pvoc_openfile(CSOUND *, |
| 154 |
const char *filename, void *data_, void *fmt_); |
| 155 |
int pvoc_closefile(CSOUND *, int); |
| 156 |
int pvoc_putframes(CSOUND *, |
| 157 |
int ofd, const float *frame, int32 numframes); |
| 158 |
int pvoc_getframes(CSOUND *, |
| 159 |
int ifd, float *frames, uint32 nframes); |
| 160 |
int pvoc_framecount(CSOUND *, int ifd); |
| 161 |
int pvoc_fseek(CSOUND *, int ifd, int offset); |
| 162 |
int pvsys_release(CSOUND *); |
| 163 |
|
| 164 |
#endif |
| 165 |
|
| 166 |
#endif |
| 167 |
|