home *** CD-ROM | disk | FTP | other *** search
/ The Net: Ultimate Internet Guide / WWLCD1.ISO / mac / SiteBldr / AMOVIE / SDK / _SETUP / COMMON.Z / effect.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  2.9 KB  |  111 lines

  1. //==========================================================================;
  2. //
  3. //  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. //  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. //  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. //  PURPOSE.
  7. //
  8. //  Copyright (c) 1992 - 1996  Microsoft Corporation.  All Rights Reserved.
  9. //
  10. //--------------------------------------------------------------------------;
  11.  
  12. #ifndef __VIDEOEFFECT__
  13. #define __VIDEOEFFECT__
  14.  
  15. // Class ID for CEffectFilter objects
  16. // {BCD05AD0-5020-11ce-B2B2-00DD01101B85}
  17. DEFINE_GUID(CLSID_VideoEffect,
  18. 0xbcd05ad0, 0x5020, 0x11ce, 0xb2, 0xb2, 0x0, 0xdd, 0x1, 0x10, 0x1b, 0x85);
  19.  
  20. //
  21. // Property Page
  22. //
  23. // {BCD05AD1-5020-11ce-B2B2-00DD01101B85}
  24. DEFINE_GUID(CLSID_EffectPropertyPage,
  25. 0xbcd05ad1, 0x5020, 0x11ce, 0xb2, 0xb2, 0x0, 0xdd, 0x1, 0x10, 0x1b, 0x85);
  26.  
  27. // below stuff is implementation-only....
  28. #ifdef _EFFECT_IMPLEMENTATION_
  29. const int MAXINPUTS = 2;
  30. const int NEFFECTS = 4;
  31.  
  32. class CEffectFilter : public CBaseVideoMixer,
  33.           public ISpecifyPropertyPages,
  34.           public IEffect,
  35.           public CPersistStream {
  36. /* Nested interfaces */
  37.  
  38. public:
  39.  
  40.     CEffectFilter(LPUNKNOWN, HRESULT *);
  41.     ~CEffectFilter();
  42.  
  43.     // override this to say what interfaces we support and where
  44.     STDMETHODIMP NonDelegatingQueryInterface(REFIID, void **);
  45.  
  46.     DECLARE_IUNKNOWN;
  47.  
  48.  
  49.     // this goes in the factory template table to create new instances
  50.     static CUnknown * CreateInstance(LPUNKNOWN, HRESULT *);
  51.  
  52.     HRESULT WriteToStream(IStream *pStream);
  53.     HRESULT ReadFromStream(IStream *pStream);
  54.     int SizeMax();
  55.  
  56.     // ISpecifyPropertyPages
  57.     STDMETHODIMP GetPages(CAUUID *pPages);
  58.  
  59.     // Override CPersist stream method
  60.     STDMETHODIMP GetClassID(CLSID *pClsid);
  61.  
  62.  
  63.     // setup helper
  64.     LPAMOVIESETUP_FILTER GetSetupData();
  65.  
  66. protected:
  67.  
  68.     HRESULT ActuallyDoEffect(
  69.         BITMAPINFOHEADER *lpbi,
  70.         LONG lEffectParam,
  71.         BYTE *pIn1,
  72.         BYTE *pIn2,
  73.         BYTE *pOut);
  74.  
  75.     HRESULT MixSamples(IMediaSample *pMediaSampleOut);
  76.     HRESULT CanMixType(const CMediaType *pmt);
  77.  
  78.     HRESULT SetMediaType(int iPin, const CMediaType *pmt);
  79.  
  80. private:
  81.  
  82.     int           m_effectNum;
  83.  
  84.     int           m_effectStart;
  85.     int           m_effectEnd;
  86.  
  87.     CRefTime        m_streamOffsets[2];
  88.     CRefTime        m_streamLengths[2];
  89.     CRefTime       m_effectStartTime;
  90.     CRefTime       m_effectTime;
  91.     CRefTime       m_movieLength;
  92.  
  93. public:
  94.     //
  95.     // --- IEffect ---
  96.     //
  97.  
  98.     STDMETHOD(SetEffectParameters) (
  99.         int effectNum,
  100.         REFTIME startTime, REFTIME endTime,
  101.         int startLevel, int endLevel);
  102.     STDMETHOD(GetEffectParameters) (
  103.         int *effectNum,
  104.         REFTIME *startTime, REFTIME *endTime,
  105.         int *startLevel, int *endLevel);
  106. };
  107. #endif // _Effect_H_ implementation only....
  108.  
  109. #endif /* __VIDEOEFFECT__ */
  110.  
  111.