perscmgr.h
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:11k
源码类别:

Symbian

开发平台:

C/C++

  1. /* ***** BEGIN LICENSE BLOCK ***** 
  2.  * Version: RCSL 1.0/RPSL 1.0 
  3.  *  
  4.  * Portions Copyright (c) 1995-2002 RealNetworks, Inc. All Rights Reserved. 
  5.  *      
  6.  * The contents of this file, and the files included with this file, are 
  7.  * subject to the current version of the RealNetworks Public Source License 
  8.  * Version 1.0 (the "RPSL") available at 
  9.  * http://www.helixcommunity.org/content/rpsl unless you have licensed 
  10.  * the file under the RealNetworks Community Source License Version 1.0 
  11.  * (the "RCSL") available at http://www.helixcommunity.org/content/rcsl, 
  12.  * in which case the RCSL will apply. You may also obtain the license terms 
  13.  * directly from RealNetworks.  You may not use this file except in 
  14.  * compliance with the RPSL or, if you have a valid RCSL with RealNetworks 
  15.  * applicable to this file, the RCSL.  Please see the applicable RPSL or 
  16.  * RCSL for the rights, obligations and limitations governing use of the 
  17.  * contents of the file.  
  18.  *  
  19.  * This file is part of the Helix DNA Technology. RealNetworks is the 
  20.  * developer of the Original Code and owns the copyrights in the portions 
  21.  * it created. 
  22.  *  
  23.  * This file, and the files included with this file, is distributed and made 
  24.  * available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 
  25.  * EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS ALL SUCH WARRANTIES, 
  26.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS 
  27.  * FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 
  28.  * 
  29.  * Technology Compatibility Kit Test Suite(s) Location: 
  30.  *    http://www.helixcommunity.org/content/tck 
  31.  * 
  32.  * Contributor(s): 
  33.  *  
  34.  * ***** END LICENSE BLOCK ***** */ 
  35. #ifndef _PERSISTENTCOMPONENTMANAGER_
  36. #define _PERSISTENTCOMPONENTMANAGER_
  37. class HXPlayer;
  38. class SourceInfo;
  39. class HXPersistentComponent;
  40. class HXPersistentComponentManager;
  41. class HXPersistentComponent : public IHXPersistentComponent
  42. {
  43. protected:
  44.     LONG32     m_lRefCount;
  45.     BOOL     m_bInitialized;
  46.     BOOL     m_bToBeClosed;
  47.     BOOL     m_bCleanupLayoutCalled;
  48.     UINT16     m_uGroups;
  49.     UINT16     m_uTracks;
  50.     UINT32     m_ulComponentID;
  51.     UINT32     m_ulPersistentType;
  52.     SourceInfo*     m_pSourceInfo;
  53.     HXPersistentComponent*     m_pPersistentParent;
  54.     CHXSimpleList*     m_pPersistentChildList;     
  55.     IHXValues*     m_pProperties;
  56.     IHXPersistentRenderer*     m_pPersistentRenderer;
  57.     IHXRendererAdviseSink*     m_pRendererAdviseSink;
  58.     IHXGroupSink*     m_pGroupSink;
  59.     HXPersistentComponentManager*  m_pComponentManager;
  60.     virtual     ~HXPersistentComponent();
  61.     friend class HXPlayer;
  62.     friend class SourceInfo;
  63.     friend class HXAdvancedGroupManager;
  64.     friend class HXPersistentComponentManager;
  65. public:
  66.     HXPersistentComponent(HXPersistentComponentManager* pManager);
  67.     /*
  68.      *  IUnknown methods
  69.      */
  70.     STDMETHOD(QueryInterface)       (THIS_
  71.     REFIID riid,
  72.     void** ppvObj);
  73.     STDMETHOD_(ULONG32,AddRef)      (THIS);
  74.     STDMETHOD_(ULONG32,Release)     (THIS);
  75.     /************************************************************************
  76.      * Method:
  77.      *     IHXPersistentComponent::Init
  78.      * Purpose:
  79.      *     initialize persistent component
  80.      */
  81.     STDMETHOD(Init) (THIS_
  82.                                 IHXPersistentRenderer* pPersistentRenderer);
  83.     /************************************************************************
  84.      * Method:
  85.      *     IHXPersistentComponent::AddRendererAdviseSink
  86.      * Purpose:
  87.      *     add renderer advise sink
  88.      */
  89.     STDMETHOD(AddRendererAdviseSink) (THIS_
  90.                                 IHXRendererAdviseSink* pSink);
  91.     /************************************************************************
  92.      * Method:
  93.      *     IHXPersistentComponent::RemoveRendererAdviseSink
  94.      * Purpose:
  95.      *     remove renderer advise sink
  96.      */
  97.     STDMETHOD(RemoveRendererAdviseSink) (THIS_
  98.                                 IHXRendererAdviseSink* pSink);
  99.     /************************************************************************
  100.      * Method:
  101.      *     IHXPersistentComponent::AddGroupSink
  102.      * Purpose:
  103.      *     add renderer advise sink
  104.      */
  105.     STDMETHOD(AddGroupSink) (THIS_
  106.                                 IHXGroupSink* pSink);
  107.     /************************************************************************
  108.      * Method:
  109.      *     IHXPersistentComponent::RemoveGroupSink
  110.      * Purpose:
  111.      *     remove renderer advise sink
  112.      */
  113.     STDMETHOD(RemoveGroupSink) (THIS_
  114.                                 IHXGroupSink* pSink);
  115.     /************************************************************************
  116.      * Method:
  117.      *     IHXPersistentComponent::GetPersistentRenderer
  118.      * Purpose:
  119.      *     get persistent renderer
  120.      */
  121.     STDMETHOD(GetPersistentRenderer) (THIS_
  122.                                 REF(IHXPersistentRenderer*) pPersistentRenderer);
  123.     /************************************************************************
  124.      * Method:
  125.      *     IHXPersistentComponent::GetPersistentProperties
  126.      * Purpose:
  127.      *     get persistent component properties
  128.      */
  129.     STDMETHOD(GetPersistentProperties) (THIS_
  130.                                 REF(IHXValues*) pProperties);
  131.     HX_RESULT GetPersistentComponent (UINT32 ulComponentID, REF(IHXPersistentComponent*) pComponent);
  132.     HX_RESULT CurrentGroupSet (UINT16 uGroupIndex, IHXGroup* pGroup);
  133.     HX_RESULT OnTimeSync (UINT32 ulCurrentTime);
  134.     UINT32 GetPersistentComponentCount(void);
  135.     void TrackUpdated (UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues);
  136.     void AllRenderersClosed (void);
  137.     void Reset (void);
  138.     void Remove (void);
  139. };
  140. class HXPersistentComponentManager : public IHXPersistentComponentManager,
  141.       public IHXGroupSink
  142. {
  143. protected:
  144.     LONG32     m_lRefCount;
  145.     UINT32     m_ulComponentIndex;
  146.     INT32     m_nCurrentGroup;
  147.     HXPlayer*     m_pPlayer;    
  148.     HXPersistentComponent* m_pRootPersistentComponent;
  149.     virtual     ~HXPersistentComponentManager();
  150.     friend class HXPlayer;
  151.     friend class HXPersistentComponent;
  152. public:
  153.     HXPersistentComponentManager(HXPlayer* pPlayer);
  154.     /*
  155.      *  IUnknown methods
  156.      */
  157.     STDMETHOD(QueryInterface)       (THIS_
  158.     REFIID riid,
  159.     void** ppvObj);
  160.     STDMETHOD_(ULONG32,AddRef)      (THIS);
  161.     STDMETHOD_(ULONG32,Release)     (THIS);
  162.     /************************************************************************
  163.      * Method:
  164.      *     IHXPersistentComponentManager::CreatePersistentComponent
  165.      * Purpose:
  166.      *     create persistent component
  167.      */
  168.     STDMETHOD(CreatePersistentComponent)    (THIS_
  169.     REF(IHXPersistentComponent*)   pPersistentComponent);
  170.     /************************************************************************
  171.      * Method:
  172.      *     IHXPersistentComponentManager::AddPersistentComponent
  173.      * Purpose:
  174.      *     add persistent component
  175.      */
  176.     STDMETHOD(AddPersistentComponent)     (THIS_
  177.     IHXPersistentComponent* pPersistentComponent);
  178.     /************************************************************************
  179.      * Method:
  180.      *     IHXPersistentComponentManager::RemovePersistentComponent
  181.      * Purpose:
  182.      *     remove persistent component
  183.      */
  184.     STDMETHOD(RemovePersistentComponent)    (THIS_
  185.     UINT32 ulPersistentComponentID);
  186.     /************************************************************************
  187.      * Method:
  188.      *     IHXPersistentComponentManager::GetPersistentComponent
  189.      * Purpose:
  190.      *     get persistent component information
  191.      */
  192.     STDMETHOD(GetPersistentComponent)     (THIS_
  193.     UINT32     ulPersistentComponentID,
  194.     REF(IHXPersistentComponent*)   pPersistentComponent);
  195.     /************************************************************************
  196.      * Method:
  197.      *     IHXPersistentComponentManager::AttachPersistentComponentLayout
  198.      * Purpose:
  199.      *     get persistent component information
  200.      */
  201.     STDMETHOD(AttachPersistentComponentLayout) (IUnknown*  pLSG,
  202. IHXValues* pProps);
  203.     /*
  204.      *  IHXGroupSink methods
  205.      */
  206.     /************************************************************************
  207.     *  Method:
  208.     *      IHXGroupSink::GroupAdded
  209.     *  Purpose:
  210.     * Notification of a new group being added to the presentation.
  211.     */
  212.     STDMETHOD(GroupAdded)     (THIS_
  213.     UINT16 /*IN*/ uGroupIndex,
  214.     IHXGroup* /*IN*/ pGroup);
  215.     /************************************************************************
  216.     *  Method:
  217.     *      IHXGroupSink::GroupRemoved
  218.     *  Purpose:
  219.     * Notification of a group being removed from the presentation.
  220.     */
  221.     STDMETHOD(GroupRemoved)     (THIS_
  222.     UINT16 /*IN*/ uGroupIndex,
  223.     IHXGroup*  /*IN*/ pGroup);
  224.     /************************************************************************
  225.     *  Method:
  226.     *      IHXGroupSink::AllGroupsRemoved
  227.     *  Purpose:
  228.     * Notification that all groups have been removed from the 
  229.     * current presentation.
  230.     */
  231.     STDMETHOD(AllGroupsRemoved)     (THIS);
  232.     /************************************************************************
  233.     *  Method:
  234.     *      IHXGroupSink::TrackAdded
  235.     *  Purpose:
  236.     * Notification of a new track being added to a group.
  237.     */
  238.     STDMETHOD(TrackAdded)     (THIS_
  239.     UINT16      /*IN*/ uGroupIndex,
  240.     UINT16      /*IN*/ uTrackIndex,
  241.     IHXValues*     /*IN*/ pTrack);
  242.     /************************************************************************
  243.     *  Method:
  244.     *      IHXGroupSink::TrackRemoved
  245.     *  Purpose:
  246.     * Notification of a track being removed from a group.
  247.     */
  248.     STDMETHOD(TrackRemoved)     (THIS_
  249.     UINT16     /*IN*/ uGroupIndex,
  250.     UINT16      /*IN*/ uTrackIndex,
  251.     IHXValues*     /*IN*/ pTrack);
  252.     /************************************************************************
  253.     *  Method:
  254.     *      IHXGroupSink::TrackStarted
  255.     *  Purpose:
  256.     * Notification of a track being started (to get duration, for
  257.     * instance...)
  258.     */
  259.     STDMETHOD(TrackStarted)     (THIS_
  260.     UINT16     /*IN*/ uGroupIndex,
  261.     UINT16     /*IN*/ uTrackIndex,
  262.     IHXValues*     /*IN*/ pTrack);
  263.     /************************************************************************
  264.     *  Method:
  265.     *      IHXGroupSink::TrackStopped
  266.     *  Purpose:
  267.     * Notification of a track being stopped
  268.     *
  269.     */
  270.     STDMETHOD(TrackStopped)     (THIS_
  271.     UINT16     /*IN*/ uGroupIndex,
  272.     UINT16     /*IN*/ uTrackIndex,
  273.     IHXValues*     /*IN*/ pTrack);
  274.     /************************************************************************
  275.     *  Method:
  276.     *      IHXGroupSink::CurrentGroupSet
  277.     *  Purpose:
  278.     * This group is being currently played in the presentation.
  279.     */
  280.     STDMETHOD(CurrentGroupSet)     (THIS_
  281.     UINT16      /*IN*/ uGroupIndex,
  282.     IHXGroup*     /*IN*/ pGroup);
  283.     HX_RESULT OnTimeSync(ULONG32 ulCurrentTime);
  284.     BOOL IsCleanupLayoutNeeded(INT32 nCurrentGroup, INT32 nGroupSwitchTo);
  285.     UINT32 GetPersistentComponentCount(void);
  286.     void TrackUpdated(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues);
  287.     void CloseAllRenderers(INT32 nGroupSwitchTo);
  288.     void Reset();
  289.     void Close();
  290. };
  291. #endif /*_PERSISTENTCOMPONENTMANAGER_*/