Main Page   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

BladeMP3EncDLL.h

00001 /*
00002  * Blade DLL Interface for LAME.
00003  *
00004  * Copyright (c) 1999 A.L. Faber
00005  * Based on bladedll.h version 1.0 written by Jukka Poikolainen
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  * 
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the
00019  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00020  * Boston, MA  02111-1307, USA.
00021  */
00022 
00023 #ifndef ___BLADEDLL_H_INCLUDED___
00024 #define ___BLADEDLL_H_INCLUDED___
00025 
00026 #pragma pack(push)
00027 #pragma pack(1)
00028 
00029 #ifdef  __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 /* encoding formats */
00034 
00035 #define   BE_CONFIG_MP3     0                   
00036 #define   BE_CONFIG_LAME      256   
00037 
00038 /* type definitions */
00039 
00040 typedef   unsigned long     HBE_STREAM;
00041 typedef   HBE_STREAM        *PHBE_STREAM;
00042 typedef   unsigned long     BE_ERR;
00043 
00044 /* error codes */
00045 
00046 #define   BE_ERR_SUCCESSFUL         0x00000000
00047 #define   BE_ERR_INVALID_FORMAT       0x00000001
00048 #define   BE_ERR_INVALID_FORMAT_PARAMETERS  0x00000002
00049 #define   BE_ERR_NO_MORE_HANDLES        0x00000003
00050 #define   BE_ERR_INVALID_HANDLE       0x00000004
00051 #define   BE_ERR_BUFFER_TOO_SMALL       0x00000005
00052 
00053 /* other constants */
00054 
00055 #define   BE_MAX_HOMEPAGE     128
00056 
00057 /* format specific variables */
00058 
00059 #define   BE_MP3_MODE_STEREO    0
00060 #define   BE_MP3_MODE_JSTEREO   1
00061 #define   BE_MP3_MODE_DUALCHANNEL 2
00062 #define   BE_MP3_MODE_MONO    3
00063 
00064 
00065 
00066 #define   MPEG1 1
00067 #define   MPEG2 0
00068 
00069 #ifdef _BLADEDLL
00070 #undef FLOAT
00071   #include <Windows.h>
00072 #endif
00073 
00074 #define CURRENT_STRUCT_VERSION 1
00075 #define CURRENT_STRUCT_SIZE sizeof(BE_CONFIG) // is currently 331 bytes
00076 
00077 /* OBSOLETE, VALUES STILL WORK
00078 typedef enum 
00079 {
00080   NORMAL_QUALITY=0,
00081   LOW_QUALITY,
00082   HIGH_QUALITY,
00083   VOICE_QUALITY
00084 } LAME_QUALTIY_PRESET;
00085 
00086 */
00087 
00088 
00089 typedef enum
00090 {
00091   VBR_METHOD_NONE =0,
00092   VBR_METHOD_OLD,
00093   VBR_METHOD_NEW,
00094   VBR_METHOD_MTRH,
00095   VBR_METHOD_ABR,
00096   VBR_METHOD_R3MIX,
00097 } VBRMETHOD;
00098 
00099 typedef enum 
00100 {
00101   LQP_NOPRESET=-1,
00102 
00103   // STANDARD QUALITY PRESETS
00104   LQP_NORMAL_QUALITY=0,
00105   LQP_LOW_QUALITY,
00106   LQP_HIGH_QUALITY,
00107   LQP_VOICE_QUALITY,
00108 
00109   // NEW PRESET VALUES
00110   LQP_PHONE =1000,
00111   LQP_SW    =2000,
00112   LQP_AM    =3000,
00113   LQP_FM    =4000,
00114   LQP_VOICE =5000,
00115   LQP_RADIO =6000,
00116   LQP_TAPE  =7000,
00117   LQP_HIFI  =8000,
00118   LQP_CD    =9000,
00119   LQP_STUDIO  =10000
00120 
00121 } LAME_QUALTIY_PRESET;
00122 
00123 
00124 
00125 typedef struct  {
00126   DWORD dwConfig;     // BE_CONFIG_XXXXX
00127                 // Currently only BE_CONFIG_MP3 is supported
00128   union {
00129 
00130     struct  {
00131 
00132       DWORD dwSampleRate; // 48000, 44100 and 32000 allowed
00133       BYTE  byMode;     // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
00134       WORD  wBitrate;   // 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 allowed
00135       BOOL  bPrivate;   
00136       BOOL  bCRC;
00137       BOOL  bCopyright;
00138       BOOL  bOriginal;
00139 
00140       } mp3;          // BE_CONFIG_MP3
00141 
00142       struct
00143       {
00144       // STRUCTURE INFORMATION
00145       DWORD     dwStructVersion;  
00146       DWORD     dwStructSize;
00147 
00148       // BASIC ENCODER SETTINGS
00149       DWORD     dwSampleRate; // SAMPLERATE OF INPUT FILE
00150       DWORD     dwReSampleRate; // DOWNSAMPLERATE, 0=ENCODER DECIDES  
00151       LONG      nMode;      // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
00152       DWORD     dwBitrate;    // CBR bitrate, VBR min bitrate
00153       DWORD     dwMaxBitrate; // CBR ignored, VBR Max bitrate
00154       LONG      nPreset;    // Quality preset, use one of the settings of the LAME_QUALITY_PRESET enum
00155       DWORD     dwMpegVersion;  // FUTURE USE, MPEG-1 OR MPEG-2
00156       DWORD     dwPsyModel;   // FUTURE USE, SET TO 0
00157       DWORD     dwEmphasis;   // FUTURE USE, SET TO 0
00158 
00159       // BIT STREAM SETTINGS
00160       BOOL      bPrivate;   // Set Private Bit (TRUE/FALSE)
00161       BOOL      bCRC;     // Insert CRC (TRUE/FALSE)
00162       BOOL      bCopyright;   // Set Copyright Bit (TRUE/FALSE)
00163       BOOL      bOriginal;    // Set Original Bit (TRUE/FALSE)
00164       
00165       // VBR STUFF
00166       BOOL      bWriteVBRHeader;  // WRITE XING VBR HEADER (TRUE/FALSE)
00167       BOOL      bEnableVBR;     // USE VBR ENCODING (TRUE/FALSE)
00168       INT       nVBRQuality;    // VBR QUALITY 0..9
00169       DWORD     dwVbrAbr_bps;   // Use ABR in stead of nVBRQuality
00170       VBRMETHOD   nVbrMethod;
00171       BOOL      bNoRes;       // Disable Bit resorvoir
00172 
00173       BYTE      btReserved[255-3*sizeof(DWORD)];  // FUTURE USE, SET TO 0
00174 
00175       } LHV1;         // LAME header version 1
00176 
00177     struct  {
00178 
00179       DWORD dwSampleRate;
00180       BYTE  byMode;
00181       WORD  wBitrate;
00182       BYTE  byEncodingMethod;
00183 
00184     } aac;
00185 
00186   } format;
00187     
00188 } BE_CONFIG, *PBE_CONFIG;
00189 
00190 
00191 typedef struct  {
00192 
00193   // BladeEnc DLL Version number
00194 
00195   BYTE  byDLLMajorVersion;
00196   BYTE  byDLLMinorVersion;
00197 
00198   // BladeEnc Engine Version Number
00199 
00200   BYTE  byMajorVersion;
00201   BYTE  byMinorVersion;
00202 
00203   // DLL Release date
00204 
00205   BYTE  byDay;
00206   BYTE  byMonth;
00207   WORD  wYear;
00208 
00209   // BladeEnc Homepage URL
00210 
00211   CHAR  zHomepage[BE_MAX_HOMEPAGE + 1]; 
00212 
00213   BYTE  byAlphaLevel;
00214   BYTE  byBetaLevel;
00215   BYTE  byMMXEnabled;
00216 
00217   BYTE  btReserved[125];
00218 
00219 
00220 } BE_VERSION, *PBE_VERSION;     
00221 
00222 #ifndef _BLADEDLL
00223 
00224 typedef BE_ERR  (*BEINITSTREAM)     (PBE_CONFIG, PDWORD, PDWORD, PHBE_STREAM);
00225 typedef BE_ERR  (*BEENCODECHUNK)    (HBE_STREAM, DWORD, PSHORT, PBYTE, PDWORD);
00226 typedef BE_ERR  (*BEDEINITSTREAM)   (HBE_STREAM, PBYTE, PDWORD);
00227 typedef BE_ERR  (*BECLOSESTREAM)    (HBE_STREAM);
00228 typedef VOID  (*BEVERSION)      (PBE_VERSION);
00229 typedef VOID  (*BEWRITEVBRHEADER)   (LPCSTR);
00230 
00231 #define TEXT_BEINITSTREAM   "beInitStream"
00232 #define TEXT_BEENCODECHUNK    "beEncodeChunk"
00233 #define TEXT_BEDEINITSTREAM   "beDeinitStream"
00234 #define TEXT_BECLOSESTREAM    "beCloseStream"
00235 #define TEXT_BEVERSION      "beVersion"
00236 #define TEXT_BEWRITEVBRHEADER "beWriteVBRHeader"
00237 
00238 #else
00239 
00240 __declspec(dllexport) BE_ERR  beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize, PHBE_STREAM phbeStream);
00241 __declspec(dllexport) BE_ERR  beEncodeChunk(HBE_STREAM hbeStream, DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput);
00242 __declspec(dllexport) BE_ERR  beDeinitStream(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
00243 __declspec(dllexport) BE_ERR  beCloseStream(HBE_STREAM hbeStream);
00244 __declspec(dllexport) VOID    beVersion(PBE_VERSION pbeVersion);
00245 __declspec(dllexport) BE_ERR  beWriteVBRHeader(LPCSTR lpszFileName);
00246 
00247 
00248 #endif
00249 
00250 #pragma pack(pop)
00251 
00252 #ifdef  __cplusplus
00253 }
00254 #endif
00255 
00256 #endif

Generated at Tue Aug 21 21:10:48 2001 for out_lame by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001