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

Symbian

开发平台:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: hxaudses.h,v 1.11.2.1.2.1 2004/12/13 23:12:45 gwright 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 _HXAUDSES_H
  50. #define _HXAUDSES_H
  51. #include "hxaudtyp.h" 
  52. #ifdef _UNIX
  53. #include <fcntl.h>
  54. #include <sys/stat.h>
  55. #endif
  56. //  IHXTimelineWatcher defines.
  57. #  define TLW_PAUSE    1
  58. #  define TLW_RESUME   2
  59. #  define TLW_CLOSE    3
  60. #  define TLW_TIMESYNC 4
  61. // foward decls.
  62. struct IHXCallback;
  63. struct IHXScheduler;
  64. struct IHXPreferences;
  65. struct IHXAudioDeviceResponse;
  66. struct IHXAudioPlayerResponse;
  67. struct IHXAudioAdviseSink;
  68. struct IHXAudioDeviceManager;
  69. struct IHXAudioHook;
  70. struct IHXInterruptState;
  71. typedef struct _HXAudioFormat HXAudioFormat;
  72. class CHXAudioPlayer;
  73. class CHXAudioDevice;
  74. class CHXAudioStream;
  75. class CHXSimpleList;
  76. class HXVolumeAdviseSink;
  77. struct IHXBuffer;
  78. class Timeval;
  79. class HXThread;
  80. class HXMutex;
  81. class HXEvent;
  82. #ifdef HELIX_CONFIG_MIN_PCM_PUSHDOWN_BYTES
  83. #define MINIMUM_INITIAL_PUSHDOWN    100
  84. #else
  85. #define MINIMUM_INITIAL_PUSHDOWN    4000
  86. #endif
  87. typedef enum
  88. {
  89.     BUFFER_NONE     = 0,
  90.     BUFFER_PLAYER   = 1,
  91.     BUFFER_SESSION  = 2
  92. } BufType;
  93. class   CHXAudioSession : public IHXAudioDeviceResponse, 
  94.                           public IHXAudioDeviceManager,
  95.                           public IHXAudioHookManager,
  96.                           public IHXAudioDeviceManager2,
  97. #ifdef HELIX_FEATURE_VOLUME                          
  98.                           public IHXVolumeAdviseSink,
  99. #endif                          
  100.                           public IHXCallback,
  101.                           public IHXAudioResamplerManager,
  102. #if defined(HELIX_FEATURE_TIMELINE_WATCHER)
  103.                           public IHXTimelineManager,
  104. #endif
  105.                           public IHXAudioPushdown2
  106. {
  107.   public:
  108.     /*
  109.      *      IUnknown methods
  110.      */
  111.     STDMETHOD(QueryInterface)   (THIS_
  112.                                  REFIID riid,
  113.                                  void** ppvObj);
  114.     STDMETHOD_(ULONG32,AddRef)  (THIS);
  115.     STDMETHOD_(ULONG32,Release) (THIS);
  116.     CHXAudioSession(void);
  117. #if defined(HELIX_FEATURE_TIMELINE_WATCHER)    
  118.     //IHXTimelineManager methods...
  119.     STDMETHOD(AddTimelineWatcher)    (THIS_ IHXTimelineWatcher* );
  120.     STDMETHOD(RemoveTimelineWatcher) (THIS_ IHXTimelineWatcher* );
  121. #endif
  122. #ifdef HELIX_FEATURE_VOLUME                          
  123.     //IHXVolumeAdviseSink methods
  124.     inline STDMETHOD(OnVolumeChange) (THIS_ const UINT16 uVolume )
  125.     {
  126.         SetVolume(uVolume);
  127.         return HXR_OK;
  128.     }
  129.     inline STDMETHOD(OnMuteChange)(THIS_ const BOOL bMute )
  130.     {
  131.         SetMute(bMute);
  132.         return HXR_OK;
  133.     }
  134. #endif
  135.     
  136.     /*
  137.      *      IHXAudioDeviceManager methods
  138.      */
  139.     /************************************************************************
  140.      *  Method:
  141.      *      IHXAudioDeviceManager::Replace
  142.      *  Purpose:
  143.      *  This is used to replace the default implementation of the audio
  144.      *  device by the given audio device interface. 
  145.      */
  146.     STDMETHOD(Replace) (THIS_
  147.                         IHXAudioDevice*    /*IN*/ pAudioDevice);
  148.     /************************************************************************
  149.      *  Method:
  150.      *      IHXAudioDeviceManager::Remove
  151.      *  Purpose:
  152.      *  This is used to remove the audio device given to the manager in
  153.      *  the earlier call to Replace.
  154.      */
  155.     STDMETHOD(Remove) (THIS_
  156.                        IHXAudioDevice*    /*IN*/ pAudioDevice);
  157.     /************************************************************************
  158.      *  Method:
  159.      *   IHXAudioDeviceManager::AddFinalHook
  160.      *  Purpose:
  161.      *       One last chance to modify data being written to the audio device.
  162.      *       This hook allows the user to change the audio format that
  163.      *   is to be written to the audio device. This can be done in call
  164.      *   to OnInit() in IHXAudioHook.
  165.      */
  166.     STDMETHOD(SetFinalHook) (THIS_
  167.                              IHXAudioHook*      /*IN*/ pHook
  168.                              );
  169.     /************************************************************************
  170.      *  Method:
  171.      *   IHXAudioDeviceManager::RemoveFinalHook
  172.      *  Purpose:
  173.      *       Remove final hook
  174.      */
  175.     STDMETHOD(RemoveFinalHook)  (THIS_
  176.                                  IHXAudioHook*    /*IN*/ pHook
  177.                                  );
  178.     /************************************************************************
  179.      *  Method:
  180.      *      IHXAudioDeviceManager::GetAudioFormat
  181.      *  Purpose:
  182.      *           Returns the audio format in which the audio device is opened.
  183.      *           This function will fill in the pre-allocated HXAudioFormat 
  184.      *           structure passed in.
  185.      */
  186.     STDMETHOD(GetAudioFormat)   (THIS_
  187.                                  HXAudioFormat*      /*IN/OUT*/pAudioFormat);
  188.     /*
  189.      *      IHXAudioDeviceResponse methods
  190.      */
  191.     /************************************************************************
  192.      *  Method:
  193.      *      IHXAudioDeviceResponse::OnTimeSync
  194.      *  Purpose:
  195.      *      Notification interface provided by users of the IHXAudioDevice
  196.      *      interface. This method is called by the IHXAudioDevice when
  197.      *      audio playback occurs.
  198.      */
  199.     STDMETHOD(OnTimeSync) (THIS_
  200.                            ULONG32                         /*IN*/ ulTimeEnd);
  201.     /*
  202.      *  IHXAudioHookManager methods
  203.      */
  204.     /************************************************************************
  205.      *  Method:
  206.      *      IHXAudioHookManager::AddHook
  207.      *  Purpose:
  208.      *           Use this to add a hook 
  209.      */
  210.     STDMETHOD(AddHook)   (THIS_
  211.                           IHXAudioHook* /*IN*/ pHook);
  212.     /************************************************************************
  213.      *  Method:
  214.      *      IHXAudioHookManager::RemoveHook
  215.      *  Purpose:
  216.      *           Use this to remove a hook 
  217.      */
  218.     STDMETHOD(RemoveHook) (THIS_
  219.                            IHXAudioHook* /*IN*/ pHook);
  220.     /*
  221.      *  IHXAudioDeviceManager2 methods
  222.      */
  223.     /**********************************************************************
  224.      *  Method:
  225.      *      IHXAudioDeviceManager2::IsReplacedDevice
  226.      *  Purpose:
  227.      *  This is used to determine if the audio device has been replaced.
  228.      */
  229.     STDMETHOD_(BOOL, IsReplacedDevice) (THIS);
  230.     /*
  231.      *  IHXAudioResamplerManager methods
  232.      *
  233.      */
  234.     STDMETHOD(CreateResampler) (THIS_
  235.                                 HXAudioFormat               inAudioFormat,
  236.                                 REF(HXAudioFormat)          outAudioFormat,
  237.                                 REF(IHXAudioResampler*)    pResampler);
  238.     /*
  239.      *  IHXAudioPushdown methods
  240.      */
  241.     /************************************************************************
  242.      *  Method:
  243.      *      IHXAudioPushdown::SetAudioPushdown
  244.      *  Purpose:
  245.      *           Use this to set the minimum audio pushdown value in ms.
  246.      *           This is the amount of audio data that is being written 
  247.      *           to the audio device before starting playback.
  248.      */
  249.     STDMETHOD(SetAudioPushdown) (THIS_
  250.                                  UINT32 /*IN*/ ulMinimumPushdown);
  251.     /************************************************************************
  252.      *  Method:
  253.      *      IHXAudioPushdown2::GetAudioPushdown
  254.      *  Purpose:
  255.      *           Use this to get the minimum audio pushdown value in ms.
  256.      *           This is the amount of audio data that is being written 
  257.      *           to the audio device before starting playback.
  258.      */
  259.     STDMETHOD(GetAudioPushdown) (THIS_
  260.                                  REF(UINT32) /*OUT*/ ulAudioPushdown);
  261.     /************************************************************************
  262.      *  Method:
  263.      *      IHXAudioPushdown2::GetCurrentAudioDevicePushdown
  264.      *  Purpose:
  265.      *           Use this to get the audio pushed down to the audio device and haven't
  266.      *           been played yet
  267.      */
  268.     STDMETHOD(GetCurrentAudioDevicePushdown)   (THIS_
  269.                                                 REF(UINT32) /*OUT*/ ulAudioPusheddown);
  270.     /* It gets Scheduler interface from the context.
  271.      * The session object keeps a list of audio player objects.
  272.      * Create a session list; add this session to the list.
  273.      */
  274.     HX_RESULT Init(IUnknown* pContext);
  275.     /* Setup is called by Audio Player object.
  276.      */
  277.     HX_RESULT Setup (BOOL bHasStreams);
  278.     /* Create audio player. The RMA session object calls this
  279.      * for each Player it knows about.
  280.      */
  281.     virtual HX_RESULT CreateAudioPlayer(CHXAudioPlayer**  ppAudioPlayer);
  282.     HX_RESULT         _CreateAudioPlayer(CHXAudioPlayer** ppAudioPlayer);
  283.     HX_RESULT       CloseAudioPlayer( CHXAudioPlayer*   pAudioPlayer);
  284.     void            Close(void);
  285.     /* The session object determines the audio device format based
  286.      * on all of its players.
  287.      */
  288.     HX_RESULT       GetDeviceFormat(void);
  289.     /* Open is called to open the audio device.
  290.      */
  291.     HX_RESULT       OpenAudio    (void);
  292.     HX_RESULT       OpenDevice   (void);
  293.         
  294.     /* PlayAudio is called by Audio Player object.
  295.      */
  296.     HX_RESULT       PlayAudio    (UINT16 uNumBlocks = 1);
  297.     /* Pause is called by Audio Player object.
  298.      */
  299.     HX_RESULT       Pause (CHXAudioPlayer* p);
  300.     /* Resume is called by Audio Player object.
  301.      */
  302.     HX_RESULT       Resume (CHXAudioPlayer* pPlayer = NULL);
  303.     /* Stop is called by Audio Player object.
  304.      */
  305.     HX_RESULT       Stop  (CHXAudioPlayer* p, BOOL bFlush);
  306.     /* Seek is called by Audio Player object.
  307.      */
  308.     HX_RESULT       Seek    (
  309.         CHXAudioPlayer* pPlayerToExclude, 
  310.         const UINT32    ulSeekTime
  311.         );
  312.     /* Return the device volume interface */
  313.     inline IHXVolume* GetDeviceVolume()
  314.     {
  315. #if defined(HELIX_FEATURE_VOLUME)
  316.         if( m_pDeviceVolume )
  317.             m_pDeviceVolume->AddRef();
  318.         return m_pDeviceVolume;
  319. #else
  320.         return NULL;
  321. #endif /* HELIX_FEATURE_VOLUME */
  322.     }
  323.     /* The player object sets the granularity; I think the RMA session
  324.      * object should do this after it resolves the granularity amongst
  325.      * all of its players.
  326.      */
  327.     /* Granularity is always 100ms now...
  328.      * The core keeps track of the granularity requirements for each 
  329.      * renderer and queries audio sesssion. 
  330.      */
  331.     ULONG32         SetGranularity(ULONG32 ulGranularity);
  332.     /* Reset audio session; flush buffers, etc.
  333.      */
  334.     virtual void        ResetSession(void);
  335.     virtual HX_RESULT   ProcessAudioHook(PROCESS_ACTION action, 
  336.                                          IHXAudioHook* pAudioHook);
  337.     virtual HX_RESULT   ProcessAudioDevice(PROCESS_ACTION action, 
  338.                                            IHXAudioDevice* pAudioDevice);
  339.     virtual HX_RESULT   CreateAudioDevice();
  340.     void                ReleaseAudioDevice();
  341.     void                RestoreReplacedDevice();
  342.     ULONG32         GetCurrentPlayBackTime(void);
  343.     /* Get format that audio device was opened with. */
  344.     void GetFormat( HXAudioFormat*       pAudioFmt );
  345.     /* Return the core scheduler interface.
  346.      */
  347.     inline void GetScheduler(IHXScheduler** pScheduler)
  348.     {
  349.         *pScheduler = m_pScheduler;
  350.     };
  351.     void SetVolume(const UINT16 uVolume );
  352.     UINT16 GetVolume();
  353.     void SetMute(const BOOL bMute);
  354.     inline BOOL GetMute()
  355.     {
  356.         return m_bMute;
  357.     }
  358.     
  359.     /* Return the current time in timeline. */
  360.     //ULONG32       GetCurrentPlaybackTime(void);
  361.     /* Returns true if any audio player is playing... */
  362.     BOOL            IsPlaying(void);
  363.     /* Returns number of active players (which are not is a STOP state).*/
  364.     UINT16          NumberOfActivePlayers(void);
  365.     UINT16          NumberOfResumedPlayers(void);
  366.     inline void     ToBeRewound() {m_bToBeRewound = TRUE;};
  367.     BOOL            CheckDisableWrite(void);
  368.     ULONG32         GetInitialPushdown(BOOL bAtStart = FALSE);
  369.     HX_RESULT       CheckToPlayMoreAudio();
  370.     HX_RESULT       TryOpenAudio    (void); // attempt to open audio
  371.         
  372.     void            StopAllOtherPlayers();
  373.     inline HX_RESULT     CheckForBufferReuse();
  374.     void            ConvertTo8BitAndOrMono(HXAudioData* pAudioData);
  375.     
  376.     double          ConvertMsToBytes(UINT32 ulCurrentTime);
  377.     inline double          NumberOfBytesWritten() {return m_dNumBytesWritten;};
  378.     inline double          GetNumBytesPlayed() {return m_dNumBytesPlayed;};
  379.     void            SetCoreMutex(HXMutex* pMutex) {m_pCoreMutex = pMutex;};
  380.     void            CheckIfLastNMilliSecsToBeStored();
  381.     void            RewindSession(CHXAudioPlayer* pPlayerToExclude = NULL);
  382.     void            RewindAllPlayers(UINT32 ulCurTime,
  383.                                      UINT32 ulTimeToRewind,
  384.                                      CHXAudioPlayer* pPlayerToExclude);
  385.     HX_RESULT       ActualResume();
  386.     inline UINT32   GetLastRewindTimestamp(void) {return m_ulLastRewindTimestamp;};
  387.     BOOL            ReallyNeedData();
  388.     inline void     UseCoreThread() {m_bShouldOpenOnCoreThread = TRUE;};
  389.     inline void     PostMixHooksUpdated(void) { m_bPostMixHooksUpdated = TRUE; };
  390.     BOOL GetDisableMultiPlayPauseSupport();
  391.     //IHXCallback stuff
  392.     STDMETHOD(Func) (THIS);
  393.     IUnknown*                       m_pContext;
  394.     class HXDeviceSetupCallback :
  395.         public IHXCallback,
  396.         public IHXInterruptSafe
  397.     {
  398.     private:
  399.         ~HXDeviceSetupCallback();
  400.         PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  401.         
  402.         CHXAudioSession* m_pAudioSessionObject;
  403.         ULONG32          m_ulCallbackID;
  404.         LONG32           m_lRefCount;
  405.     public:
  406.         HXDeviceSetupCallback(CHXAudioSession* it);
  407.         STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj);
  408.         STDMETHOD_(ULONG32,AddRef) (THIS);
  409.         STDMETHOD_(ULONG32,Release) (THIS);
  410.         STDMETHOD(Func) (THIS);
  411.         STDMETHOD_(BOOL,IsInterruptSafe) (THIS);
  412.         void PendingID(ULONG32 it )
  413.             { m_ulCallbackID = it;}
  414.         ULONG32 PendingID()
  415.             { return m_ulCallbackID; }
  416.         
  417.     };
  418.     friend class CHXAudioSession::HXDeviceSetupCallback;
  419.   protected:
  420.     ~CHXAudioSession(void);
  421.     PRIVATE_DESTRUCTORS_ARE_NOT_A_CRIME
  422.     void _ConstructIfNeeded();
  423.     
  424.         private:
  425. #ifdef _MACINTOSH
  426.     static  BOOL                                    zm_Locked;
  427. #endif
  428.     LONG32                          m_lRefCount;
  429.     IHXScheduler*                   m_pScheduler;
  430.     IHXPreferences*         m_pPreferences;
  431.     IHXInterruptState*              m_pInterruptState;
  432.     HXAudioFormat                  m_BeforeHookDeviceFmt;       // Actual Audio device format.
  433.     HXAudioFormat                  m_ActualDeviceFmt;       // Actual Audio device format.
  434.     HXAudioFormat                  m_DeviceFmt;            // Audio device format used for all calculations.
  435.     IHXBuffer*                      m_pPlayerBuf;
  436.     IHXBuffer*                      m_pSessionBuf;
  437.     ULONG32                         m_ulGranularity;         // Amount of audio to push (ms).
  438.     double                          m_dGranularity;
  439.     ULONG32                         m_ulMinimumPushdown;
  440.     ULONG32                         m_ulIdealMinimumPushdown;
  441.     ULONG32                         m_ulMinBlocksTobeQueued;
  442.     ULONG32                         m_ulMinBlocksTobeQueuedAtStart;
  443.     ULONG32                         m_ulBytesPerGran;       // Number of bytes in gran
  444.     ULONG32                         m_ulBlocksWritten;      // Number of blocks written so far
  445.     ULONG32 m_ulCallbackID;
  446.     BOOL    m_bFakeAudioTimeline;
  447.     
  448.     BOOL                            m_bShouldOpenOnCoreThread;
  449.     BOOL                            m_bToBeReOpened;
  450.     HXDeviceSetupCallback*          m_pDeviceCallback;
  451.     BOOL                            m_bHasStreams;          // True if there are audio streams
  452.     /* We keep a track of the current time when we use Scheduler for 
  453.      * genertaing time syncs.
  454.      */
  455.     ULONG32                         m_ulIncreasingTimer;
  456.     /* This is the actual time we report back to the player->renderers
  457.      * It gets set in the OnTimeSync
  458.      */
  459.     ULONG32                         m_ulCurrentTime;
  460.     ULONG32                         m_ulLastAudioTime;
  461.     ULONG32                         m_ulLastAudioReturnTime;
  462.     ULONG32                         m_ulLastSystemTime;
  463.     BOOL                            m_bAtLeastOneTimeReceived;
  464.     ULONG32                         m_ulStartTime;
  465.     BOOL                            m_bTimeSyncReceived;
  466.     BOOL                            m_bPaused;
  467.     BOOL                            m_bStoppedDuringPause;
  468.     ULONG32                         m_ulLastFakeCallbackTime;
  469.     Timeval*                        m_pFakeAudioCBTime;
  470.     HXAudioData*                    m_pInDataPtr;
  471.     HXAudioData*                    m_pOutDataPtr;
  472.     /*
  473.      * Should be in a data structure with the player objects and stuffed
  474.      * on the list.
  475.      */
  476.     IHXAudioPlayerResponse*         m_pPlayerResponse; // Notification interface
  477.     BOOL                            m_bFirstPlayAudio;
  478.     UINT16                          m_uVolume;              // Default volume
  479.     BOOL                            m_bMute;                // the mute state
  480.     BOOL                            m_bAudioDeviceSupportsVolume;
  481.     /*
  482.      * Continuous session play back time. This is the time written to the audio
  483.      * device object for each buffer. This is the time that each audio player 
  484.      * retrieves as its start time.
  485.      */
  486.     double                          m_dBufEndTime;
  487.     BOOL                            m_bDisableWrite;
  488.     BOOL                            m_bInPlayAudio;
  489.     BOOL                            m_bInActualResume;
  490.     double                          m_dNumBytesWritten;
  491.     double                          m_dNumBytesPlayed;
  492.     /* CheckAudioFormat Interface is called by audio player to 
  493.      * check resample audio format with audio device format.
  494.      */
  495.     HX_RESULT               CheckAudioFormat( 
  496.         HXAudioFormat* pAudioFormat );
  497.     /* Create the playback buffer.
  498.      */
  499.     HX_RESULT               CreatePlaybackBuffer(void);
  500.     void                    OnTimerCallback();
  501.     inline void CheckAudioVolume()
  502.     {}
  503.     
  504.     /* Write audio data to post mix hooks. */
  505.     HX_RESULT               ProcessPostMixHooks(
  506.         CHXAudioPlayer* pPlayer,
  507.         IHXBuffer*&    pInBuffer,
  508.         BOOL*           bDisableWrite,
  509.         UINT32          ulBufTime,
  510.         BOOL&           bChanged);
  511.         
  512.     void                    InitHooks();
  513.     void                    ProcessHooks(HXAudioData* pAudioData);
  514.     /* Convert 16-bit buffer to 8-bit */
  515.     void                    ConvertToEight(void);
  516.     BOOL                    IsAudioOnlyTrue(void);
  517.         
  518.     UINT32                  AnchorDeviceTime(UINT32 ulCurTime);
  519.     void                    AdjustInRealTime();
  520.     HX_RESULT               Rewind();
  521.     void                    UpdateMinimumPushdown();
  522.     void                    ReopenDevice();
  523.     
  524.   protected:
  525.     BOOL                m_bInited;          // is audio setup?
  526.     IHXAudioDevice*    m_pAudioDev; // device layer
  527.     IHXAudioDevice*    m_pCurrentAudioDev;  // keep track of the current device layer
  528.     IHXAudioDevice*    m_pReplacedAudioDev; // keep track of replaced audio device
  529.     BOOL                m_bReplacedDev;     // is audio device replaced?
  530.     CHXSimpleList*      m_pPlayerList;      // list of player audio sessions
  531.     CHXSimpleList*      m_pHookList;        // hook list
  532.     // Any audio buffers that we were not able to write to the audio 
  533.     // device successfully
  534.     CHXSimpleList*      m_pAuxiliaryAudioBuffers;
  535.     HXMutex*            m_pMutex;
  536.     IHXAudioHook*       m_pFinalHook;
  537.     BOOL                m_bUseFinalHook;
  538.     HXMutex*            m_pCoreMutex;
  539.     UINT16              m_uAskFromAudioDevice;
  540.     BOOL                m_bDeferActualResume;
  541.     CHXAudioPlayer*     m_pLastPausedPlayer;
  542.     BOOL                m_bUsingReplacedDevice;
  543.     BOOL                m_bToBeRewound;
  544.     UINT32              m_ulLastRewindTimestamp;
  545.     UINT16              m_uNumToBePushed;
  546.     BOOL                m_bSessionBufferDirty;
  547.     BOOL                m_bPostMixHooksUpdated;
  548.     IHXMultiPlayPauseSupport* m_pMPPSupport;
  549. #if defined(HELIX_FEATURE_TIMELINE_WATCHER)
  550.     //IHXTimelineManager support.
  551.     CHXSimpleList*      m_pTimeLineWatchers;
  552.     void _NotifyTimelineWatchers( const int nWhich, const UINT32 ulNow=0 );
  553. #else
  554.     inline void _NotifyTimelineWatchers(const int nWhich, const UINT32 ulNow=0 ) {};
  555. #endif    
  556. #ifdef HELIX_FEATURE_VOLUME
  557.     IHXVolume*          m_pDeviceVolume;
  558. #endif    
  559. };
  560. #endif  // _HXAUDSES_H