perscmgr.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:12k
源码类别:

Symbian

开发平台:

Visual C++

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