#pragma once #include "SoundLib\MP3File.h" // CAACFile command target //このヘッダーでneaacdec.hのインクルードは避けたいので、構造体の型のみ宣言しておきます。 typedef struct faacEncConfiguration faacEncConfiguration; typedef faacEncConfiguration *faacEncConfigurationPtr; typedef void *NeAACDecHandle; class CAACFile : public CMP3File { public: //コンストラクタ CAACFile(CWnd* pWndOwner=NULL); //デストラクタ virtual ~CAACFile(); //メンバー変数の初期化 void Init(); //メンバー変数の削除 virtual void Delete(); enum streamFormat { RAW_STREAM=0, ADTS_STREAM=1, }; //AACファイルがオープンされているかどうか?(オーバーライド) virtual BOOL IsAACFile(){return (m_hDecoder!=0);}; //読み込み中のデバイスハンドルの有効/無効を基底クラスに返します。(オーバーライド) virtual BOOL IsOpen(){return (m_hDecoder)? TRUE:CMP3File::IsOpen();}; //音楽ファイルからWave音源に変換してストリーム読み込み(オーバーライド) virtual UINT StreamIn(LPVOID pBuffer,UINT nBufSize,UINT* pIndexSample); //faacEncConfiguration構造体の初期化 void InitEncConfiguration(); //faacEncConfiguration構造体の取得(オーバーライド) virtual BOOL GetEncConfiguration(faacEncConfigurationPtr pConfigAAC,faacEncConfigurationPtr pConfigMP4=NULL); //faacEncConfiguration構造体の設定(オーバーライド) virtual BOOL SetEncConfiguration(faacEncConfigurationPtr pConfigAAC,faacEncConfigurationPtr pConfigMP4=NULL); //faacバージョンの取得 const char* GetFaacVersion(){return m_pszFaacId;}; //faacエンコーダー名の取得 const char* GetFaacCopyright(){return m_pszFaacCopyright;}; protected: //AACファイルを開く(オーバーライド) // lpszFileName:ファイルのパス名 virtual BOOL ReadFile(LPCTSTR lpszFileName); //ヘッダーの読み込み BOOL ReadHeader(CFile* infile); //AACファイルの書き込み(オーバーライド) virtual BOOL WriteFile(LPCTSTR lpszFileName); //AACストリームの書き込み BOOL StreamOut(CFile* outfile,faacEncConfigurationPtr pConfig=NULL); //デコーダー NeAACDecHandle m_hDecoder; int m_headerType; //0:RAW,1:ADIF,2:ADTS CByteArray m_byteInCache; //入力側キャッシュ //エンコーダー char* m_pszFaacId; //バージョン char* m_pszFaacCopyright; //著作権 faacEncConfiguration* m_pConfig;//エンコーダー構成 };