hxaudevds.h
Upload User: dangjiwu
Upload Date: 2013-07-19
Package Size: 42019k
Code Size: 5k
Category:

Symbian

Development Platform:

Visual C++

  1. /* ***** BEGIN LICENSE BLOCK *****
  2.  * Source last modified: $Id: hxaudevds.h,v 1.6.2.1 2004/07/09 02:02:06 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 _NEWRMAUDEVDS_H_
  50. #define _NEWRMAUDEVDS_H_
  51. #include "dsound.h"
  52. #include "ks.h"
  53. #include "ksmedia.h"
  54. #include "tsconvrt.h"
  55. class CHXAudioSession;
  56. class CHXAudioDevice;
  57. typedef struct _HXAudioFormat HXAudioFormat;
  58. typedef struct _HXAudioData HXAudioData;
  59. /****************************************************************************
  60.  *
  61.  *  Class:
  62.  *
  63.  *      CHXAudioDeviceDS
  64.  *
  65.  *  Purpose:
  66.  *
  67.  *      PN implementation of audio device object.
  68.  *
  69.  */
  70. class CHXAudioDeviceDS: public CHXAudioDevice
  71. {
  72. private:
  73.     IDirectSound* m_pDSDev;
  74.     IDirectSoundBuffer *m_pPrimaryBuffer, *m_pSecondaryBuffer ;
  75.     DWORD defaultChannelMapping(UINT32 ulChannels) const ;
  76. protected:
  77. WAVEFORMATEXTENSIBLE m_WaveFormat;
  78. UINT32 m_ulLastPlayCursor;
  79. UINT32 m_ulLastWriteCursor;
  80. UINT32 m_ulCurrPlayTime;
  81. UINT32 m_ulCurrLoopTime;
  82. UINT32 m_ulTotalBuffer;
  83. HWND m_hwnd;
  84. void* m_pAudioPtrStart;
  85. UINT32 m_ulLoops;
  86. double m_ulLoopTime;
  87. int m_nBlocksPerBuffer;
  88. HINSTANCE m_hSoundDll;
  89. HANDLE m_hDSNotifyEvent;
  90. HANDLE m_hWaitThread;
  91. BOOL m_bExitThread;
  92. UINT32 m_ulOriginalThreadId;
  93. CTSConverter m_TSConverter;
  94. HX_RESULT SetPrimaryBufferFormat() ;
  95. inline UINT32 CalcMs(UINT32 ulNumBytes);
  96. HANDLE GetEventHandle() { return m_hDSNotifyEvent; };
  97. BOOL GetExitCode() { return m_bExitThread; };
  98. void PostTimeSyncMessage();
  99. void KillThreadAndEvent();
  100.         static DWORD WINAPI EventThreadProc(LPVOID pVoid) ;
  101. public:
  102.     virtual ~CHXAudioDeviceDS();
  103.     CHXAudioDeviceDS();
  104.     HX_RESULT        _Imp_Open( const HXAudioFormat* pFormat );
  105.     HX_RESULT        _Imp_Close( void );
  106.     HX_RESULT     _Imp_Seek(ULONG32 ulSeekTime) {     return HXR_OK; };
  107.     HX_RESULT        _Imp_Pause( void );
  108.     HX_RESULT        _Imp_Resume( void );
  109.     HX_RESULT        _Imp_Write( const HXAudioData* pAudioOutData );
  110.     HX_RESULT        _Imp_Reset( void );
  111.     HX_RESULT       _Imp_Drain( void );
  112.     BOOL      _Imp_SupportsVolume( void ) { return TRUE; };
  113.     UINT16        _Imp_GetVolume( void );
  114.     HX_RESULT        _Imp_SetVolume( const UINT16 uVolume );
  115.     HX_RESULT        _Imp_CheckFormat( const HXAudioFormat* pFormat);
  116.     HX_RESULT      _Imp_GetCurrentTime( ULONG32& ulCurrentTime);
  117.     INT16     _Imp_GetAudioFd(void) {return 0;};
  118.     UINT16     _NumberOfBlocksRemainingToPlay(void){return 0;};
  119.     BOOL     _IsWaveOutDevice(void) { return FALSE; };
  120.     static UINT     zm_uDestroyMessage;
  121. };
  122. #endif /* _NEWRMAUDEVDS_H_ */