| 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 |
#ifndef ___BLADEDLL_H_INCLUDED___ |
| 26 |
#define ___BLADEDLL_H_INCLUDED___ |
| 27 |
|
| 28 |
#ifdef __GNUC__ |
| 29 |
|
| 30 |
#define ATTRIBUTE_PACKED |
| 31 |
#else |
| 32 |
#define ATTRIBUTE_PACKED |
| 33 |
#pragma pack(push) |
| 34 |
#pragma pack(1) |
| 35 |
#endif |
| 36 |
|
| 37 |
#ifdef __cplusplus |
| 38 |
extern "C" { |
| 39 |
#endif |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
#define BE_CONFIG_MP3 0 |
| 44 |
#define BE_CONFIG_LAME 256 |
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
typedef unsigned long HBE_STREAM; |
| 49 |
typedef HBE_STREAM *PHBE_STREAM; |
| 50 |
typedef unsigned long BE_ERR; |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
#define BE_ERR_SUCCESSFUL 0x00000000 |
| 55 |
#define BE_ERR_INVALID_FORMAT 0x00000001 |
| 56 |
#define BE_ERR_INVALID_FORMAT_PARAMETERS 0x00000002 |
| 57 |
#define BE_ERR_NO_MORE_HANDLES 0x00000003 |
| 58 |
#define BE_ERR_INVALID_HANDLE 0x00000004 |
| 59 |
#define BE_ERR_BUFFER_TOO_SMALL 0x00000005 |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
#define BE_MAX_HOMEPAGE 128 |
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
#define BE_MP3_MODE_STEREO 0 |
| 68 |
#define BE_MP3_MODE_JSTEREO 1 |
| 69 |
#define BE_MP3_MODE_DUALCHANNEL 2 |
| 70 |
#define BE_MP3_MODE_MONO 3 |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
#define MPEG1 1 |
| 75 |
#define MPEG2 0 |
| 76 |
|
| 77 |
#ifdef _BLADEDLL |
| 78 |
#undef FLOAT |
| 79 |
#include <Windows.h> |
| 80 |
#endif |
| 81 |
|
| 82 |
#define CURRENT_STRUCT_VERSION 1 |
| 83 |
#define CURRENT_STRUCT_SIZE sizeof(BE_CONFIG) // is currently 331 bytes |
| 84 |
|
| 85 |
|
| 86 |
typedef enum |
| 87 |
{ |
| 88 |
VBR_METHOD_NONE = -1, |
| 89 |
VBR_METHOD_DEFAULT = 0, |
| 90 |
VBR_METHOD_OLD = 1, |
| 91 |
VBR_METHOD_NEW = 2, |
| 92 |
VBR_METHOD_MTRH = 3, |
| 93 |
VBR_METHOD_ABR = 4 |
| 94 |
} VBRMETHOD; |
| 95 |
|
| 96 |
typedef enum |
| 97 |
{ |
| 98 |
LQP_NOPRESET =-1, |
| 99 |
|
| 100 |
|
| 101 |
LQP_NORMAL_QUALITY = 0, |
| 102 |
LQP_LOW_QUALITY = 1, |
| 103 |
LQP_HIGH_QUALITY = 2, |
| 104 |
LQP_VOICE_QUALITY = 3, |
| 105 |
LQP_R3MIX = 4, |
| 106 |
LQP_VERYHIGH_QUALITY = 5, |
| 107 |
LQP_STANDARD = 6, |
| 108 |
LQP_FAST_STANDARD = 7, |
| 109 |
LQP_EXTREME = 8, |
| 110 |
LQP_FAST_EXTREME = 9, |
| 111 |
LQP_INSANE = 10, |
| 112 |
LQP_ABR = 11, |
| 113 |
LQP_CBR = 12, |
| 114 |
LQP_MEDIUM = 13, |
| 115 |
LQP_FAST_MEDIUM = 14, |
| 116 |
|
| 117 |
|
| 118 |
LQP_PHONE =1000, |
| 119 |
LQP_SW =2000, |
| 120 |
LQP_AM =3000, |
| 121 |
LQP_FM =4000, |
| 122 |
LQP_VOICE =5000, |
| 123 |
LQP_RADIO =6000, |
| 124 |
LQP_TAPE =7000, |
| 125 |
LQP_HIFI =8000, |
| 126 |
LQP_CD =9000, |
| 127 |
LQP_STUDIO =10000 |
| 128 |
|
| 129 |
} LAME_QUALITY_PRESET; |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
typedef struct { |
| 134 |
unsigned long dwConfig; |
| 135 |
|
| 136 |
union { |
| 137 |
|
| 138 |
struct { |
| 139 |
|
| 140 |
unsigned long dwSampleRate; |
| 141 |
unsigned char byMode; |
| 142 |
unsigned short wBitrate; |
| 143 |
int bPrivate; |
| 144 |
int bCRC; |
| 145 |
int bCopyright; |
| 146 |
int bOriginal; |
| 147 |
|
| 148 |
} mp3; |
| 149 |
|
| 150 |
struct |
| 151 |
{ |
| 152 |
|
| 153 |
unsigned long dwStructVersion; |
| 154 |
unsigned long dwStructSize; |
| 155 |
|
| 156 |
|
| 157 |
unsigned long dwSampleRate; |
| 158 |
unsigned long dwReSampleRate; |
| 159 |
long nMode; |
| 160 |
unsigned long dwBitrate; |
| 161 |
unsigned long dwMaxBitrate; |
| 162 |
long nPreset; |
| 163 |
unsigned long dwMpegVersion; |
| 164 |
unsigned long dwPsyModel; |
| 165 |
unsigned long dwEmphasis; |
| 166 |
|
| 167 |
|
| 168 |
int bPrivate; |
| 169 |
int bCRC; |
| 170 |
int bCopyright; |
| 171 |
int bOriginal; |
| 172 |
|
| 173 |
|
| 174 |
int bWriteVBRHeader; |
| 175 |
int bEnableVBR; |
| 176 |
int nVBRQuality; |
| 177 |
unsigned long dwVbrAbr_bps; |
| 178 |
VBRMETHOD nVbrMethod; |
| 179 |
int bNoRes; |
| 180 |
|
| 181 |
|
| 182 |
int bStrictIso; |
| 183 |
unsigned short nQuality; |
| 184 |
|
| 185 |
|
| 186 |
unsigned char btReserved[255-4*sizeof(unsigned long) - sizeof( unsigned short )]; |
| 187 |
|
| 188 |
} LHV1; |
| 189 |
|
| 190 |
struct { |
| 191 |
|
| 192 |
unsigned long dwSampleRate; |
| 193 |
unsigned char byMode; |
| 194 |
unsigned short wBitrate; |
| 195 |
unsigned char byEncodingMethod; |
| 196 |
|
| 197 |
} aac; |
| 198 |
|
| 199 |
} format; |
| 200 |
|
| 201 |
} BE_CONFIG, *PBE_CONFIG ATTRIBUTE_PACKED; |
| 202 |
|
| 203 |
|
| 204 |
typedef struct { |
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
unsigned char byDLLMajorVersion; |
| 209 |
unsigned char byDLLMinorVersion; |
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
unsigned char byMajorVersion; |
| 214 |
unsigned char byMinorVersion; |
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
unsigned char byDay; |
| 219 |
unsigned char byMonth; |
| 220 |
unsigned short wYear; |
| 221 |
|
| 222 |
|
| 223 |
|
| 224 |
char zHomepage[BE_MAX_HOMEPAGE + 1]; |
| 225 |
|
| 226 |
unsigned char byAlphaLevel; |
| 227 |
unsigned char byBetaLevel; |
| 228 |
unsigned char byMMXEnabled; |
| 229 |
|
| 230 |
unsigned char btReserved[125]; |
| 231 |
|
| 232 |
|
| 233 |
} BE_VERSION, *PBE_VERSION ATTRIBUTE_PACKED; |
| 234 |
|
| 235 |
#ifndef _BLADEDLL |
| 236 |
|
| 237 |
typedef unsigned long (*BEINITSTREAM) (PBE_CONFIG, unsigned long *, unsigned long *, PHBE_STREAM); |
| 238 |
typedef unsigned long (*BEENCODECHUNK) (HBE_STREAM, unsigned long, short *, unsigned char *, unsigned long *); |
| 239 |
|
| 240 |
|
| 241 |
typedef unsigned long (*BEENCODECHUNKFLOATS16NI) (HBE_STREAM, unsigned long, float *, float *, unsigned char *, unsigned long *); |
| 242 |
typedef unsigned long (*BEDEINITSTREAM) (HBE_STREAM, unsigned char *, unsigned long *); |
| 243 |
typedef unsigned long (*BECLOSESTREAM) (HBE_STREAM); |
| 244 |
typedef void (*BEVERSION) (PBE_VERSION); |
| 245 |
typedef unsigned long (*BEWRITEVBRHEADER) (const char*); |
| 246 |
typedef unsigned long (*BEWRITEINFOTAG) (HBE_STREAM, const char * ); |
| 247 |
|
| 248 |
#define TEXT_BEINITSTREAM "beInitStream" |
| 249 |
#define TEXT_BEENCODECHUNK "beEncodeChunk" |
| 250 |
#define TEXT_BEENCODECHUNKFLOATS16NI "beEncodeChunkFloatS16NI" |
| 251 |
#define TEXT_BEDEINITSTREAM "beDeinitStream" |
| 252 |
#define TEXT_BECLOSESTREAM "beCloseStream" |
| 253 |
#define TEXT_BEVERSION "beVersion" |
| 254 |
#define TEXT_BEWRITEVBRHEADER "beWriteVBRHeader" |
| 255 |
#define TEXT_BEFLUSHNOGAP "beFlushNoGap" |
| 256 |
#define TEXT_BEWRITEINFOTAG "beWriteInfoTag" |
| 257 |
|
| 258 |
|
| 259 |
#else |
| 260 |
|
| 261 |
__declspec(dllexport) unsigned long beInitStream(PBE_CONFIG pbeConfig, Punsigned long dwSamples, Punsigned long dwBufferSize, PHBE_STREAM phbeStream); |
| 262 |
__declspec(dllexport) unsigned long beEncodeChunk(HBE_STREAM hbeStream, unsigned long nSamples, PSHORT pSamples, Punsigned char pOutput, Punsigned long pdwOutput); |
| 263 |
|
| 264 |
|
| 265 |
__declspec(dllexport) unsigned long beEncodeChunkFloatS16NI(HBE_STREAM hbeStream, unsigned long nSamples, PFLOAT buffer_l, PFLOAT buffer_r, Punsigned char pOutput, Punsigned long pdwOutput); |
| 266 |
__declspec(dllexport) unsigned long beDeinitStream(HBE_STREAM hbeStream, Punsigned char pOutput, Punsigned long pdwOutput); |
| 267 |
__declspec(dllexport) unsigned long beCloseStream(HBE_STREAM hbeStream); |
| 268 |
__declspec(dllexport) VOID beVersion(PBE_VERSION pbeVersion); |
| 269 |
__declspec(dllexport) unsigned long beWriteVBRHeader(LPCSTR lpszFileName); |
| 270 |
__declspec(dllexport) unsigned long beFlushNoGap(HBE_STREAM hbeStream, Punsigned char pOutput, Punsigned long pdwOutput); |
| 271 |
__declspec(dllexport) unsigned long beWriteInfoTag( HBE_STREAM hbeStream, LPCSTR lpszFileName ); |
| 272 |
|
| 273 |
#endif |
| 274 |
|
| 275 |
#ifndef __GNUC__ |
| 276 |
#pragma pack(pop) |
| 277 |
#endif |
| 278 |
|
| 279 |
#ifdef __cplusplus |
| 280 |
} |
| 281 |
#endif |
| 282 |
|
| 283 |
#endif |