Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
3.3 KiB

  1. #ifndef __TOOLPARAM_H__
  2. #define __TOOLPARAM_H__
  3. #include "medparam.h"
  4. #include "alist.h"
  5. typedef struct _ParamInfo
  6. {
  7. DWORD dwIndex; // Which parameter.
  8. MP_PARAMINFO MParamInfo; // Standard MediaParams structure.
  9. WCHAR * pwchText; // Array of text names for enumerated types.
  10. } ParamInfo;
  11. class CCurveItem : public AListItem
  12. {
  13. public:
  14. CCurveItem* GetNext() { return (CCurveItem*)AListItem::GetNext();}
  15. MP_ENVELOPE_SEGMENT m_Envelope; // Envelope segment.
  16. };
  17. class CCurveList : public AList
  18. {
  19. public:
  20. // void Clear();
  21. void AddHead(CCurveItem* pCurveItem) { AList::AddHead((AListItem*)pCurveItem);}
  22. // void Insert(CCurveItem* pCurveItem);
  23. CCurveItem* GetHead(){return (CCurveItem*)AList::GetHead();}
  24. // CCurveItem* GetItem(LONG lIndex){return (CCurveItem*)AList::GetItem(lIndex);}
  25. CCurveItem* RemoveHead(){ return (CCurveItem*)AList::RemoveHead();}
  26. // void Remove(CCurveItem* pCurveItem){AList::Remove((AListItem*)pCurveItem);}
  27. // void AddTail(CCurveItem* pCurveItem){AList::AddTail((AListItem*)pCurveItem);}
  28. // CCurveItem* GetTail(){ return (CCurveItem*)AList::GetTail();}
  29. };
  30. #define MAX_REF_TIME 0x7FFFFFFFFFFFFFFF
  31. #define MP_CAPS_ALL MP_CAPS_CURVE_JUMP | MP_CAPS_CURVE_LINEAR | MP_CAPS_CURVE_SQUARE | MP_CAPS_CURVE_INVSQUARE | MP_CAPS_CURVE_SINE
  32. class CParamsManager : public IMediaParams, public IMediaParamInfo
  33. {
  34. public:
  35. CParamsManager();
  36. ~CParamsManager();
  37. // IUnknown
  38. STDMETHOD(QueryInterface)(REFIID, LPVOID FAR *) PURE;
  39. STDMETHOD_(ULONG, AddRef)() PURE;
  40. STDMETHOD_(ULONG, Release)() PURE;
  41. // IMediaParams
  42. STDMETHODIMP GetParam(DWORD dwParamIndex, MP_DATA *pValue);
  43. STDMETHODIMP SetParam( DWORD dwParamIndex,MP_DATA value);
  44. STDMETHODIMP AddEnvelope(DWORD dwParamIndex,DWORD cPoints,MP_ENVELOPE_SEGMENT *ppEnvelope);
  45. STDMETHODIMP FlushEnvelope( DWORD dwParamIndex,REFERENCE_TIME refTimeStart,REFERENCE_TIME refTimeEnd);
  46. STDMETHODIMP SetTimeFormat( GUID guidTimeFormat,MP_TIMEDATA mpTimeData);
  47. // IMediaParamInfo
  48. STDMETHODIMP GetParamCount(DWORD *pdwParams);
  49. STDMETHODIMP GetParamInfo(DWORD dwParamIndex,MP_PARAMINFO *pInfo);
  50. STDMETHODIMP GetParamText(DWORD dwParamIndex,WCHAR **ppwchText);
  51. STDMETHODIMP GetNumTimeFormats(DWORD *pdwNumTimeFormats);
  52. STDMETHODIMP GetSupportedTimeFormat(DWORD dwFormatIndex,GUID *pguidTimeFormat);
  53. STDMETHODIMP GetCurrentTimeFormat( GUID *pguidTimeFormat,MP_TIMEDATA *pTimeData);
  54. protected:
  55. HRESULT InitParams( DWORD cParams, ParamInfo *pParamInfos);
  56. HRESULT GetParamFloat (DWORD dwParamIndex,REFERENCE_TIME rt,float *pval);
  57. HRESULT GetParamInt (DWORD dwParamIndex,REFERENCE_TIME rt,long *pval);
  58. HRESULT CopyParamsFromSource(CParamsManager * pSource);
  59. // data
  60. CRITICAL_SECTION m_ParamsCriticalSection;
  61. BOOL m_fDirty; // Has data changed since last file load or save?
  62. BOOL m_fMusicTime; // True if time format is music time, else false for clock time.
  63. DWORD m_cParams; // Nuimber of parameters.
  64. ParamInfo *m_pParamInfos; // Array of ParamInfo structures, one for each parameter.
  65. CCurveList *m_pCurveLists; // Array of Curve lists, one for each parameter.
  66. };
  67. #endif // __TOOLPARAM_H__