-
Notifications
You must be signed in to change notification settings - Fork 4
/
DiscFormatData.h
66 lines (52 loc) · 1.82 KB
/
DiscFormatData.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
///////////////////////////////////////////////////////////////////////
// DiscFormatData.h
//
// Wrapper for IDiscFormat2Data Interface
//
// Written by Eric Haddan
//
#pragma once
#include "stdafx.h"
#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;
#define RETURN_CANCEL_WRITE 0
#define RETURN_CONTINUE 1
class CDiscRecorder;
class CDiscFormatData
{
private:
IDiscFormat2Data* m_discFormatData;
SAFEARRAY* m_mediaTypesArray;
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);
inline void SetCloseMedia(bool closeMedia){m_closeMedia = closeMedia;}
protected:
IStream* m_streamData;
public:
static CString GetWriteErrorMsg(HRESULT hr);
};