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

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