home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 13 / AACD13.ISO / AACD / Sound / LAME / src / Dll / BladeMP3EncDLL.h < prev    next >
C/C++ Source or Header  |  2000-05-29  |  5KB  |  195 lines

  1. /*
  2.  * Blade DLL Interface for LAME.
  3.  *
  4.  * Copyright (c) 1999 A.L. Faber
  5.  * Based on bladedll.h version 1.0 written by Jukka Poikolainen
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Lesser General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  * 
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Lesser General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU Lesser General Public
  18.  * License along with this library; if not, write to the
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA  02111-1307, USA.
  21.  */
  22.  
  23. #ifndef ___BLADEDLL_H_INCLUDED___
  24. #define ___BLADEDLL_H_INCLUDED___
  25.  
  26. #pragma pack(push)
  27. #pragma pack(1)
  28.  
  29. /* encoding formats */
  30.  
  31. #define        BE_CONFIG_MP3            0                                        
  32. #define        BE_CONFIG_LAME            256        
  33.  
  34. /* type definitions */
  35.  
  36. typedef        unsigned long            HBE_STREAM;
  37. typedef        HBE_STREAM                *PHBE_STREAM;
  38. typedef        unsigned long            BE_ERR;
  39.  
  40. /* error codes */
  41.  
  42. #define        BE_ERR_SUCCESSFUL                    0x00000000
  43. #define        BE_ERR_INVALID_FORMAT                0x00000001
  44. #define        BE_ERR_INVALID_FORMAT_PARAMETERS    0x00000002
  45. #define        BE_ERR_NO_MORE_HANDLES                0x00000003
  46. #define        BE_ERR_INVALID_HANDLE                0x00000004
  47. #define        BE_ERR_BUFFER_TOO_SMALL                0x00000005
  48.  
  49. /* other constants */
  50.  
  51. #define        BE_MAX_HOMEPAGE            256
  52.  
  53. /* format specific variables */
  54.  
  55. #define        BE_MP3_MODE_STEREO        0
  56. #define        BE_MP3_MODE_JSTEREO        1
  57. #define        BE_MP3_MODE_DUALCHANNEL    2
  58. #define        BE_MP3_MODE_MONO        3
  59.  
  60. #define        MPEG1    1
  61. #define        MPEG2    0
  62.  
  63. #ifdef _BLADEDLL
  64. #undef FLOAT
  65.     #include <Windows.h>
  66. #endif
  67.  
  68.  
  69. typedef enum 
  70. {
  71.     NORMAL_QUALITY=0,
  72.     LOW_QUALITY,
  73.     HIGH_QUALITY,
  74.     VOICE_QUALITY
  75. } MPEG_QUALITY;
  76.  
  77. typedef struct    {
  78.     DWORD    dwConfig;            // BE_CONFIG_XXXXX
  79.                                 // Currently only BE_CONFIG_MP3 is supported
  80.     union    {
  81.  
  82.         struct    {
  83.  
  84.             DWORD    dwSampleRate;    // 48000, 44100 and 32000 allowed
  85.             BYTE    byMode;            // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
  86.             WORD    wBitrate;        // 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 allowed
  87.             BOOL    bPrivate;        
  88.             BOOL    bCRC;
  89.             BOOL    bCopyright;
  90.             BOOL    bOriginal;
  91.  
  92.             } mp3;                    // BE_CONFIG_MP3
  93.  
  94.             struct
  95.             {
  96.             // STRUCTURE INFORMATION
  97.             DWORD            dwStructVersion;    
  98.             DWORD            dwStructSize;
  99.  
  100.             // BASIC ENCODER SETTINGS
  101.             DWORD            dwSampleRate;    // ALLOWED SAMPLERATE VALUES DEPENDS ON dwMPEGVersion 
  102.             DWORD            dwReSampleRate;    // DOWNSAMPLERATE, 0=ENCODER DECIDES  
  103.             INT                nMode;            // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO
  104.             DWORD            dwBitrate;        // CBR bitrate, VBR min bitrate
  105.             DWORD            dwMaxBitrate;    // CBR ignored, VBR Max bitrate
  106.             DWORD            nQuality;        // Quality setting (NORMAL,HIGH,LOW,VOICE)
  107.             DWORD            dwMpegVersion;    // MPEG-1 OR MPEG-2
  108.             DWORD            dwPsyModel;        // FUTURE USE, SET TO 0
  109.             DWORD            dwEmphasis;        // FUTURE USE, SET TO 0
  110.  
  111.             // BIT STREAM SETTINGS
  112.             BOOL            bPrivate;        // Set Private Bit (TRUE/FALSE)
  113.             BOOL            bCRC;            // Insert CRC (TRUE/FALSE)
  114.             BOOL            bCopyright;        // Set Copyright Bit (TRUE/FALSE)
  115.             BOOL            bOriginal;        // Set Original Bit (TRUE/FALSE)
  116.             
  117.             // VBR STUFF
  118.             BOOL            bWriteVBRHeader;    // WRITE XING VBR HEADER (TRUE/FALSE)
  119.             BOOL            bEnableVBR;            // USE VBR ENCODING (TRUE/FALSE)
  120.             INT                nVBRQuality;        // VBR QUALITY 0..9
  121.  
  122.             BYTE            btReserved[255];    // FUTURE USE, SET TO 0
  123.  
  124.             } LHV1;                    // LAME header version 1
  125.  
  126.         struct    {
  127.  
  128.             DWORD    dwSampleRate;
  129.             BYTE    byMode;
  130.             WORD    wBitrate;
  131.             BYTE    byEncodingMethod;
  132.  
  133.         } aac;
  134.  
  135.     } format;
  136.         
  137. } BE_CONFIG, *PBE_CONFIG;
  138.  
  139.  
  140. typedef struct    {
  141.  
  142.     // BladeEnc DLL Version number
  143.  
  144.     BYTE    byDLLMajorVersion;
  145.     BYTE    byDLLMinorVersion;
  146.  
  147.     // BladeEnc Engine Version Number
  148.  
  149.     BYTE    byMajorVersion;
  150.     BYTE    byMinorVersion;
  151.  
  152.     // DLL Release date
  153.  
  154.     BYTE    byDay;
  155.     BYTE    byMonth;
  156.     WORD    wYear;
  157.  
  158.     // BladeEnc    Homepage URL
  159.  
  160.     CHAR    zHomepage[BE_MAX_HOMEPAGE + 1];    
  161.  
  162. } BE_VERSION, *PBE_VERSION;            
  163.  
  164. #ifndef _BLADEDLL
  165.  
  166. typedef BE_ERR    (*BEINITSTREAM)            (PBE_CONFIG, PDWORD, PDWORD, PHBE_STREAM);
  167. typedef BE_ERR    (*BEENCODECHUNK)        (HBE_STREAM, DWORD, PSHORT, PBYTE, PDWORD);
  168. typedef BE_ERR    (*BEDEINITSTREAM)        (HBE_STREAM, PBYTE, PDWORD);
  169. typedef BE_ERR    (*BECLOSESTREAM)        (HBE_STREAM);
  170. typedef VOID    (*BEVERSION)            (PBE_VERSION);
  171. typedef VOID    (*BEWRITEVBRHEADER)        (LPCSTR);
  172.  
  173. #define    TEXT_BEINITSTREAM        "beInitStream"
  174. #define    TEXT_BEENCODECHUNK        "beEncodeChunk"
  175. #define    TEXT_BEDEINITSTREAM        "beDeinitStream"
  176. #define    TEXT_BECLOSESTREAM        "beCloseStream"
  177. #define    TEXT_BEVERSION            "beVersion"
  178. #define    TEXT_BEWRITEVBRHEADER    "beWriteVBRHeader"
  179.  
  180. #else
  181.  
  182. __declspec(dllexport) BE_ERR    beInitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize, PHBE_STREAM phbeStream);
  183. __declspec(dllexport) BE_ERR    beEncodeChunk(HBE_STREAM hbeStream, DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput);
  184. __declspec(dllexport) BE_ERR    beDeinitStream(HBE_STREAM hbeStream, PBYTE pOutput, PDWORD pdwOutput);
  185. __declspec(dllexport) BE_ERR    beCloseStream(HBE_STREAM hbeStream);
  186. __declspec(dllexport) VOID        beVersion(PBE_VERSION pbeVersion);
  187. __declspec(dllexport) BE_ERR    beWriteVBRHeader(LPCSTR lpszFileName);
  188.  
  189.  
  190. #endif
  191.  
  192. #pragma pack(pop)
  193.  
  194. #endif
  195.