/[tivodecode]/tivocom/trunk/DTivoFileEvents_CP.h
ViewVC logotype

Contents of /tivocom/trunk/DTivoFileEvents_CP.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 254 - (show annotations) (download)
Sun Sep 9 23:26:20 2007 UTC (14 years, 4 months ago) by jeremyd2019
File MIME type: text/plain
File size: 1189 byte(s)
rework interfaces (bumped typelib version to 1.1).  Add support for decoding the MPEG stream.  Added support to read and write from streams (implementing IStream) and make the versions which take filenames use a stream implementation that wraps file access.  Make OpenTivoFile take the MAK as a parameter.  It has a default value of "" (empty string), which means try to get the MAK from the registry, so either omit that param (for those languages which permit that) or specify it as empty string to use the MAK from the registry.  Added progress reporting of MPEG stream decoding via a connection point.  Progress is updated every 100 frames, and percent complete is provided if the tivo file stream supports Seek and Stat functions

1 #pragma once
2
3 template <class T>
4 class CProxy_DTivoFileEvents : public IConnectionPointImpl<T, &__uuidof( DTivoFileEvents ), CComDynamicUnkArray>
5 {
6 //Warning this class will be regenerated by the wizard.
7 public:
8 HRESULT Fire_OnProgressChange(DWORD dwFrames, double dblPercentDone = -1.0)
9 {
10 HRESULT hr = S_OK;
11 T * pThis = static_cast<T *>(this);
12 int cConnections = m_vec.GetSize();
13
14 for (int iConnection = 0; iConnection < cConnections; iConnection++)
15 {
16 pThis->Lock();
17 CComPtr<IUnknown> punkConnection = m_vec.GetAt(iConnection);
18 pThis->Unlock();
19
20 IDispatch * pConnection = static_cast<IDispatch *>(punkConnection.p);
21
22 if (pConnection)
23 {
24 CComVariant avarParams[2];
25 avarParams[1] = dwFrames;
26 avarParams[1].vt = VT_UI4;
27 avarParams[0] = dblPercentDone;
28 avarParams[0].vt = VT_R8;
29
30 CComVariant varResult;
31
32 DISPPARAMS params = { avarParams, NULL, 2, 0 };
33 pConnection->Invoke(1, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &params, &varResult, NULL, NULL);
34 if (SUCCEEDED(varResult.ChangeType(VT_BOOL)))
35 {
36 if (varResult.boolVal == VARIANT_TRUE)
37 {
38 hr = S_FALSE;
39 }
40 }
41 }
42 }
43 return hr;
44 }
45 };

cvs@jdrake.com
ViewVC Help
Powered by ViewVC 1.1.13