⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hxaudstr.h

📁 symbian 下的helix player源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: hxaudstr.h,v 1.10.8.1 2004/07/09 02:08:04 hubbe Exp $
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer of the Original Code and owns the copyrights in the
 * portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

#ifndef _HXAUSTR_H_
#define _HXAUSTR_H_

#include "hxcomm.h"
#include "hxcore.h"

#include "mixengine.h"

// forward decls
class	CHXAudioPlayer;
class	CHXSimpleList;
class   CHXMapPtrToPtr;
class	CHXBuffer;
#if defined(HELIX_FEATURE_CROSSFADE)
class   CrossFader;
#endif /* HELIX_FEATURE_CROSSFADE */
#ifdef _MACINTOSH
class	HXAudioMacQueue;
#endif

_INTERFACE IHXAudioStream;
_INTERFACE IHXAudioStream2;
_INTERFACE IHXBuffer;
_INTERFACE IHXValues;
_INTERFACE IHXAudioHook;
_INTERFACE IHXDryNotification;
_INTERFACE IHXRealAudioSync;
_INTERFACE IHXCommonClassFactory;
_INTERFACE IHXUpdateProperties;

struct RealAudioBytesToTimeStamp
{
    RealAudioBytesToTimeStamp()
    {
	m_ulOutNumBytes		= 0.;
	m_ulOrigTimestamp	= 0;
	m_ulTimestamp		= 0;
	m_ulInTimestamp		= 0;
	m_ulInEndTime		= 0;
	m_ulDuration		= 0;
    }

    double  m_ulOutNumBytes;
    UINT32  m_ulOrigTimestamp; // needed for multi-player pause/resume support
    UINT32  m_ulTimestamp;
    UINT32  m_ulInTimestamp;
    UINT32  m_ulInEndTime;
    UINT32  m_ulDuration;
};

struct HXAudioInfo;
/****************************************************************************
 *
 *  Class:
 *
 *      CHXAudioStream
 *
 *  Purpose:
 *
 *      PN implementation of audio stream object.
 *
 */
class CHXAudioStream: public IHXAudioStream, 
		      public IHXRealAudioSync,
		      public IHXAudioStream2,
		      public CAudioSvcSampleConverter,
		      public IHXCommonClassFactory,
#ifdef HELIX_FEATURE_VOLUME
		      public IHXVolumeAdviseSink,
#endif 
                      public IHXUpdateProperties
{
public:
    CHXAudioStream( CHXAudioPlayer* owner, IUnknown* pContext );

    /*
     *	IUnknown methods
     */
    STDMETHOD(QueryInterface)   (THIS_
                            REFIID riid,
                            void** ppvObj);

    STDMETHOD_(ULONG32,AddRef)  (THIS);

    STDMETHOD_(ULONG32,Release) (THIS);

    /*
     *      IHXAudioStream methods
     */

    STDMETHOD(Init)	(THIS_
			const HXAudioFormat*  pAudioFormat,
			IHXValues*      pValues
			);

    STDMETHOD(Write)	(THIS_
			HXAudioData*	pAudioData
			);

    STDMETHOD(AddPreMixHook)	(THIS_
				IHXAudioHook*	pHook,
				const BOOL		bDisableWrite
				);

    STDMETHOD(RemovePreMixHook)	(THIS_
				IHXAudioHook*	pHook
				);



#ifdef HELIX_FEATURE_VOLUME
    // 
    // IHXVolumeAdviseSink methods.
    //
    STDMETHOD(OnVolumeChange)(THIS_ const UINT16 uVolume);
    STDMETHOD(OnMuteChange)(THIS_ const BOOL bMute);
#endif

    /************************************************************************
    *  Method:
    *      IHXAudioStream::AddDryNotification
    *  Purpose:
    *	    Use this to add a notification response object to get notifications
    *	    when audio stream is running dry.
    */
    STDMETHOD(AddDryNotification)   (THIS_
                            	    IHXDryNotification* /*IN*/ pNotification
			     	    );
  
   /************************************************************************
    *  Method:
    *      IHXAudioStream2::RemoveDryNotification
    *  Purpose:
    *	    Use this to remove itself from the notification response object
    *	    during the stream switching.
    */
    STDMETHOD(RemoveDryNotification)	(THIS_
					IHXDryNotification* /*IN*/ pNotification
			     		);

   /************************************************************************
    *  Method:
    *      IHXAudioStream2::GetAudioFormat
    *  Purpose:
    *	    Returns the input audio format of the data written by the 
    *	    renderer. This function will fill in the pre-allocated 
    *	    HXAudioFormat structure passed in.
    */
    STDMETHOD(GetAudioFormat)   (THIS_
			        HXAudioFormat*	/*IN/OUT*/pAudioFormat);

    STDMETHOD_(IHXValues*,GetStreamInfo) (THIS)
	    { 
		if (m_pValues)
		{
		    m_pValues->AddRef();
		}

		return m_pValues ; 
	    };

    /* Return the this stream's volume interface. */
    STDMETHOD_(IHXVolume*, GetAudioVolume)         (THIS);

    /*
     *  IHXRealAudioSync methods
     */

    /************************************************************************
     *  Method:
     *      IHXRealAudioSync::Register
     *  Purpose:
     */
    STDMETHOD(Register)	(THIS);

    /************************************************************************
     *  Method:
     *      IHXRealAudioSync::UnRegister
     *  Purpose:
     */
    STDMETHOD(UnRegister)	(THIS);

    /************************************************************************
     *  Method:
     *      IHXRealAudioSync::FudgeTimestamp
     *  Purpose:
     *	    Tell the audio stream about the relationship between the number 
     *	    of bytes written to the actual timestamp.
     *	    
     */
    STDMETHOD(FudgeTimestamp)	(THIS_
				UINT32 /*IN*/ ulNumberofBytes,
				UINT32 /*IN*/ ulTimestamp
	    			);

    /*
     *	IHXCommonClassFactory methods
     */

    /************************************************************************
     *	Method:
     *	    IHXCommonClassFactory::CreateInstance
     *	Purpose:
     *	    Creates instances of common objects supported by the system,
     *	    like IHXBuffer, IHXPacket, IHXValues, etc.
     *
     *	    This method is similar to Window's CoCreateInstance() in its 
     *	    purpose, except that it only creates objects of a well known
     *	    types.
     *
     *	    NOTE: Aggregation is never used. Therefore and outer unknown is
     *	    not passed to this function, and you do not need to code for this
     *	    situation.
     */
    STDMETHOD(CreateInstance)	(THIS_
				REFCLSID    /*IN*/  rclsid,
				void**	    /*OUT*/ ppUnkown);

    /************************************************************************
     *  Method:
     *	    IHXController::CreateInstanceAggregatable
     *  Purpose:
     *	    Creates instances of common objects that can be aggregated
     *	    supported by the system, like IHXSiteWindowed
     *
     *	    This method is similar to Window's CoCreateInstance() in its 
     *	    purpose, except that it only creates objects of a well known
     *	    types.
     *
     *	    NOTE 1: Unlike CreateInstance, this method will create internal
     *		    objects that support Aggregation.
     *
     *	    NOTE 2: The output interface is always the non-delegating 
     *		    IUnknown.
     */
    STDMETHOD(CreateInstanceAggregatable)
				    (THIS_
				    REFCLSID	    /*IN*/  rclsid,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -