/********************************************************************
 *                                                                  *
 * THIS FILE IS PART OF THE FILEWRITERDX SOURCE CODE.               *
 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
 *                                                                  *
 * THE FILEWRITERDX SOURCE CODE IS (C) COPYRIGHT 2008 Cocha         *
 * http://sourceforge.jp/projects/directshow/                       *
 *                                                                  *
 ********************************************************************/

#ifndef _FileWriterDX_h_
#define _FileWriterDX_h_


// ------------------------------------------------------------------------------------------------------------------------
class CFileWriterDX : public CBaseFilter, public IFileSinkFilter
{
   friend class CInputPin;

public:
   DECLARE_IUNKNOWN

   // コンストラクタとデストラクタ
   CFileWriterDX(LPUNKNOWN,HRESULT *);
   ~CFileWriterDX();

   // CBaseFilterの純粋仮想メソッド
   virtual CBasePin *GetPin(int n);
   virtual int GetPinCount();

   // CBaseFilterのオーバーライド
   STDMETHODIMP NonDelegatingQueryInterface(REFIID, void **);
   STDMETHODIMP Stop();

   // IFileSinkFilterのオーバーライド
   STDMETHODIMP SetFileName(LPCOLESTR, const AM_MEDIA_TYPE *);
   STDMETHODIMP GetCurFile(LPOLESTR *, AM_MEDIA_TYPE *);

private:

   // ユーザ変数
   CCritSec m_Lock;
   CCritSec m_ReceiveLock;
   CInputPin *m_pInputPin;
   CPosPassThru *m_pPosition;
   WCHAR m_awFileName[MAX_PATH];
};
// ------------------------------------------------------------------------------------------------------------------------

#endif _FileWriterDX_h_
