| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- #ifndef __DISC_FORMATDATA_20151220__
- #define __DISC_FORMATDATA_20151220__
- ///////////////////////////////////////////////////////////////////////
- // DiscFormatData.h
- //
- // Wrapper for IDiscFormat2Data Interface
- //
- // 包装IDiscFormat2Data接口用于写入数据媒体。
- //
- #pragma once
- #define WM_IMAPI_UPDATE WM_APP+842
- typedef struct _IMAPI_STATUS {
- // IDiscFormat2DataEventArgs Interface
- LONG elapsedTime; // Elapsed time in seconds
- LONG remainingTime; // Remaining time in seconds
- LONG totalTime; // total estimated time in seconds
- // IWriteEngine2EventArgs Interface
- LONG startLba; // the starting lba of the current operation
- LONG sectorCount; // the total sectors to write in the current operation
- LONG lastReadLba; // the last read lba address
- LONG lastWrittenLba; // the last written lba address
- LONG totalSystemBuffer; // total size of the system buffer
- LONG usedSystemBuffer; // size of used system buffer
- LONG freeSystemBuffer; // size of the free system buffer
- } IMAPI_STATUS, *PIMAPI_STATUS;
- /*
- typedef enum {
- IMAPI_BURN_VERIFICATION_NONE = 0,
- IMAPI_BURN_VERIFICATION_QUICK = 1,
- IMAPI_BURN_VERIFICATION_FULL = 2
- } IMAPI_BURN_VERIFICATION_LEVEL;
- */
- #define RETURN_CANCEL_WRITE 0
- #define RETURN_CONTINUE 1
- class CDiscRecorder;
- class CDiscFormatData
- {
- private:
- IDiscFormat2Data* m_discFormatData;
- SAFEARRAY* m_mediaTypesArray;
- SAFEARRAY* m_supportedSpeeds;
- HRESULT m_hResult;
- CString m_errorMessage;
- HWND m_hNotificationWnd;
- bool m_closeMedia;
- public:
- CDiscFormatData(void);
- ~CDiscFormatData(void);
- inline HRESULT GetHresult() {return m_hResult;}
- inline CString GetErrorMessage() {return m_errorMessage;}
- inline IDiscFormat2Data* GetInterface() {return m_discFormatData;}
- bool Initialize(CDiscRecorder* pDiscRecorder, const CString& clientName);
- bool Burn(HWND hWnd, IStream* data);
- ULONG GetTotalSupportedMediaTypes();
- int GetSupportedMediaType(ULONG index);
- ULONG GetTotalSupportedWriteSpeeds();
- int GetSupportedWriteSpeed(ULONG index);
- bool SetWriteSpeed(ULONG index);
- inline void SetCloseMedia(bool closeMedia){m_closeMedia = closeMedia;}
- //bool SetBurnVerification(IMAPI_BURN_VERIFICATION_LEVEL VerificationLevel);
- // 获取光盘的可用大小;
- bool GetFreeSectorsOnMedia(LONG& lFreeSectorOnMedia);
- protected:
- IStream* m_streamData;
- };
- #endif
|