Newer
Older
monitord / lame-3.97 / ACM / .svn / text-base / ACM.h.svn-base
  1. /**
  2. *
  3. * Lame ACM wrapper, encode/decode MP3 based RIFF/AVI files in MS Windows
  4. *
  5. * Copyright (c) 2002 Steve Lhomme <steve.lhomme at free.fr>
  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.1 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 Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. */
  22. /*!
  23. \author Steve Lhomme
  24. \version \$Id: ACM.h,v 1.7 2002/04/06 14:01:33 robux4 Exp $
  25. */
  26.  
  27. #if !defined(_ACM_H__INCLUDED_)
  28. #define _ACM_H__INCLUDED_
  29.  
  30. #if _MSC_VER >= 1000
  31. #pragma once
  32. #endif // _MSC_VER >= 1000
  33.  
  34. #include <vector>
  35.  
  36. #include <windows.h>
  37. #include <mmsystem.h>
  38. #include <mmreg.h>
  39. #include <msacm.h>
  40. #include <msacmdrv.h>
  41.  
  42. #include "lame.h"
  43.  
  44. #include "ADbg/ADbg.h"
  45.  
  46. class AEncodeProperties;
  47.  
  48. class bitrate_item {
  49. public:
  50. unsigned int frequency;
  51. unsigned int bitrate;
  52. unsigned int channels;
  53. vbr_mode mode;
  54. bool operator<(const bitrate_item & bitrate) const;
  55. };
  56.  
  57. class ACM
  58. {
  59. public:
  60. ACM( HMODULE hModule );
  61. virtual ~ACM();
  62.  
  63. LONG DriverProcedure(const HDRVR hdrvr, const UINT msg, LONG lParam1, LONG lParam2);
  64.  
  65. static const char * GetVersionString(void) {return VersionString;}
  66.  
  67. protected:
  68. // inline DWORD Configure( HWND hParentWindow, LPDRVCONFIGINFO pConfig );
  69. inline DWORD About( HWND hParentWindow );
  70.  
  71. inline DWORD OnDriverDetails(const HDRVR hdrvr, LPACMDRIVERDETAILS a_DriverDetail);
  72. inline DWORD OnFormatTagDetails(LPACMFORMATTAGDETAILS a_FormatTagDetails, const LPARAM a_Query);
  73. inline DWORD OnFormatDetails(LPACMFORMATDETAILS a_FormatDetails, const LPARAM a_Query);
  74. inline DWORD OnFormatSuggest(LPACMDRVFORMATSUGGEST a_FormatSuggest);
  75. inline DWORD OnStreamOpen(LPACMDRVSTREAMINSTANCE a_StreamInstance);
  76. inline DWORD OnStreamClose(LPACMDRVSTREAMINSTANCE a_StreamInstance);
  77. inline DWORD OnStreamSize(LPACMDRVSTREAMINSTANCE a_StreamInstance, LPACMDRVSTREAMSIZE the_StreamSize);
  78. inline DWORD OnStreamPrepareHeader(LPACMDRVSTREAMINSTANCE a_StreamInstance, LPACMSTREAMHEADER a_StreamHeader);
  79. inline DWORD OnStreamUnPrepareHeader(LPACMDRVSTREAMINSTANCE a_StreamInstance, LPACMSTREAMHEADER a_StreamHeader);
  80. inline DWORD OnStreamConvert(LPACMDRVSTREAMINSTANCE a_StreamInstance, LPACMDRVSTREAMHEADER a_StreamHeader);
  81.  
  82. void GetMP3FormatForIndex(const DWORD the_Index, WAVEFORMATEX & the_Format, unsigned short the_String[ACMFORMATDETAILS_FORMAT_CHARS]) const;
  83. void GetPCMFormatForIndex(const DWORD the_Index, WAVEFORMATEX & the_Format, unsigned short the_String[ACMFORMATDETAILS_FORMAT_CHARS]) const;
  84. DWORD GetNumberEncodingFormats() const;
  85. bool IsSmartOutput(const int frequency, const int bitrate, const int channels) const;
  86. void BuildBitrateTable();
  87.  
  88. HMODULE my_hModule;
  89. HICON my_hIcon;
  90. ADbg my_debug;
  91. AEncodeProperties my_EncodingProperties;
  92. std::vector<bitrate_item> bitrate_table;
  93.  
  94. static char VersionString[20];
  95. };
  96.  
  97. #endif // !defined(_ACM_H__INCLUDED_)
  98.