//---------------------------------------------------------------------------

#ifndef MainUnitH
#define MainUnitH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Dialogs.hpp>
#include "FlashPlayerControl.hpp"
#include <ComCtrls.hpp>
//---------------------------------------------------------------------------
class TMainForm : public TForm
{
__published:	// IDE-managed Components
        TButton *ButtonPlayFLV;
        TButton *ButtonPlaySWF;
        TButton *ButtonSite;
        TButton *ButtonOrder;
        TOpenDialog *OpenDialogFLV;
        TOpenDialog *OpenDialogSWF;
        TFlashPlayerControl *FlashPlayerControl1;
        TLabel* Label1;
        TEdit* EditWAVPath;
        TButton* ButtonBrowseWAVFile;
        TButton* ButtonStartRecording;
        TButton* ButtonStopRecording;
        TCheckBox* CheckBoxAutoRecording;
        TSaveDialog* SaveDialogWAV;
        void __fastcall FormCreate(TObject *Sender);
        void __fastcall ButtonOrderClick(TObject *Sender);
        void __fastcall ButtonPlayFLVClick(TObject *Sender);
        void __fastcall ButtonPlaySWFClick(TObject *Sender);
        void __fastcall ButtonSiteClick(TObject *Sender);
        void __fastcall ButtonBrowseWAVFileClick(TObject *Sender);
        void __fastcall ButtonStartRecordingClick(TObject *Sender);
        void __fastcall ButtonStopRecordingClick(TObject *Sender);
        void __fastcall FormDestroy(TObject *Sender);
private:	// User declarations
        bool FPlaySWF;
        AnsiString FFLVPath;
        HMMIO Fhmmio;
        PWaveFormatEx FPWaveFormatEx;

        bool FStarted;

        void __fastcall OnGlobalLoadExternalResource(const WideString URL, Classes::TStream* Stream);

        void __fastcall OnAudioOutputOpen(PWaveFormatEx lpFormat);
        void __fastcall OnAudioOutputWrite(PWaveHdr lpWaveOutHdr, unsigned uSize);
        void __fastcall OnAudioOutputClose(void);

public:		// User declarations
        __fastcall TMainForm(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TMainForm *MainForm;
//---------------------------------------------------------------------------
#endif
