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

ALameDLL.h

00001 /*
00002 
00003   $Id: ALameDLL.h,v 1.7 2001/08/16 20:00:33 robux4 Exp $ 
00004 
00005 
00006   $Log: ALameDLL.h,v $
00007   Revision 1.7  2001/08/16 20:00:33  robux4
00008   Added the encoding DLL location in the abuot box
00009   
00010   Revision 1.6  2001/08/01 19:40:16  robux4
00011   Updated with complete documentation support
00012   
00013   Revision 1.5  2001/07/31 18:49:39  robux4
00014   Initial Doxygen doc support
00015   
00016   Revision 1.4  2001/07/27 16:42:39  robux4
00017   Updated CVS tags
00018 
00019   Revision 1.3  2001/07/26 19:28:49  robux4
00020   Added CVS tags
00021 
00022 */
00023 
00024 #if !defined(_ALAMEDLL_H__INCLUDED_)
00025 #define _ALAMEDLL_H__INCLUDED_
00026 
00027 #if _MSC_VER >= 1000
00028 #pragma once
00029 #endif // _MSC_VER >= 1000
00030 
00031 #include <windows.h>
00032 #include <assert.h>
00033 
00034 #include "BladeMP3EncDLL.h"
00035 
00036 #include "ADbg/ADbg.h"
00037 
00041 class ALameDLL
00042 {
00043 public:
00047   ALameDLL();
00048 
00052   virtual ~ALameDLL();
00053 
00060   bool Load(const char * DllLocation);
00061 
00065   void Free(void);
00066 
00078   inline BE_ERR ALameDLL::InitStream(PBE_CONFIG pbeConfig, PDWORD dwSamples, PDWORD dwBufferSize) const
00079   {
00080     if (beInitStream != NULL)
00081       return beInitStream(pbeConfig, dwSamples, dwBufferSize, (PHBE_STREAM) &hbeStream);
00082     else
00083       return BE_ERR_INVALID_HANDLE;
00084   }
00085 
00098   inline BE_ERR ALameDLL::EncodeChunk(DWORD nSamples, PSHORT pSamples, PBYTE pOutput, PDWORD pdwOutput ) const
00099   {
00100     if (beEncodeChunk != NULL)
00101       return beEncodeChunk(hbeStream, nSamples, pSamples, pOutput, pdwOutput);
00102     else
00103       return BE_ERR_INVALID_HANDLE;
00104   }
00105 
00106 
00118   inline BE_ERR ALameDLL::DeinitStream(PBYTE pOutput, PDWORD pdwOutput ) const
00119   {
00120     if (beDeinitStream != NULL)
00121       return beDeinitStream( hbeStream, pOutput, pdwOutput);
00122     else
00123       return BE_ERR_INVALID_HANDLE;
00124   }
00125 
00133   inline BE_ERR ALameDLL::CloseStream() const
00134   {
00135     if (beCloseStream != NULL)
00136       return beCloseStream( hbeStream );
00137     else
00138       return BE_ERR_INVALID_HANDLE;
00139   }
00140 
00151   inline void ALameDLL::WriteVBRHeader(LPCSTR pszMP3FileName ) const
00152   {
00153     if (beWriteVBRHeader != NULL)
00154       beWriteVBRHeader(pszMP3FileName);
00155   }
00156 
00166   inline void ALameDLL::Version(BE_VERSION * ver) const
00167   {
00168     assert(ver != NULL);
00169 
00170     if (beVersion != NULL)
00171       beVersion(ver);
00172   }
00173 
00177   inline bool IsLoaded() const {
00178     return ((LameDLL != NULL) && (beInitStream != NULL) && (beCloseStream != NULL) && (beEncodeChunk != NULL) && (beDeinitStream != NULL) && (beWriteVBRHeader != NULL) && (beVersion != NULL));
00179   }
00180 
00189   inline DWORD ALameDLL::GetFullLocation(TCHAR * output, const int BufferSize) const {
00190     if (LameDLL != NULL)
00191     {
00192       return ::GetModuleFileName(LameDLL, output, BufferSize);
00193     }
00194     else return 0;
00195   }
00196 
00197 private:
00198   HMODULE LameDLL;
00199 
00200   BEINITSTREAM     beInitStream;
00201   BECLOSESTREAM    beCloseStream;
00202   BEENCODECHUNK    beEncodeChunk;
00203   BEDEINITSTREAM   beDeinitStream;
00204   BEWRITEVBRHEADER beWriteVBRHeader;
00205   BEVERSION        beVersion;
00206 
00207   HBE_STREAM       hbeStream;
00208 };
00209 
00210 #endif // !defined(_ALAMEDLL_H__INCLUDED_)

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