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

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: hxplay.h,v 1.18.8.1 2004/07/09 02:05:40 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 _HXPLAYER_
  50. #define _HXPLAYER_
  51. #include "hxtypes.h"
  52. #include "hxcomm.h" // IHXRegistryID
  53. #include "hxfiles.h"
  54. #include "hxsmbw.h"
  55. #include "hxresult.h"
  56. #include "hxslist.h"
  57. #include "chxelst.h"
  58. #include "hxmap.h"
  59. #include "chxpckts.h"
  60. #include "hxurl.h"
  61. #include "hxtick.h"
  62. #include "hxmon.h"
  63. #include "hxclreg.h"
  64. #include "statinfo.h"
  65. #include "strminfo.h"
  66. #include "hxauth.h"
  67. #include "hxpreftr.h"
  68. #include "hxvsrc.h"
  69. //#include "prefkeys.h"
  70. #include "plprefk.h"
  71. //#include "domain.h"  // Needed for domain object
  72. #include "timeval.h"
  73. #include "hxausvc.h"
  74. #include "hxpends.h"
  75. #include "hxerror.h"
  76. #include "hxmeta.h"
  77. #include "chxphook.h"
  78. #include "hxwin.h"
  79. #include "hxcorgui.h"
  80. #include "smartptr.h"
  81. #include "miscsp.h"
  82. #include "hxrquest.h"
  83. #include "perscmgr.h"
  84. #include "hxbsrc.h"
  85. #include "hxsrc.h"
  86. #include "hxcbobj.h"
  87. #ifdef _SYMBIAN
  88. //XXXgfw Wow, symbian's unistd.h #defines remove to be unlink.
  89. //Very uncool.
  90. #undef remove
  91. #endif
  92. // forward decl.
  93. _INTERFACE IHXPlayer;
  94. _INTERFACE IHXPlayer2;
  95. _INTERFACE IHXAudioPlayerResponse;
  96. _INTERFACE IHXClientEngine;
  97. _INTERFACE IHXRenderer;
  98. _INTERFACE IHXScheduler;
  99. _INTERFACE IHXClientAdviseSink;
  100. _INTERFACE IHXMetaTrack;
  101. _INTERFACE IHXMetaLayout;
  102. _INTERFACE IHXErrorMessages;
  103. _INTERFACE IHXPreferences;
  104. _INTERFACE IHXHyperNavigate;
  105. _INTERFACE IHXAuthenticationManager;
  106. _INTERFACE IHXSiteSupplier;
  107. _INTERFACE IHXSiteLayout;
  108. _INTERFACE IHXUpgradeCollection;
  109. _INTERFACE IHXGroupSink;
  110. _INTERFACE IHXGroup;
  111. _INTERFACE IHXPlayerState;
  112. _INTERFACE IHXProxyManager;
  113. _INTERFACE IHXViewSourceCommand;
  114. _INTERFACE IHXViewPortManager;
  115. #if defined(HELIX_FEATURE_MEDIAMARKER)
  116. _INTERFACE IHXMediaMarkerManager;
  117. #endif /* #if defined(HELIX_FEATURE_MEDIAMARKER) */
  118. #if defined(HELIX_FEATURE_EVENTMANAGER)
  119. _INTERFACE IHXEventManager;
  120. #endif /* #if defined(HELIX_FEATURE_EVENTMANAGER) */
  121. _INTERFACE IHXPlayerNavigator;
  122. _INTERFACE IHXClientRequestSink;
  123. class CHXSiteManager;
  124. class CHXAudioPlayer;
  125. class HXClientEngine;
  126. class HXSource;
  127. class HXFileSource;
  128. class HXNetSource;
  129. class HXStream;
  130. class HXPlayerCallback;
  131. class UpdateStatsCallback;
  132. class CHXAdviseSinkControl;
  133. class CHXErrorSinkControl;
  134. class HXCookies;
  135. class Timeline;
  136. class Timeval;
  137. class HXMutex;
  138. class Plugin2Handler;
  139. struct IHXPlugin2Handler;
  140. class HXPersistentComponentManager;
  141. class HXPreferredTransportManager;
  142. #ifdef _UNIX
  143. _INTERFACE IHXSiteEventHandler;
  144. #endif
  145. struct STREAM_INFO;
  146. typedef ULONG32 BufferingReason;
  147. struct RendererInfo;
  148. class  SourceInfo;
  149. class HXPlayer;
  150. class UpdateStatsCallback;
  151. class HXPlayerCallback;
  152. class HXBasicGroupManager;
  153. class HXAdvancedGroupManager;
  154. class NextGroupManager;
  155. class PrefetchManager;
  156. class HXMasterTAC;
  157. class PlayerHyperNavigate;
  158. struct IHXBandwidthManager;
  159. class CHXEvent;
  160. class CHXSimpleList;
  161. class CHXMapStringToOb;
  162. class HXViewPortManager;
  163. #if defined(HELIX_FEATURE_MEDIAMARKER)
  164. class CHXMediaMarkerManager;
  165. #endif /* #if defined(HELIX_FEATURE_MEDIAMARKER) */
  166. #if defined(HELIX_FEATURE_EVENTMANAGER)
  167. class CRendererEventManager;
  168. #endif /* #if defined(HELIX_FEATURE_EVENTMANAGER) */
  169. #define DEFAULT_TIMESYNC_GRANULARITY 100
  170. /* Lowest allowable time sync granularity */
  171. #define MINIMUM_TIMESYNC_GRANULARITY 20
  172. #ifndef _WIN16
  173. //#if defined(HELIX_FEATURE_AUTHENTICATION)
  174. typedef WRAPPED_POINTER(IUnknown) Wrapped_IUnknown;
  175. class _CListOfWrapped_IUnknown_Node
  176. {
  177. #ifdef HELIX_FEATURE_AUTHENTICATION
  178. public:
  179.     _CListOfWrapped_IUnknown_Node();
  180.     ~_CListOfWrapped_IUnknown_Node();
  181.     Wrapped_IUnknown& value();
  182.     const Wrapped_IUnknown& value() const;
  183.     void value(const Wrapped_IUnknown& rclsNewValue);
  184.     _CListOfWrapped_IUnknown_Node& operator=(const Wrapped_IUnknown& rclsNewValue); 
  185.     _CListOfWrapped_IUnknown_Node* next() const;
  186.     void next(_CListOfWrapped_IUnknown_Node* plocnNew);
  187.     _CListOfWrapped_IUnknown_Node* prev() const;
  188.     void prev(_CListOfWrapped_IUnknown_Node* plocnNew);
  189.     void Remove();
  190.     void Insert(_CListOfWrapped_IUnknown_Node& rlocnNew);
  191. protected:
  192.     Wrapped_IUnknown m_clsValue;
  193.     _CListOfWrapped_IUnknown_Node* m_plocPrev;
  194.     _CListOfWrapped_IUnknown_Node* m_plocNext;
  195.     _CListOfWrapped_IUnknown_Node(const _CListOfWrapped_IUnknown_Node& rlocnOther){}
  196. #endif /* HELIX_FEATURE_AUTHENTICATION */
  197. };
  198. class _CListIteratorWrapped_IUnknown_;
  199. class _CListReverseIteratorWrapped_IUnknown_;
  200. class _CListOfWrapped_IUnknown_
  201. {
  202. public:
  203.     typedef _CListIteratorWrapped_IUnknown_ iterator;
  204.     typedef _CListReverseIteratorWrapped_IUnknown_ reverse_iterator;
  205.     typedef const _CListReverseIteratorWrapped_IUnknown_ const_reverse_iterator;
  206. #ifdef HELIX_FEATURE_AUTHENTICATION
  207.     _CListOfWrapped_IUnknown_();
  208.     _CListOfWrapped_IUnknown_(const _CListOfWrapped_IUnknown_& rlocOther);
  209.     ~_CListOfWrapped_IUnknown_();
  210.     _CListOfWrapped_IUnknown_& operator=(const _CListOfWrapped_IUnknown_& rlocOther); 
  211.     iterator begin();
  212.     const iterator begin() const;
  213.     iterator end();
  214.     const iterator end() const;
  215.     reverse_iterator rbegin();
  216.     const reverse_iterator rbegin() const;
  217.     reverse_iterator rend();
  218.     const reverse_iterator rend() const;
  219.     iterator insert(iterator itBefore, const Wrapped_IUnknown&);
  220.     void insert
  221.     (
  222. iterator itBefore,
  223. const iterator itFirst,
  224. const iterator itLast
  225.     );
  226.     void remove(iterator itThis);
  227.     void remove(iterator itFirst, iterator itLast);
  228.     void empty();
  229. protected:
  230.     _CListOfWrapped_IUnknown_Node m_locnREnd;
  231.     _CListOfWrapped_IUnknown_Node m_locnEnd;
  232.     void _copy(const _CListOfWrapped_IUnknown_& rlocOther);
  233. #endif /* HELIX_FEATURE_AUTHENTICATION */
  234. };
  235. class _CListIteratorWrapped_IUnknown_
  236. {
  237. #ifdef HELIX_FEATURE_AUTHENTICATION
  238. public:
  239.     _CListIteratorWrapped_IUnknown_();
  240.     _CListIteratorWrapped_IUnknown_
  241.     (
  242.         const _CListOfWrapped_IUnknown_Node& rlocnNewLocation
  243.     );
  244.     _CListIteratorWrapped_IUnknown_(const _CListIteratorWrapped_IUnknown_& rliocOther);
  245.     ~_CListIteratorWrapped_IUnknown_();
  246.     _CListIteratorWrapped_IUnknown_& operator=
  247.     (
  248. const _CListIteratorWrapped_IUnknown_& rliocOther
  249.     );
  250.     Wrapped_IUnknown& operator*();
  251.     _CListIteratorWrapped_IUnknown_& operator=(const Wrapped_IUnknown& rclsNewValue);
  252.     _CListIteratorWrapped_IUnknown_& operator++();
  253.     const _CListIteratorWrapped_IUnknown_ operator++(int);
  254.     _CListIteratorWrapped_IUnknown_& operator--();
  255.     const _CListIteratorWrapped_IUnknown_ operator--(int);
  256. private:
  257.     _CListOfWrapped_IUnknown_Node* m_plocCurrent;
  258.     friend class _CListOfWrapped_IUnknown_;
  259.     friend BOOL operator==
  260.     (
  261. const _CListIteratorWrapped_IUnknown_& rliocLeft,
  262. const _CListIteratorWrapped_IUnknown_& rliocRight
  263.     );
  264.     friend BOOL operator!=
  265.     (
  266. const _CListIteratorWrapped_IUnknown_& rliocLeft,
  267. const _CListIteratorWrapped_IUnknown_& rliocRight
  268.     );
  269. #endif /* HELIX_FEATURE_AUTHENTICATION */
  270. };
  271. #ifdef HELIX_FEATURE_AUTHENTICATION
  272. BOOL operator==
  273. (
  274.     const _CListIteratorWrapped_IUnknown_& rliocLeft,
  275.     const _CListIteratorWrapped_IUnknown_& rliocRight
  276. );
  277. BOOL operator!=
  278. (
  279.     const _CListIteratorWrapped_IUnknown_& rliocLeft,
  280.     const _CListIteratorWrapped_IUnknown_& rliocRight
  281. );
  282. #endif /* HELIX_FEATURE_AUTHENTICATION */
  283. class _CListReverseIteratorWrapped_IUnknown_
  284. {
  285. #ifdef HELIX_FEATURE_AUTHENTICATION
  286. public:
  287.     _CListReverseIteratorWrapped_IUnknown_();
  288.     _CListReverseIteratorWrapped_IUnknown_
  289.     (
  290.         const _CListOfWrapped_IUnknown_Node& rlocnNewLocation
  291.     );
  292.     _CListReverseIteratorWrapped_IUnknown_
  293.     (
  294. const _CListReverseIteratorWrapped_IUnknown_& rlriocOther
  295.     );
  296.     ~_CListReverseIteratorWrapped_IUnknown_();
  297.     _CListReverseIteratorWrapped_IUnknown_& operator=
  298.     (
  299. const _CListReverseIteratorWrapped_IUnknown_& rlriocOther
  300.     );
  301.     Wrapped_IUnknown& operator*();
  302.     _CListReverseIteratorWrapped_IUnknown_& operator=(const Wrapped_IUnknown& rclsNewValue);
  303.     _CListReverseIteratorWrapped_IUnknown_& operator++();
  304.     const _CListReverseIteratorWrapped_IUnknown_ operator++(int);
  305.     _CListReverseIteratorWrapped_IUnknown_& operator--();
  306.     const _CListReverseIteratorWrapped_IUnknown_ operator--(int);
  307. private:
  308.     _CListOfWrapped_IUnknown_Node* m_plocCurrent;
  309.     friend class _CListOfWrapped_IUnknown_;
  310.     friend BOOL operator==
  311.     (
  312. const _CListReverseIteratorWrapped_IUnknown_& rlriocLeft,
  313. const _CListReverseIteratorWrapped_IUnknown_& rlriocRight
  314.     );
  315.     friend BOOL operator!=
  316.     (
  317. const _CListReverseIteratorWrapped_IUnknown_& rlriocLeft,
  318. const _CListReverseIteratorWrapped_IUnknown_& rlriocRight
  319.     );
  320. #endif /* HELIX_FEATURE_AUTHENTICATION */
  321. };
  322. #ifdef HELIX_FEATURE_AUTHENTICATION
  323. BOOL operator==
  324. (
  325.     const _CListReverseIteratorWrapped_IUnknown_& rlriocLeft,
  326.     const _CListReverseIteratorWrapped_IUnknown_& rlriocRight
  327. );
  328. BOOL operator!=
  329. (
  330.     const _CListReverseIteratorWrapped_IUnknown_& rlriocLeft,
  331.     const _CListReverseIteratorWrapped_IUnknown_& rlriocRight
  332. );     
  333. #endif /* HELIX_FEATURE_AUTHENTICATION */
  334. class _CHXAuthenticationRequests
  335. {
  336. public:
  337.     _CHXAuthenticationRequests();
  338.     ~_CHXAuthenticationRequests();
  339.     HX_RESULT Add
  340.     (
  341. HXPlayer* pPlayerRequester, 
  342. IHXAuthenticationManagerResponse* pAuthenticationManagerResponseRequester,
  343. IHXValues* pAuthenticationHeaderValues
  344.     );
  345.     HX_RESULT SatisfyPending
  346.     (
  347. HX_RESULT ResultStatus, 
  348. const char* pCharUser, 
  349. const char* pCharPassword
  350.     );
  351.     void     ClearPendingList();
  352. private:
  353.     _CListOfWrapped_IUnknown_ m_ListOfIUnknownRequesters;
  354.     HXMutex* m_pMutexProtectList;
  355.     BOOL m_bUIShowing;
  356. };
  357. //#endif /* HELIX_FEATURE_AUTHENTICATION */
  358. struct RedirectInfo
  359. {
  360.     RedirectInfo()
  361.     {
  362. m_nGroupID = 0;
  363. m_nTrackID = 0;
  364. m_pURL = NULL;
  365.     }
  366.     ~RedirectInfo()
  367.     {
  368. HX_VECTOR_DELETE(m_pURL);
  369.     }
  370.     UINT16  m_nGroupID;
  371.     UINT16  m_nTrackID;
  372.     char*   m_pURL;
  373. };
  374. struct PendingTrackInfo
  375. {
  376.     PendingTrackInfo(UINT16     uGroupIndex, 
  377.      UINT16     uTrackIndex,
  378.      IHXValues*    pTrack)
  379.     {
  380. m_uGroupIndex = uGroupIndex;
  381. m_uTrackIndex = uTrackIndex;
  382. m_pTrack = pTrack;
  383. m_pTrack->AddRef();
  384.     }
  385.     ~PendingTrackInfo()
  386.     {
  387. HX_RELEASE(m_pTrack);
  388.     }
  389.     UINT16    m_uGroupIndex;
  390.     UINT16    m_uTrackIndex;
  391.     IHXValues*   m_pTrack;
  392. };
  393. #endif /* _WIN16 */
  394. class HXPlayer :   public IHXPlayer, 
  395.     public IHXPlayer2,
  396.     public IHXAudioPlayerResponse,
  397.     public IHXPendingStatus,
  398.     public IHXErrorMessages,
  399.     public IHXAuthenticationManager,
  400.     public IHXAuthenticationManager2,
  401.     public IHXAuthenticationManagerResponse,
  402.     public IHXRegistryID,
  403.     public IHXGroupSink,
  404.     public IHXLayoutSiteGroupManager,
  405.     public IHXRendererUpgrade,
  406.     public IHXInternalReset,
  407.     public IHXPlayerState,
  408.     public IHXViewSourceCommand,
  409.     public IHXOverrideDefaultServices,
  410.     public IHXPlayerNavigator,
  411.     public IHXClientStatisticsGranularity,
  412.     public IHXPlayerPresentation,
  413.                     public IHXRecordManager
  414. {
  415. protected:
  416.     LONG32 m_lRefCount;
  417.     UINT32 m_ulRepeatedRegistryID;
  418.     UINT32 m_ulNextGroupRegistryID;
  419.     HX_RESULT m_LastError;
  420.     char* m_pLastUserString;
  421.     UINT8 m_LastSeverity;
  422.     UINT32 m_ulLastUserCode;
  423.     char* m_pLastMoreInfoURL;
  424. #if defined(HELIX_FEATURE_REGISTRY)    
  425.     // statistic variables
  426.     HXClientRegistry* m_pRegistry;
  427. #else
  428.     void* m_pRegistry;
  429. #endif /* HELIX_FEATURE_REGISTRY */
  430. #if defined(HELIX_FEATURE_STATS) && defined(HELIX_FEATURE_REGISTRY)
  431.     PLAYER_STATS* m_pStats;
  432.     UpdateStatsCallback* m_pUpdateStatsCallback;
  433. #else
  434.     void* m_pStats;
  435.     void* m_pUpdateStatsCallback;
  436. #endif /* HELIX_FEATURE_STATS && HELIX_FEATURE_REGISTRY */
  437.     CHXGenericCallback* m_pHXPlayerCallback;
  438.     CHXGenericCallback* m_pHXPlayerInterruptCallback;
  439.     CHXGenericCallback* m_pSetupCallback;
  440. #if defined(HELIX_FEATURE_AUTHENTICATION)
  441.     CHXGenericCallback* m_pAuthenticationCallback;
  442. #else
  443.     void* m_pAuthenticationCallback;
  444. #endif /* HELIX_FEATURE_AUTHENTICATION */
  445.     IHXValues* m_pAutheticationValues;
  446.     ULONG32 m_ulStatsGranularity;
  447. public:
  448.     HXClientEngine* m_pEngine;
  449.     IHXPlugin2Handler* m_pPlugin2Handler;
  450. protected:
  451.     IUnknown* m_pClient;
  452.     CHXAudioPlayer* m_pAudioPlayer;
  453.     
  454.     CHXAdviseSinkControl* m_pAdviseSink;
  455.     CHXErrorSinkControl*   m_pErrorSinkControl;
  456.     
  457.     IHXClientRequestSink* m_pClientRequestSink;
  458.     IHXPreferences* m_pPreferences;
  459. #if defined(HELIX_FEATURE_HYPER_NAVIGATE)
  460.     PlayerHyperNavigate* m_pHyperNavigate;
  461. #else
  462.     void* m_pHyperNavigate;
  463. #endif /* HELIX_FEATURE_HYPER_NAVIGATE */
  464. #if defined(HELIX_FEATURE_PACKETHOOKMGR)
  465.     IHXPacketHookManager* m_pPacketHookManager;
  466. #else
  467.     void* m_pPacketHookManager;
  468. #endif /* HELIX_FEATURE_PACKETHOOKMGR */
  469. #if defined(HELIX_FEATURE_ADVANCEDGROUPMGR)
  470.     HXAdvancedGroupManager*     m_pGroupManager;
  471. #else
  472.     HXBasicGroupManager* m_pGroupManager;
  473. #endif /* HELIX_FEATURE_ADVANCEDGROUPMGR */
  474.     HXMasterTAC* m_pMasterTAC;
  475.     CHXSimpleList* m_pRedirectList;
  476.     IHXClientViewSource* m_pClientViewSource;
  477.     IHXClientViewRights* m_pClientViewRights;
  478.     IHXViewPortManager* m_pViewPortManager;
  479. #if defined(HELIX_FEATURE_MEDIAMARKER)
  480.     CHXMediaMarkerManager*     m_pMediaMarkerManager;
  481. #else
  482.     void* m_pMediaMarkerManager;
  483. #endif /* #if defined(HELIX_FEATURE_MEDIAMARKER) */
  484. #if defined(HELIX_FEATURE_EVENTMANAGER)
  485.     CRendererEventManager*      m_pEventManager;
  486. #else
  487.     void* m_pEventManager;
  488. #endif /* #if defined(HELIX_FEATURE_EVENTMANAGER) */
  489.     HXCookies* m_pCookies;
  490. #if defined(HELIX_FEATURE_NESTEDMETA)
  491.     HXPersistentComponentManager*  m_pPersistentComponentManager;
  492. #else
  493.     void* m_pPersistentComponentManager;
  494. #endif /* HELIX_FEATURE_NESTEDMETA */
  495.     HXPreferredTransportManager*   m_pPreferredTransportManager;
  496.     IHXNetInterfaces*     m_pNetInterfaces;
  497. public:
  498. HXPlayer();
  499. ~HXPlayer();
  500.     /*
  501.      * IUnknown methods
  502.      */
  503.     STDMETHOD(QueryInterface) (THIS_
  504. REFIID riid,
  505. void** ppvObj);
  506.     STDMETHOD_(ULONG32,AddRef) (THIS);
  507.     STDMETHOD_(ULONG32,Release) (THIS);
  508.     /*
  509.      * IHXPlayer methods
  510.      */
  511.     /************************************************************************
  512.      * Method:
  513.      * IHXPlayer::GetClientEngine
  514.      * Purpose:
  515.      * Get the interface to the client engine object of which the player
  516.      * is a part of.
  517.      *
  518.      */
  519.     STDMETHOD(GetClientEngine) (THIS_
  520.     REF(IHXClientEngine*) pEngine);
  521.     /************************************************************************
  522.      * Method:
  523.      * IHXPlayer::OpenURL
  524.      * Purpose:
  525.      * Tell the player to begin playback of all its sources.
  526.      *
  527.      */
  528.     STDMETHOD (OpenURL) (THIS_
  529.     const char* pURL);
  530.     /************************************************************************
  531.      * Method:
  532.      * IHXPlayer::Begin
  533.      * Purpose:
  534.      * Tell the player to begin playback of all its sources.
  535.      *
  536.      */
  537.     STDMETHOD (Begin) (THIS);
  538.     /************************************************************************
  539.      * Method:
  540.      * IHXPlayer::Stop
  541.      * Purpose:
  542.      * Tell the player to stop playback of all its sources.
  543.      *
  544.      */
  545.     STDMETHOD (Stop) (THIS);
  546.     /************************************************************************
  547.      * Method:
  548.      * IHXPlayer::Pause
  549.      * Purpose:
  550.      * Tell the player to pause playback of all its sources.
  551.      *
  552.      */
  553.     STDMETHOD (Pause) (THIS);
  554.     /************************************************************************
  555.      * Method:
  556.      * IHXPlayer::Seek
  557.      * Purpose:
  558.      * Tell the player to seek in the playback timeline of all its 
  559.      * sources.
  560.      *
  561.      */
  562.     STDMETHOD (Seek) (THIS_
  563. ULONG32 ulTime);
  564.     /************************************************************************
  565.      * Method:
  566.      *     IHXPlayer::GetSourceCount
  567.      * Purpose:
  568.      *     Returns the current number of source instances supported by
  569.      *     this player instance.
  570.      */
  571.     STDMETHOD_(UINT16, GetSourceCount)(THIS);
  572.     /************************************************************************
  573.      * Method:
  574.      *     IHXPlayer::GetSource
  575.      * Purpose:
  576.      *     Returns the Nth source instance supported by this player.
  577.      */
  578.     STDMETHOD(GetSource) (THIS_
  579. UINT16 nIndex,
  580. REF(IUnknown*) pUnknown);
  581.     /************************************************************************
  582.      * Method:
  583.      *     IHXPlayer::SetClientContext
  584.      * Purpose:
  585.      *     Called by the client to install itself as the provider of client
  586.      *     services to the core. This is traditionally called by the top 
  587.      *     level client application.
  588.      */
  589.     STDMETHOD(SetClientContext) (THIS_
  590. IUnknown* pUnknown);
  591.     /************************************************************************
  592.      * Method:
  593.      *     IHXPlayer::GetClientContext
  594.      * Purpose:
  595.      *     Called by the get the client context for this player. This is 
  596.      *     traditionally to determine called by top level client application.
  597.      */
  598.     STDMETHOD(GetClientContext) (THIS_
  599. REF(IUnknown*) pUnknown);
  600.     /************************************************************************
  601.      * Method:
  602.      * IHXPlayer::IsDone
  603.      * Purpose:
  604.      * Ask the player if it is done with the current presentation
  605.      *
  606.      */
  607.     STDMETHOD_ (BOOL,IsDone) (THIS);
  608.     /************************************************************************
  609.      * Method:
  610.      * IHXPlayer::IsLive
  611.      * Purpose:
  612.      * Ask the player whether it contains the live source
  613.      *
  614.      */
  615.     STDMETHOD_ (BOOL,IsLive) (THIS);
  616.     /************************************************************************
  617.      * Method:
  618.      * IHXPlayer::GetCurrentPlayTime
  619.      * Purpose:
  620.      * Get the current time on the Player timeline
  621.      *
  622.      */
  623.     STDMETHOD_ (ULONG32,GetCurrentPlayTime) (THIS);
  624.     /************************************************************************
  625.      * Method:
  626.      *     IHXPlayer::AddAdviseSink
  627.      * Purpose:
  628.      *     Call this method to add a client advise sink.
  629.      *
  630.      */
  631.     STDMETHOD(AddAdviseSink) (THIS_
  632. IHXClientAdviseSink* pAdviseSink);
  633.     /************************************************************************
  634.      * Method:
  635.      *     IHXPlayer::RemoveAdviseSink
  636.      * Purpose:
  637.      *     Call this method to remove a client advise sink.
  638.      */
  639.     STDMETHOD(RemoveAdviseSink) (THIS_
  640. IHXClientAdviseSink* pAdviseSink);
  641.     /************************************************************************
  642.      * Method:
  643.      *     IHXPlayer2::SetMinimumPreroll
  644.      * Purpose:
  645.      *     Call this method to set the minimum preroll of this clip
  646.      */
  647.     STDMETHOD(SetMinimumPreroll) (THIS_
  648. UINT32 ulMinPreroll);
  649.     /************************************************************************
  650.      * Method:
  651.      *     IHXPlayer2::GetMinimumPreroll
  652.      * Purpose:
  653.      *     Call this method to get the minimum preroll of this clip
  654.      */
  655.     STDMETHOD(GetMinimumPreroll) (THIS_
  656. REF(UINT32) ulMinPreroll);
  657.     /************************************************************************
  658.      * Method:
  659.      *     IHXPlayer2::OpenRequest
  660.      * Purpose:
  661.      *     Call this method to open the IHXRequest
  662.      */
  663.     STDMETHOD(OpenRequest) (THIS_
  664.     IHXRequest* pRequest);
  665.     
  666.     /************************************************************************
  667.      * Method:
  668.      *     IID_IHXPlayer2::GetRequest
  669.      * Purpose:
  670.      *     Call this method to get the IHXRequest
  671.      */
  672.     STDMETHOD(GetRequest) (THIS_
  673.    REF(IHXRequest*) pRequest);
  674.     /************************************************************************
  675.      * Method:
  676.      *     EventOccurred
  677.      * Purpose:
  678.      *     Clients call this to pass OS events to the player. HXxEvent
  679.      *     defines a cross-platform event.
  680.      */
  681.     void EventOccurred(HXxEvent* pEvent);
  682. #ifdef _UNIX
  683.     void CollectSelectInfo(INT32 *n, 
  684.    fd_set* readfds,
  685.    fd_set* writefds, 
  686.    fd_set* exceptfds,
  687.    struct timeval* tv);
  688.     void ProcessSelect(INT32* n,
  689.        fd_set* readfds,
  690.        fd_set* writefds, 
  691.        fd_set* exceptfds,
  692.        struct timeval* tv);
  693. #endif
  694.     /************************************************************************
  695.      * Method:
  696.      * GetInst
  697.      * Purpose:
  698.      * TBD
  699.      *
  700.      */
  701.     ULONG32 GetInst(void);
  702.     /************************************************************************
  703.      * Method:
  704.      * UpdateStatistics
  705.      * Purpose:
  706.      * Update statistics periodically
  707.      *
  708.      */
  709.     HX_RESULT UpdateStatistics(void);
  710.     /************************************************************************
  711.      * Method:
  712.      * ProcessIdle
  713.      * Purpose:
  714.      * Work-Horse for the player...
  715.      *
  716.      */
  717.     HX_RESULT ProcessIdle(void);
  718.     /************************************************************************
  719.      *  Method:
  720.      *      IHXAudioPlayerResponse::OnTimeSync
  721.      *  Purpose:
  722.      *      Notification interface provided by users of the IHXAudioPlayer 
  723.      *      interface. This method is called by the IHXAudioPlayer when 
  724.      *      audio playback occurs.
  725.      */
  726.     STDMETHOD(OnTimeSync)       (THIS_
  727. ULONG32 /*IN*/ ulTimeEnd);
  728.     /************************************************************************
  729.      * Method:
  730.      * HXPlayer::Init
  731.      * Purpose:
  732.      * Get the interface to the client engine object of which the player
  733.      * is a part of. It is not a part of IHXPlayer interface
  734.      *
  735.      */
  736.     STDMETHOD(Init) (THIS_
  737.  IHXClientEngine* pEngine,
  738.  UINT32 unRegistryID,
  739.  CHXAudioPlayer* pAudioPlayer);
  740.     /************************************************************************
  741.      * Method:
  742.      * HXPlayer::ReportError
  743.      * Purpose:
  744.      * The source object reports of any fatal errors. 
  745.      *
  746.      */
  747.     void ReportError (HXSource* pSource, 
  748. HX_RESULT theErr, const char* pUserString = NULL);
  749.     // IHXPendingStatus methods
  750.     /************************************************************************
  751.      * Method:
  752.      *     IHXPendingStatus::GetStatus
  753.      * Purpose:
  754.      *     Called by the user to get the current pending status from an object
  755.      */
  756.     STDMETHOD(GetStatus) (THIS_
  757. REF(UINT16) uStatusCode, 
  758. REF(IHXBuffer*) pStatusDesc, 
  759. REF(UINT16) ulPercentDone);
  760.     /************************************************************************
  761.      * Method:
  762.      *     HXPlayer::SetStatsGranularity
  763.      * Purpose:
  764.      *     Called by the user to set how often the statistics registry needs 
  765.      *     to be updated in ms
  766.      */
  767.     STDMETHOD(SetStatsGranularity) (THIS_
  768. ULONG32 ulGranularity);
  769.     /************************************************************************
  770.      * Method:
  771.      *     IHXPlayerPresentation::ClosePresentation
  772.      * Purpose:
  773.      *     Call this method to close the player's current presentation.  This will free
  774.      *     all resources associated with the current presentation.
  775.      */
  776.     STDMETHOD(ClosePresentation)    (THIS);
  777.     /*
  778.      * IHXErrorMessages methods
  779.      */
  780.     /************************************************************************
  781.      * Method:
  782.      *     IHXErrorMessages::Report
  783.      * Purpose:
  784.      *     Call this method to report an error, event, or status message.
  785.      */
  786.     STDMETHOD(Report) (THIS_
  787. const UINT8 unSeverity,  
  788. HX_RESULT ulHXCode,
  789. const ULONG32 ulUserCode,
  790. const char* pUserString,
  791. const char* pMoreInfoURL
  792. );
  793.     /************************************************************************
  794.      * Method:
  795.      *     IHXErrorMessages::GetErrorText
  796.      * Purpose:
  797.      *     Call this method to get the text description of a RMA error code.
  798.      * Parameters:
  799.      *     HX_RESULT ulHXCode
  800.      *      A RMA error code.
  801.      *  Return Value:
  802.      *     IHXBuffer* containing error text.
  803.      */
  804.     STDMETHOD_(IHXBuffer*, GetErrorText) (THIS_
  805. HX_RESULT ulHXCode
  806. );
  807.     /*
  808.      * IHXRegistryID methods
  809.      */
  810.     /************************************************************************
  811.      * Method:
  812.      *     IHXRegistryID::GetID
  813.      * Purpose:
  814.      *     Get registry ID(hash_key) of the objects(player, source and stream)
  815.      *
  816.      */
  817.     STDMETHOD(GetID) (THIS_
  818. REF(UINT32) /*OUT*/  ulRegistryID);
  819.     STDMETHOD(HandleAuthenticationRequest) 
  820.                                      (IHXAuthenticationManagerResponse*);
  821.     STDMETHOD(HandleAuthenticationRequest2)
  822.          (IHXAuthenticationManagerResponse*, IHXValues*);
  823.     // IHXAuthenticationManagerResponse
  824.     STDMETHOD(AuthenticationRequestDone)
  825.     (
  826. HX_RESULT HX_RESULTStatus,
  827. const char* pcharUser,
  828. const char* pcharPassword
  829.     );
  830.     
  831.     /*
  832.      *  IHXGroupSink methods
  833.      */
  834.     /************************************************************************
  835.     *  Method:
  836.     *      IHXGroupSink::GroupAdded
  837.     *  Purpose:
  838.     * Notification of a new group being added to the presentation.
  839.     */
  840.     STDMETHOD(GroupAdded)    (THIS_
  841.     UINT16      /*IN*/ uGroupIndex,
  842.     IHXGroup*     /*IN*/ pGroup);
  843.     /************************************************************************
  844.     *  Method:
  845.     *      IHXGroupSink::GroupRemoved
  846.     *  Purpose:
  847.     * Notification of a group being removed from the presentation.
  848.     */
  849.     STDMETHOD(GroupRemoved)    (THIS_
  850. UINT16      /*IN*/ uGroupIndex,
  851. IHXGroup*  /*IN*/ pGroup);
  852.     /************************************************************************
  853.     *  Method:
  854.     *      IHXGroupSink::AllGroupsRemoved
  855.     *  Purpose:
  856.     * Notification that all groups have been removed from the 
  857.     * current presentation.
  858.     */
  859.     STDMETHOD(AllGroupsRemoved)  (THIS);
  860.     /************************************************************************
  861.     *  Method:
  862.     *      IHXGroupSink::TrackAdded
  863.     *  Purpose:
  864.     * Notification of a new track being added to a group.
  865.     */
  866.     STDMETHOD(TrackAdded)  (THIS_
  867.     UINT16      /*IN*/ uGroupIndex,
  868.     UINT16      /*IN*/ uTrackIndex,
  869.     IHXValues*     /*IN*/ pTrack);
  870.     /************************************************************************
  871.     *  Method:
  872.     *      IHXGroupSink::TrackAdded
  873.     *  Purpose:
  874.     * Notification of a track being removed from a group.
  875.     */
  876.     STDMETHOD(TrackRemoved)    (THIS_
  877. UINT16  /*IN*/ uGroupIndex,
  878. UINT16  /*IN*/ uTrackIndex,
  879. IHXValues* /*IN*/ pTrack);
  880.     /************************************************************************
  881.     *  Method:
  882.     *      IHXGroupSink::TrackStarted
  883.     *  Purpose:
  884.     * Notification of a track being started in a group.
  885.     */
  886.     STDMETHOD(TrackStarted)    (THIS_
  887. UINT16  /*IN*/ uGroupIndex,
  888. UINT16  /*IN*/ uTrackIndex,
  889. IHXValues* /*IN*/ pTrack);
  890.     /************************************************************************
  891.     *  Method:
  892.     *      IHXGroupSink::TrackStopped
  893.     *  Purpose:
  894.     * Notification of a track being stopped in a group.
  895.     */
  896.     STDMETHOD(TrackStopped)    (THIS_
  897. UINT16  /*IN*/ uGroupIndex,
  898. UINT16  /*IN*/ uTrackIndex,
  899. IHXValues* /*IN*/ pTrack);
  900.    /************************************************************************
  901.     *  Method:
  902.     *      IHXGroupSink::CurrentGroupSet
  903.     *  Purpose:
  904.     * This group is being currently played in the presentation.
  905.     */
  906.     STDMETHOD(CurrentGroupSet) (THIS_
  907. UINT16      /*IN*/ uGroupIndex,
  908. IHXGroup*  /*IN*/ pGroup);
  909.            
  910.     /*
  911.      * IHXLayoutSiteGroupManager methods
  912.      */
  913.     /************************************************************************
  914.     *  Method:
  915.     *      IHXLayoutSiteGroupManager::AddLayoutSiteGroup
  916.     *  Purpose:
  917.     * Add this LSG to the presentation
  918.     */
  919.     STDMETHOD(AddLayoutSiteGroup) (THIS_
  920. IUnknown*  /*IN*/ pLSG);
  921.     /************************************************************************
  922.     *  Method:
  923.     *      IHXLayoutSiteGroupManager::RemoveLayoutSiteGroup
  924.     *  Purpose:
  925.     * Remove this LSG from the presentation
  926.     */
  927.     STDMETHOD(RemoveLayoutSiteGroup) (THIS_
  928. IUnknown*  /*IN*/ pLSG);
  929.     /*
  930.      * IHXRendererUpgrade methods
  931.      */
  932.     /************************************************************************
  933.     *  Method:
  934.     *      IHXRendererUpgrade::IsRendererAvailable
  935.     *  Purpose:
  936.     *    Is a renderer with this mime type already loaded?
  937.     */
  938.     STDMETHOD_(BOOL,IsRendererAvailable)(THIS_
  939. const char* /*IN*/ pMimeType);
  940.     /************************************************************************
  941.     *  Method:
  942.     *      IHXRendererUpgrade::ForceUpgrade
  943.     *  Purpose:
  944.     *    Force an upgrade of all renderers in list
  945.     */
  946.     STDMETHOD(ForceUpgrade) (THIS);
  947.     /*
  948.      * IHXInternalReset method
  949.      */
  950.     STDMETHOD(InternalReset) (THIS);
  951.     /*
  952.      * IHXPlayerState methods
  953.      */
  954.     STDMETHOD_(BOOL, IsPlaying)    (THIS) {return m_bIsPlaying;}
  955.     /************************************************************************
  956.      *  IHXViewSourceCommand methods
  957.      */
  958.     STDMETHOD_(BOOL, CanViewSource) (THIS_  
  959. IHXStreamSource* pStream);
  960.     STDMETHOD(DoViewSource) (THIS_
  961. IHXStreamSource* pStream);
  962.     STDMETHOD(GetViewSourceURL) (THIS_
  963. IHXStreamSource*     pSource,
  964. IHXViewSourceURLResponse*  pResp);
  965.     /*
  966.      * IHXOverrideDefaultServices methods
  967.      */
  968.     /************************************************************************
  969.      *  Method:
  970.      *      IHXOverrideDefaultServices::OverrideServices
  971.      *  Purpose:
  972.      *      Override default services provided by the G2 system.
  973.      * 
  974.      */
  975.     STDMETHOD(OverrideServices)         (THIS_
  976. IUnknown* pContext);
  977.     /*
  978.      * IHXPlayerNavigator methods
  979.      */
  980.     /************************************************************************
  981.      * Method:
  982.      *     IHXPlayerNavigator::AddChildPlayer
  983.      * Purpose:
  984.      *     Add child player to the current player
  985.      */
  986.     STDMETHOD(AddChildPlayer)     (THIS_
  987.     IHXPlayer* pPlayer);
  988.     /************************************************************************
  989.      * Method:
  990.      *     IHXPlayerNavigator::RemoveChildPlayer
  991.      * Purpose:
  992.      *     Remove child player from the current player
  993.      */
  994.     STDMETHOD(RemoveChildPlayer)    (THIS_
  995.     IHXPlayer* pPlayer);
  996.     /************************************************************************
  997.      * Method:
  998.      *     IHXPlayerNavigator::GetNumChildPlayer
  999.      * Purpose:
  1000.      *     Get number of the child players
  1001.      */
  1002.     STDMETHOD_(UINT16, GetNumChildPlayer)    (THIS);
  1003.     /************************************************************************
  1004.      * Method:
  1005.      *     IHXPlayerNavigator::GetChildPlayer
  1006.      * Purpose:
  1007.      *     Get Nth child player
  1008.      */
  1009.     STDMETHOD(GetChildPlayer)     (THIS_
  1010.     UINT16 uPlayerIndex,
  1011.     REF(IHXPlayer*) pPlayer);
  1012.     /************************************************************************
  1013.      * Method:
  1014.      *     IHXPlayerNavigator::SetParentPlayer
  1015.      * Purpose:
  1016.      *     Set the parent player
  1017.      */
  1018.     STDMETHOD(SetParentPlayer)     (THIS_
  1019.     IHXPlayer* pPlayer);
  1020.     /************************************************************************
  1021.      * Method:
  1022.      *     IHXPlayerNavigator::RemoveParentPlayer
  1023.      * Purpose:
  1024.      *     Remove the parent player
  1025.      */
  1026.     STDMETHOD(RemoveParentPlayer)   (THIS_
  1027.     IHXPlayer* pPlayer);
  1028.     /************************************************************************
  1029.      * Method:
  1030.      *     IHXPlayerNavigator::GetParentPlayer
  1031.      * Purpose:
  1032.      *     Get the parent player
  1033.      */
  1034.     STDMETHOD(GetParentPlayer)     (THIS_
  1035.     REF(IHXPlayer*) pPlayer);
  1036.     /* 
  1037.      * IHXRecordManager methods 
  1038.      */ 
  1039.     /************************************************************************ 
  1040.      *  Method: 
  1041.      *      IHXRecordManager::LoadRecordService 
  1042.      *  Purpose: 
  1043.      *      Called by TLC to supply the Core with record service. 
  1044.      */ 
  1045.     STDMETHOD(LoadRecordService) (THIS_ IHXRecordService* pRecordService); 
  1046.     /************************************************************************ 
  1047.      *  Method: 
  1048.      *      IHXRecordManager::GetRecordService 
  1049.      *  Purpose: 
  1050.      *      return current record service for the Player. 
  1051.      */ 
  1052.     STDMETHOD(GetRecordService) (THIS_ REF(IHXRecordService*) pRecordService); 
  1053.     /************************************************************************ 
  1054.      *  Method: 
  1055.      *      IHXRecordManager::UnloadRecordService 
  1056.      *  Purpose: 
  1057.      *      Called by TLC to ask the Core to stop using record service. 
  1058.      */ 
  1059.     STDMETHOD(UnloadRecordService) (THIS); 
  1060.     ////////////////////////////////////////////////////////////////////
  1061.     //
  1062.     // The following members are related to meta-file support.
  1063.     //
  1064. public:
  1065.     void SetModal(BOOL bModal) {m_bSetModal = bModal;};
  1066.     HX_RESULT SetSingleURLPresentation(const CHXURL* pURL);
  1067.     HX_RESULT AddURL(SourceInfo*& pSourceInfo, BOOL bAltURL);
  1068.     void GetActiveRequest(IHXRequest*& pRequest)
  1069. {
  1070.     pRequest = NULL;     
  1071.     if (m_pRequest)
  1072.     {
  1073. #if defined(HELIX_FEATURE_NESTEDMETA)
  1074. // we want to keep the original copy of IHXRequest in SMIL/RAM
  1075. // so that individual source within will have a "clean" copy of 
  1076. // IHXRequest to start with
  1077. if (m_pPersistentComponentManager &&
  1078.     m_pPersistentComponentManager->m_pRootPersistentComponent &&
  1079.     !m_pPersistentComponentManager->m_pRootPersistentComponent->m_bToBeClosed)
  1080. {
  1081.     CHXRequest::CreateFromWithRequestHeaderOnly(m_pRequest, &pRequest);
  1082. }
  1083. else
  1084. #endif /* HELIX_FEATURE_NESTEDMETA */
  1085. if (m_bActiveRequest)
  1086. {
  1087.     pRequest = m_pRequest;
  1088.     pRequest->AddRef();
  1089. }
  1090.     }
  1091. };
  1092.     void ResetActiveRequest() {m_bActiveRequest = FALSE;};
  1093.     void SetGranularity(ULONG32 ulGranularity);
  1094.     ULONG32 GetGranularity(void) {return m_ulLowestGranularity;};
  1095.     HX_RESULT SetGranularity(HXSource* pSource, UINT16 uStreamNumber, 
  1096.        UINT32 ulGranularity);
  1097.     void                ClosePlayer(void);
  1098.     
  1099.     void InternalPause();
  1100.     HX_RESULT EventReady(HXSource* pSource, CHXEvent* pEvent);
  1101.     void ShutDown(void);
  1102.     void RegisterSourcesDone(void);
  1103.     BOOL IsInitialized(void) {return m_bInitialized;};
  1104.     BOOL CanBeStarted(HXSource* pSource, SourceInfo* pThisSourceInfo, BOOL bPartOfNextGroup);
  1105.     void EndOfSource(HXSource* pSource);
  1106.     BOOL CanBeFastStarted(SourceInfo* pSourceInfo);
  1107.     void SureStreamSourceRegistered(SourceInfo* pSourceInfo);
  1108.     void SureStreamSourceUnRegistered(SourceInfo* pSourceInfo);
  1109.     ULONG32 GetInternalCurrentPlayTime(void)
  1110.     { return m_ulCurrentPlayTime; };
  1111.     HX_RESULT HandleRedirectRequest(UINT16 nGroup, UINT16 nTrack, char* pURL);
  1112.     BOOL IsAtSourceMap(SourceInfo* pSourceInfo);
  1113.     HX_RESULT RepeatTrackAdded(UINT16 /*IN*/ uGroupIndex,
  1114.  UINT16 /*IN*/ uTrackIndex,
  1115.  IHXValues* /*IN*/ pTrack);
  1116.     /* Temporary function */
  1117.     void SetInterrupt(BOOL bUseCoreThread) 
  1118.     {m_bUseCoreThread = bUseCoreThread;};
  1119.     virtual HX_RESULT SendPacket(CHXEvent* pEvent);
  1120.     CHXAudioPlayer* GetAudioPlayer(void) {return m_pAudioPlayer;};
  1121.     INT32 GetCurrentGroupID(void) {return m_nCurrentGroup;};
  1122.     void                NotifyPlaybackEndToTLC() {m_bIsPresentationClosedToBeSent = TRUE;};
  1123.     HX_RESULT CopyRegInfo(UINT32 ulFromRegID, UINT32 ulToRegID);
  1124.     BOOL                IsSitePresent(IHXSite* pSite);
  1125.     void CheckIfRendererNeedFocus(IUnknown* pRenderer);
  1126.     static void         PlayerCallback(void *pParam);
  1127.     static void SetupCallback(void *pParam);
  1128. #if defined(HELIX_FEATURE_AUTHENTICATION)
  1129.     static void         AuthenticationCallback(void *pParam);
  1130. #endif
  1131.     
  1132.     friend class SourceInfo;
  1133.     friend class HXSource;
  1134.     friend class HXNetSource;
  1135.     friend class HXFileSource;
  1136.     friend class HXPersistentComponent;
  1137.     friend class HXPersistentComponentManager;
  1138. private:
  1139.     HX_BITFIELD m_bForceStatsUpdate : 1;
  1140.     HX_BITFIELD m_bActiveRequest : 1;
  1141.     HX_BITFIELD m_bAddLayoutSiteGroupCalled : 1;
  1142.     HX_BITFIELD m_bDoRedirect : 1;
  1143.     HX_BITFIELD m_bFastStartCheckDone : 1;
  1144.     HX_BITFIELD m_bFastStart : 1;
  1145.     TurboPlayOffReason m_turboPlayOffReason;
  1146.     UINT32 m_ulActiveSureStreamSource;
  1147.     INT32 m_nCurrentGroup;
  1148.     INT32 m_nGroupCount;
  1149.     HX_RESULT DoOpenGroup(UINT16 nGroupNumber);
  1150.     HX_RESULT OpenTrack(IHXValues* pTrack, UINT16 uGroupID, UINT16 uTrackID);
  1151.     void PlayNextGroup();
  1152.     BOOL CheckTrackAndSourceOnTrackStarted(INT32 nGroup, INT32 nTrack, UINT32 sourceID);
  1153.     BOOL GetViewSourceStream(REF(IHXStreamSource*) pStrmSource);
  1154.     BOOL AreAllPacketsSent();
  1155.     HX_RESULT GetSourceInfo(UINT16 uGroupIndex, UINT16 uTrackIndex, SourceInfo*& pSourceInfo);
  1156.     HX_RESULT UpdateTrack(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues);
  1157.     HX_RESULT RemoveTrack(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues);
  1158.     HX_RESULT AddPrefetchTrack(UINT16 uGroupIndex, UINT16 uPrefetchTrackIndex, IHXValues* pValues);
  1159.     HX_RESULT UpdatePrefetchTrack(UINT16 uGroupIndex, UINT16 uPrefetchTrackIndex, IHXValues* pValues);
  1160.     HX_RESULT RemovePrefetchTrack(UINT16 uGroupIndex, UINT16 uPrefetchTrackIndex, IHXValues* pValues);
  1161.     HX_RESULT PrefetchTrackDone(UINT16 uGroupIndex, UINT16 uPrefetchTrackIndex, HX_RESULT status);
  1162.     HX_RESULT BeginTrack(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues);    
  1163.     HX_RESULT PauseTrack(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues);
  1164.     HX_RESULT SeekTrack(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues, UINT32 ulSeekTime);    
  1165.     HX_RESULT StopTrack(UINT16 uGroupIndex, UINT16 uTrackIndex, IHXValues* pValues);    
  1166.     HX_RESULT SetSoundLevel(UINT16 uGroupIndex, UINT16 uTrackIndex, UINT16 uSoundLevel, BOOL bReflushAudioDevice);    
  1167.     void                CheckSourceRegistration(void);
  1168.     void                GetTimingFromURL(CHXURL* pURL, UINT32& ulStart, UINT32& ulEnd, UINT32& ulDelay, UINT32& ulDuration);
  1169. #if defined(HELIX_FEATURE_RECORDCONTROL)
  1170.     BOOL                IsRecordServiceEnabled();
  1171. #endif
  1172. protected:
  1173.     CHXSimpleList* m_pAltURLs;
  1174.     CHXURL* m_pURL;
  1175.     IHXRequest* m_pRequest;
  1176.     HX_RESULT AdjustSeekOnRepeatedSource(SourceInfo* pSourceInfo, 
  1177.    UINT32 ulSeekTime);
  1178.     HX_RESULT  DoNetworkOpen(SourceInfo*& pSourceInfo, BOOL bAltURL);
  1179.     HX_RESULT  DoFileSystemOpen(SourceInfo*& pSourceInfo, BOOL bAltURL);
  1180.     HX_RESULT CreateSourceInfo(SourceInfo*& pSourceInfo, BOOL bAltURL);
  1181.     HX_RESULT PrepareSourceInfo(IHXValues* pTrack, SourceInfo*& pSourceInfo);
  1182.     HX_RESULT DoURLOpen(CHXURL* pURL, char* pMimeType);
  1183.     HX_RESULT DoAltURL(void);
  1184.     HX_RESULT DoAltURLOpen(char* pURL, BOOL bDefault, SourceInfo* pMainSourceInfo);
  1185.     HX_RESULT SpawnSourceIfNeeded(SourceInfo* pSourceInfo);
  1186.     HX_RESULT SwitchSourceIfNeeded(void);
  1187.     HX_RESULT DoRedirect(void);
  1188.     HX_RESULT OpenRedirect(const char* pszURL);
  1189.     HX_RESULT InitializeRenderers(void);
  1190.     HX_RESULT LayoutRenderers(void);
  1191.     virtual HX_RESULT ProcessIdleExt(void);
  1192.     void CreateDefaultRendererWindow
  1193.     (
  1194. RendererInfo*     pRInfo,
  1195. IHXRenderer*     pRend,
  1196. IHXBuffer*     pDisplayInfo,
  1197. const char*     pName
  1198.     );
  1199.     void CreateLayoutWindow
  1200.     (
  1201. IHXMetaLayout* pLayout
  1202.     );
  1203.     /************************************************************************
  1204.      * Method:
  1205.      * ExecuteCurrentEvents
  1206.      * Purpose:
  1207.      * Send any due packets to the renderers
  1208.      *
  1209.      */
  1210.     HX_RESULT ProcessCurrentEvents(void);
  1211.     /************************************************************************
  1212.      * Method:
  1213.      * DeleteAllEvents
  1214.      * Purpose:
  1215.      * Remove all pending events due to seek/stop.
  1216.      *
  1217.      */
  1218.     HX_RESULT DeleteAllEvents(void);
  1219.     HX_RESULT SendPreSeekEvents(void);
  1220.     void StopAllStreams(EndCode endCode = END_STOP);
  1221.     
  1222.     virtual HX_RESULT SendPreSeekEventsExt(void);         
  1223.     virtual HX_RESULT StopAllStreamsExt(EndCode endCode = END_STOP);
  1224.     
  1225.     virtual SourceInfo*     NewSourceInfo(void);
  1226.     virtual HXFileSource*  NewFileSource(void);
  1227.     virtual HXNetSource*   NewNetSource(void);
  1228.     virtual HX_RESULT     OpenTrackExt(void);
  1229.     void CloseAllRenderers(INT32 nGroupSwitchTo);
  1230.     HX_RESULT UnRegisterCurrentSources(void);
  1231.     HX_RESULT SetupAllStreams(void);
  1232.     void ResetPlayer(void);
  1233.     void ResetGroup(void);
  1234.     void SetMinimumPushdown(void);
  1235.     void SchedulePlayer(void);
  1236.     HX_RESULT CheckForAudioResume(void);
  1237.     HX_RESULT InitializeNetworkDrivers(void);
  1238.     inline void UpdateCurrentPlayTime( ULONG32 ulCurrentPlayTime );
  1239.     
  1240.     HX_RESULT ActualReport(
  1241.     const UINT8 unSeverity,  
  1242.     HX_RESULT ulHXCode,
  1243.     const ULONG32 ulUserCode,
  1244.     const char* pUserString,
  1245.     const char* pMoreInfoURL);
  1246.     IHXPendingStatus* m_pMetaSrcStatus;
  1247.     // list of sources
  1248.     CHXMapPtrToPtr* m_pSourceMap;
  1249.     CHXSimpleList* m_pPendingTrackList;
  1250.     // current time on the timeline for this player..
  1251.     // this would either be updated by the audio services of any rendering object
  1252.     // happens to be an audio renderer and decides to use our audio services...
  1253.     // ELSE it will be updated by a timer object... 
  1254.     ULONG32 m_ulCurrentPlayTime;
  1255.     
  1256. #if defined(_MACINTOSH) || defined(_MAC_UNIX)
  1257.     // this tracks the current timeline for this player, with the caveat
  1258.     // that it's only updated when the current play time is updated at
  1259.     // system time. This is useful for deciding whether to allocated "extra"
  1260.     // time to the player or giving it back to the system -- a pretty
  1261.     // complicated issue on MacOS 8.
  1262.     ULONG32 m_ulCurrentSystemPlayTime;
  1263. #endif
  1264.     
  1265.     // Length of all sources!
  1266.     ULONG32 m_ulPresentationDuration;
  1267.     // used to inform renderers the pre and post seek info..
  1268.     ULONG32 m_ulTimeBeforeSeek;
  1269.     ULONG32 m_ulTimeAfterSeek;
  1270.     BufferingReason m_BufferingReason;
  1271.     CHXEventList m_EventList; // contains packets for all streams
  1272.     IHXScheduler* m_pScheduler;
  1273.     /* m_uNumSourcesActive gets decremented when we have sucked out all the packets
  1274.      * from the source 
  1275.      */
  1276.     UINT16 m_uNumSourcesActive : 16;
  1277.     /* m_uNumCurrentSourceNotDone gets decremented when a given source has received
  1278.      * all the packets from the server
  1279.      */
  1280.     UINT16 m_uNumCurrentSourceNotDone : 16;
  1281.     HX_BITFIELD m_bSourceMapUpdated : 1;
  1282.     HX_BITFIELD m_bInitialized : 1;
  1283.        
  1284.     // m_bIsDone: single presentation/individual group in a SMIL file
  1285.     // m_bIsPresentationDone: single/SMIL presentation
  1286.     HX_BITFIELD m_bIsDone : 1;
  1287.     HX_BITFIELD m_bIsPresentationDone : 1;
  1288.     HX_BITFIELD m_bInStop : 1;
  1289.     HX_BITFIELD m_bIsPresentationClosedToBeSent : 1;
  1290.     HX_BITFIELD m_bCloseAllRenderersPending : 1;
  1291.     HX_BITFIELD m_bUseCoreThread : 1;
  1292.     HX_BITFIELD m_bCoreLocked : 1;
  1293.     HX_BITFIELD m_bPaused : 1;
  1294.     HX_BITFIELD m_bBeginPending : 1;
  1295.     HX_BITFIELD m_bIsFirstBeginPending : 1;
  1296.     HX_BITFIELD m_bIsFirstBegin : 1;
  1297.     HX_BITFIELD m_bUserHasCalledBegin : 1;
  1298.     HX_BITFIELD m_bTimelineToBeResumed : 1;
  1299.     HX_BITFIELD m_bIsPlaying : 1;
  1300.     HX_BITFIELD m_bNetInitialized : 1;
  1301.     HX_BITFIELD m_bPrefTransportInitialized : 1;
  1302.     HX_BITFIELD m_bSetupLayoutSiteGroup : 1;
  1303.     
  1304.     HX_BITFIELD m_bTimeSyncLocked : 1;
  1305.     HX_BITFIELD m_bIsLive : 1;
  1306.     HX_BITFIELD m_bLiveSeekToBeDone : 1;
  1307.     HX_BITFIELD m_bProcessEventsLocked : 1;
  1308.     HX_BITFIELD m_bDidWeDeleteAllEvents : 1;
  1309.     ULONG32 m_ulLowestGranularity;
  1310.     UINT32 m_ulElapsedPauseTime;
  1311.     UINT32 m_ulLiveSeekTime;
  1312.     UINT32 m_ulTimeOfPause;
  1313.     UINT32 m_ulMinimumAudioPreroll;
  1314.     UINT32 m_ulMinimumTotalPreroll;
  1315.     
  1316.     friend class HXPlayerCallback;
  1317. //#if defined(HELIX_FEATURE_STATS) && defined(HELIX_FEATURE_REGISTRY)
  1318.     friend class UpdateStatsCallback;
  1319. //#endif /* HELIX_FEATURE_STATS && HELIX_FEATURE_REGISTRY */
  1320.     /* Used for multiple kive stream synchrnoization*/
  1321.     UINT32 m_ulFirstTimeSync;
  1322.     UINT32 m_ulFSBufferingEndTime;
  1323.     UINT16 m_uNumSourceToBeInitializedBeforeBegin : 16;
  1324.     HX_BITFIELD m_bFastStartInProgress : 1;
  1325.     HX_BITFIELD m_bIsFirstTimeSync : 1;
  1326.     HX_BITFIELD m_bPlayerWithoutSources : 1;
  1327.     HX_BITFIELD m_bInternalPauseResume : 1;
  1328.     HX_BITFIELD m_bInternalReset : 1;
  1329.     HX_BITFIELD m_bCurrentPresentationClosed : 1;
  1330.     HX_BITFIELD m_bContactingDone : 1;
  1331.     HX_BITFIELD m_bFSBufferingEnd : 1;
  1332.     HX_BITFIELD m_bAllLocalSources : 1;
  1333.     HX_BITFIELD m_b100BufferingToBeSent : 1;
  1334.     HX_BITFIELD m_bSetupToBeDone : 1;
  1335.     HX_BITFIELD m_bPostSetupToBeDone : 1;
  1336.     HX_BITFIELD m_bInternalReportError : 1;
  1337.     HX_BITFIELD m_bPartOfNextGroup : 1;   
  1338.     HX_BITFIELD m_bLastGroup : 1;
  1339.     HX_BITFIELD m_bNextGroupStarted : 1;
  1340.     HX_BITFIELD m_bBeginChangeLayoutTobeCalled : 1;
  1341.     HX_BITFIELD m_bPendingAudioPause : 1;
  1342.     HX_BITFIELD m_bPlayStateNotified : 1;
  1343.     HX_BITFIELD m_bResumeOnlyAtSystemTime : 1;
  1344.     HX_BITFIELD m_bSetModal : 1;
  1345. #if defined(HELIX_FEATURE_PREFETCH)
  1346.     PrefetchManager* m_pPrefetchManager;
  1347. #else
  1348.     void* m_pPrefetchManager;
  1349. #endif /* HELIX_FEATURE_PREFETCH */
  1350. #ifdef _WIN32
  1351.     BOOL m_bScreenSaverActive; 
  1352. #endif
  1353. #if defined(HELIX_FEATURE_NEXTGROUPMGR)
  1354.     NextGroupManager* m_pNextGroupManager;
  1355. #else
  1356.     void* m_pNextGroupManager;
  1357. #endif /* HELIX_FEATURE_NEXTGROUPMGR*/
  1358.     IHXGroup* m_pCurrentGroup;
  1359.     IHXPlayer* m_pParentPlayer;
  1360.     CHXSimpleList* m_pChildPlayerList;
  1361. #if defined(HELIX_FEATURE_ASM)
  1362.     IHXBandwidthManager* m_pBandwidthMgr;
  1363.     /* Only used for load testing */
  1364.     IHXBandwidthManager* m_pASM;
  1365. #endif /* HELIX_FEATURE_ASM */
  1366.     CHXSimpleList m_ToBeginRendererList;
  1367.     void EnterToBeginList(RendererInfo* pRendInfo);
  1368.     void EmptyBeginList(void) {m_ToBeginRendererList.RemoveAll();};
  1369.     HX_RESULT CheckBeginList(void);
  1370.     void RemoveFromPendingList(RendererInfo* pRendInfo);
  1371.     void CheckToStartNextGroup(void);
  1372.     void AdjustPresentationTime(void);
  1373.     void SetPresentationTime(UINT32 ulPresentationTime);
  1374.     void UpdateSourceActive(void);
  1375.     HX_RESULT UpdateSourceInfo(SourceInfo* pSourceInfo, 
  1376.  UINT32 ulParentRegId,
  1377.  UINT16 ulTrackIndex);
  1378.     HX_RESULT UpdatePersistentSrcInfo(SourceInfo* pSourceInfo, 
  1379.                                                 UINT32 ulParentRegId,
  1380.                                                 UINT16 ulTrackIndex);
  1381.     /*
  1382.      * The following members are related to the new layout support.
  1383.      */
  1384. #if defined(HELIX_FEATURE_VIDEO)
  1385.     CHXSiteManager* m_pSiteManager;
  1386.     IHXSiteSupplier* m_pSiteSupplier;
  1387. #else
  1388.     void* m_pSiteManager;
  1389.     void* m_pSiteSupplier;
  1390. #endif /* HELIX_FEATURE_VIDEO */
  1391.     CHXSimpleList m_SiteRequestIDList;
  1392.     
  1393.     void SetupRendererSite(IUnknown* pRenderer, IHXValues* pProps, BOOL bIsPersistent);
  1394.     void SetupLayoutSiteGroup(IUnknown* pLSG, BOOL bIsPersistent);
  1395.     STDMETHODIMP SetupLayout(BOOL bIsPersistent);
  1396.     STDMETHODIMP CleanupLayout(void);
  1397.     HX_RESULT StartDownload(void);
  1398.     HX_RESULT PauseDownload(void);
  1399.     void UnregisterNonActiveSources();
  1400.     BOOL AreAllSourcesSeekable(void);
  1401.     void ResetError(void);
  1402.     void ResetRedirectList(void);
  1403.     void SetLastError(HX_RESULT theErr);
  1404.     void Close();
  1405.     void AbortPlayer(void);
  1406.     void StopPlayer(EndCode endCode = END_STOP);
  1407.     HX_RESULT PausePlayer(BOOL bNotifyTLC = TRUE);
  1408.     HX_RESULT SeekPlayer(ULONG32 ulTime);
  1409.     HX_RESULT BeginPlayer(void);
  1410.     HX_RESULT SetupAudioPlayer(void);
  1411.     virtual HX_RESULT PrepareAudioPlayer(void);
  1412. //#if defined(HELIX_FEATURE_AUTHENTICATION)
  1413.     void ProcessPendingAuthentication();
  1414.     void ClearPendingAuthenticationRequests();
  1415. //#endif /* HELIX_FEATURE_AUTHENTICATION */
  1416.     void SendPostSeekIfNecessary(RendererInfo* pRendererInfo);
  1417.     BOOL ScheduleOnTimeSync(void);
  1418.     BOOL DurationTimeSyncAllSent(SourceInfo* pSourceInfo);
  1419.     virtual void DisableScreenSaver();
  1420.     void                RemovePendingCallback(CHXGenericCallback* pCB);
  1421. #if defined(HELIX_FEATURE_AUTOUPGRADE)
  1422.     IHXUpgradeCollection* m_pUpgradeCollection;
  1423. #else
  1424.     void* m_pUpgradeCollection;
  1425. #endif /* HELIX_FEATURE_AUTOUPGRADE */
  1426.     friend class NextGroupManager;
  1427. //#if defined(HELIX_FEATURE_PREFETCH)
  1428.     friend class PrefetchManager;
  1429. //#endif /* HELIX_FEATURE_PREFETCH */
  1430.     
  1431.     // used to notify of changes to the precache group
  1432. #if defined(HELIX_FEATURE_ADVANCEDGROUPMGR)
  1433.     friend class HXAdvancedGroup;    
  1434.     friend class HXAdvancedGroupManager;    
  1435. #endif /* HELIX_FEATURE_ADVANCEDGROUPMGR */
  1436. #if defined(HELIX_FEATURE_BASICGROUPMGR)
  1437.     friend class HXBasicGroup;
  1438.     friend class HXBasicGroupManager;
  1439. #endif /* HELIX_FEATURE_BASICGROUPMGR */
  1440.     HX_RESULT NextGroupSet(UINT16 uGroupIndex);
  1441. //#if defined(HELIX_FEATURE_AUTHENTICATION)
  1442. #ifndef _WIN16
  1443.     // Store pending requests
  1444.     friend class _CHXAuthenticationRequests;
  1445.     _CHXAuthenticationRequests m_AuthenticationRequestsPending;
  1446. #endif /* _WIN16 */
  1447. //#endif /* HELIX_FEATURE_AUTHENTICATION */
  1448.     HXMutex* m_pCoreMutex;
  1449.     /*
  1450.      * -- LIVE SYNC SUPPORT --
  1451.      *
  1452.      * The following is related to shared wall clock support
  1453.      * for syncronizing several live sources. See srcinfo.cpp
  1454.      * for more informantion.
  1455.      */
  1456. private:
  1457.     CHXMapStringToOb* m_pSharedWallClocks;
  1458.     friend class SharedWallClock;
  1459.     IHXRecordService* m_pRecordService;
  1460.     BOOL                m_bRecordServiceEnabled;
  1461. public:
  1462.     BOOL FindSharedWallClocks(const char* pClockName, void*& ppValue)
  1463.     {
  1464. return m_pSharedWallClocks->Lookup(pClockName,ppValue);
  1465.     };
  1466. };
  1467. #if defined(HELIX_FEATURE_STATS) && defined(HELIX_FEATURE_REGISTRY)
  1468. class UpdateStatsCallback : public IHXCallback
  1469. {
  1470. public:
  1471.     HXPlayer* m_pPlayer;
  1472.     CallbackHandle m_PendingHandle;
  1473.     BOOL m_bIsCallbackPending;
  1474. UpdateStatsCallback();
  1475.     /*
  1476.      * IUnknown methods
  1477.      */
  1478.     STDMETHOD(QueryInterface) (THIS_
  1479.     REFIID riid,
  1480.     void** ppvObj);
  1481.     STDMETHOD_(ULONG32,AddRef) (THIS);
  1482.     STDMETHOD_(ULONG32,Release) (THIS);
  1483.     /*
  1484.      * IHXCallback methods
  1485.      */
  1486.     STDMETHOD(Func) (THIS);
  1487. protected:
  1488. ~UpdateStatsCallback();
  1489.     LONG32 m_lRefCount;
  1490. };
  1491. #endif /* HELIX_FEATURE_STATS && HELIX_FEATURE_REGISTRY */
  1492. #if defined (_WIN32) || defined (_MACINTOSH) || defined(THREADS_SUPPORTED)
  1493. class HXPlayerCallback : public CHXGenericCallback
  1494.                        , public IHXInterruptSafe
  1495. {
  1496. public:    
  1497.     BOOL m_bInterrupSafe;
  1498.     HXPlayerCallback(void* pParam, fGenericCBFunc pFunc);
  1499.     
  1500.     STDMETHOD_(ULONG32,AddRef) (THIS) {return CHXGenericCallback::AddRef();}
  1501.     STDMETHOD_(ULONG32,Release) (THIS) {return CHXGenericCallback::Release();}
  1502.     STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj);
  1503.     STDMETHOD_(BOOL,IsInterruptSafe) (THIS);
  1504. protected:
  1505.     ~HXPlayerCallback() {};
  1506. };
  1507. #endif //(_WIN32) || defined (_MACINTOSH) || defined(THREADS_SUPPORTED)
  1508. #endif //_HXPLAYER_