1 |
// CTivoChunk.h : Declaration of the CTivoChunk
|
2 |
|
3 |
#pragma once
|
4 |
#include "resource.h" // main symbols
|
5 |
|
6 |
#include "tivocom.h"
|
7 |
|
8 |
|
9 |
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
|
10 |
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
|
11 |
#endif
|
12 |
|
13 |
// CTivoChunk
|
14 |
|
15 |
class ATL_NO_VTABLE CTivoChunk :
|
16 |
public CComObjectRootEx<CComSingleThreadModel>,
|
17 |
// public CComCoClass<CTivoChunk, &CLSID_TivoChunk>,
|
18 |
public IDispatchImpl<ITivoChunk, &IID_ITivoChunk, &LIBID_tivocomLib, /*wMajor =*/ 1, /*wMinor =*/ 1>
|
19 |
{
|
20 |
friend class CTivoFile;
|
21 |
tivo_stream_chunk* m_chunk;
|
22 |
ULARGE_INTEGER m_chunkstart;
|
23 |
CComPtr<ITivoChunk> m_chunk0;
|
24 |
std::string m_mak;
|
25 |
bool m_decrypted;
|
26 |
public:
|
27 |
CTivoChunk()
|
28 |
: m_chunk (NULL)
|
29 |
, m_decrypted (false)
|
30 |
{
|
31 |
}
|
32 |
|
33 |
|
34 |
BEGIN_COM_MAP(CTivoChunk)
|
35 |
COM_INTERFACE_ENTRY(ITivoChunk)
|
36 |
COM_INTERFACE_ENTRY(IDispatch)
|
37 |
END_COM_MAP()
|
38 |
|
39 |
|
40 |
|
41 |
DECLARE_PROTECT_FINAL_CONSTRUCT()
|
42 |
|
43 |
HRESULT FinalConstruct()
|
44 |
{
|
45 |
return S_OK;
|
46 |
}
|
47 |
|
48 |
void FinalRelease()
|
49 |
{
|
50 |
if (m_chunk)
|
51 |
free(m_chunk);
|
52 |
}
|
53 |
|
54 |
STDMETHOD(Init)(const std::string & mak, ITivoChunk* chunk0, IStream* pStm, ULARGE_INTEGER* pChunkPos);
|
55 |
|
56 |
public:
|
57 |
|
58 |
STDMETHOD(get_chunk_size)(UINT* pVal);
|
59 |
STDMETHOD(get_data_size)(UINT* pVal);
|
60 |
STDMETHOD(get_chunk_id)(USHORT* pVal);
|
61 |
STDMETHOD(get_chunk_type)(USHORT* pVal);
|
62 |
STDMETHOD(get_data)(BSTR* pVal);
|
63 |
};
|
64 |
|
65 |
//OBJECT_ENTRY_AUTO(__uuidof(TivoChunk), CTivoChunk)
|