hxausvc.h

来自「Amarok是一款在LINUX或其他类UNIX操作系统中运行的音频播放器软件。 」· C头文件 代码 · 共 1,730 行 · 第 1/4 页

H
1,730
字号
/* * * This software is released under the provisions of the GPL version 2. * see file "COPYING".  If that file is not available, the full statement  * of the license can be found at * * http://www.fsf.org/licensing/licenses/gpl.txt * * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved. * */#ifndef _HXAUSVC_H_#define _HXAUSVC_H_#define     HX_MAX_VOLUME  100#define     HX_INIT_VOLUME 50#define     HX_MIN_VOLUME  0/**************************************************************************** * * Forward declarations of some interfaces defined here-in. */typedef _INTERFACE   IHXAudioPlayer		    IHXAudioPlayer;typedef _INTERFACE   IHXAudioPlayerResponse	    IHXAudioPlayerResponse;typedef _INTERFACE   IHXAudioStream		    IHXAudioStream;typedef _INTERFACE   IHXAudioStream2		    IHXAudioStream2;typedef _INTERFACE   IHXAudioDevice		    IHXAudioDevice;typedef _INTERFACE   IHXAudioDeviceResponse	    IHXAudioDeviceResponse;typedef _INTERFACE   IHXAudioHook		    IHXAudioHook;typedef _INTERFACE   IHXAudioDeviceHookManager	    IHXAudioDeviceHookManager;typedef _INTERFACE   IHXAudioStreamInfoResponse    IHXAudioStreamInfoResponse;// $Private:typedef _INTERFACE   IHXMultiPlayPauseSupport	    IHXMultiPlayPauseSupport;typedef _INTERFACE   IHXAudioDeviceManager2	    IHXAudioDeviceManager2;typedef _INTERFACE   IHXAudioResampler		    IHXAudioResampler;typedef _INTERFACE   IHXAudioResamplerManager	    IHXAudioResamplerManager;typedef _INTERFACE   IHXAudioPushdown2		    IHXAudioPushdown2;// $EndPrivate.typedef _INTERFACE   IHXVolume			    IHXVolume;typedef _INTERFACE   IHXVolumeAdviseSink	    IHXVolumeAdviseSink;typedef _INTERFACE   IHXDryNotification	    IHXDryNotification;typedef _INTERFACE   IHXBuffer			    IHXBuffer;typedef _INTERFACE   IHXValues			    IHXValues;/**************************************************************************** * *	Audio Services Data Structures */typedef struct _HXAudioFormat{    UINT16	uChannels;	/* Num. of Channels (1=Mono, 2=Stereo, etc. */    UINT16	uBitsPerSample;	/* 8 or 16				    */    UINT32	ulSamplesPerSec;/* Sampling Rate			    */    UINT16	uMaxBlockSize;	/* Max Blocksize			    */} HXAudioFormat;typedef enum _AudioStreamType{    STREAMING_AUDIO	= 0,    INSTANTANEOUS_AUDIO = 1,    TIMED_AUDIO		= 2,    STREAMING_INSTANTANEOUS_AUDIO = 3} AudioStreamType;typedef struct _HXAudioData{    IHXBuffer*	    pData;		/* Audio data			    */     ULONG32	    ulAudioTime;	/* Start time in milliseconds	    */    AudioStreamType uAudioStreamType;} HXAudioData;typedef enum _AudioDeviceHookType{    READ_ONLY_EARLY = 0,    WRITABLE	    = 127,    READ_ONLY_LATE  = 255} AudioDeviceHookType;/**************************************************************************** *  *  Interface: *  *  IHXAudioPlayer *  *  Purpose: *  *  This interface provides access to the Audio Player services. Use this *  interface to create audio streams, "hook" post-mixed audio data, and to *  control volume levels. *  *  IID_IHXAudioPlayer: *  *  {00000700-0901-11d1-8B06-00A024406D59} *  */DEFINE_GUID(IID_IHXAudioPlayer, 0x00000700, 0x901, 0x11d1, 0x8b, 0x6, 0x0,             0xa0, 0x24, 0x40, 0x6d, 0x59);#undef  INTERFACE#define INTERFACE   IHXAudioPlayerDECLARE_INTERFACE_(IHXAudioPlayer, IUnknown){    /*     *  IUnknown methods     */    STDMETHOD(QueryInterface)       (THIS_                    REFIID riid,                    void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)      (THIS) PURE;    STDMETHOD_(ULONG32,Release)     (THIS) PURE;    /*     *  IHXAudioPlayer methods     */    /************************************************************************    *  Method:    *      IHXAudioPlayer::CreateAudioStream    *  Purpose:    *		Call this to create an audio stream.    */    STDMETHOD(CreateAudioStream)    (THIS_				    IHXAudioStream** /*OUT*/ pAudioStream				    ) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::AddPostMixHook    *  Purpose:    *		Call this to hook audio data after all audio streams in this    *		have been mixed.    */    STDMETHOD(AddPostMixHook)	(THIS_				IHXAudioHook*	    /*IN*/ pHook,				const HXBOOL	    /*IN*/ bDisableWrite,				const HXBOOL	    /*IN*/ bFinal				) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::RemovePostMixHook    *  Purpose:    *		Call this to remove an already added post hook.    */    STDMETHOD(RemovePostMixHook)    (THIS_				    IHXAudioHook*    /*IN*/ pHook				    ) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::GetAudioStreamCount    *  Purpose:    *		Get the number of audio streams currently active in the     *		audio player. Since streams can be added mid-presentation    *		this function may return different values on different calls.    *		If the user needs to know about all the streams as they get    *		get added to the player, IHXAudioStreamInfoResponse should    *		be implemented and passed in SetStreamInfoResponse.    */    STDMETHOD_(UINT16,GetAudioStreamCount) (THIS) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::GetAudioStream    *  Purpose:    *		Get an audio stream at position given.     */    STDMETHOD_(IHXAudioStream*,GetAudioStream) (THIS_						UINT16	/*IN*/ uIndex						) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::SetStreamInfoResponse    *  Purpose:    *		Set a stream info response interface. A client must implement    *		an IHXAudioStreamInfoResponse and then call this method with    *		the IHXAudioStreamInfoResponse as the parameter. The audio    *		player will call IHXAudioStreamInfoResponse::OnStreamsReady    *		with the total number of audio streams associated with this     *		audio player.    */    STDMETHOD(SetStreamInfoResponse)	(THIS_				IHXAudioStreamInfoResponse* /*IN*/ pResponse					) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::RemoveStreamInfoResponse    *  Purpose:    *		Remove stream info response that was added earlier    */    STDMETHOD(RemoveStreamInfoResponse) (THIS_				IHXAudioStreamInfoResponse* /*IN*/ pResponse				) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::GetAudioVolume    *  Purpose:    *		Get the audio player's volume interface. This volume controls    *		the volume level of all the mixed audio streams for this     *		audio player.    */    STDMETHOD_(IHXVolume*,GetAudioVolume) (THIS) PURE;    /************************************************************************    *  Method:    *      IHXAudioPlayer::GetDeviceVolume    *  Purpose:    *		Get the audio device volume interface. This volume controls    *		the audio device volume levels.    */    STDMETHOD_(IHXVolume*,GetDeviceVolume) (THIS) PURE;};/**************************************************************************** *  *  Interface: *  *  IHXAudioPlayerResponse *  *  Purpose: *  *  This interface provides access to the Audio Player Response. Use this  *  to receive audio player playback notifications. Your implementation of *  OnTimeSync() is called with the current audio playback time (millisecs). *  This interface is currently to be used ONLY by the RMA engine internally. *  *  IID_IHXAudioPlayerResponse: *  *  {00000701-0901-11d1-8B06-00A024406D59} *  */DEFINE_GUID(IID_IHXAudioPlayerResponse, 0x00000701, 0x901, 0x11d1, 0x8b, 0x6, 0x0,            0xa0, 0x24, 0x40, 0x6d, 0x59);#undef  INTERFACE#define INTERFACE   IHXAudioPlayerResponseDECLARE_INTERFACE_(IHXAudioPlayerResponse, IUnknown){    /*     *  IUnknown methods     */    STDMETHOD(QueryInterface)       (THIS_                    REFIID riid,                    void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)      (THIS) PURE;    STDMETHOD_(ULONG32,Release)     (THIS) PURE;    /*     *  IHXAudioPlayerResponse methods     */    /************************************************************************     *  Method:     *      IHXAudioPlayerResponse::OnTimeSync     *  Purpose:     *	    This method is called with the current audio playback time.     */    STDMETHOD(OnTimeSync)   (THIS_			    ULONG32 /*IN*/ ulTimeEnd			    ) PURE;};/**************************************************************************** *  *  Interface: *  *      IHXAudioStream *  *  Purpose: *  *  This interface provides access to an Audio Stream. Use this to play *  audio, "hook" audio stream data, and to get audio stream information. *  *  IID_IHXAudioStream: *  *      {00000702-0901-11d1-8B06-00A024406D59} *  */DEFINE_GUID(IID_IHXAudioStream, 0x00000702, 0x901, 0x11d1, 0x8b, 0x6, 0x0,             0xa0, 0x24, 0x40, 0x6d, 0x59);#undef  INTERFACE#define INTERFACE   IHXAudioStreamDECLARE_INTERFACE_(IHXAudioStream, IUnknown){    /*     *  IUnknown methods     */    STDMETHOD(QueryInterface)		(THIS_					REFIID riid,					void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)		(THIS) PURE;    STDMETHOD_(ULONG32,Release)		(THIS) PURE;        /*     *  IHXAudioStream methods     */    /************************************************************************     *  Method:     *      IHXAudioStream::Init     *  Purpose:     *	    Initialize an audio stream with the given audio format. The      *	    IHXValues contains stream identification information.      */    STDMETHOD(Init)	(THIS_			const HXAudioFormat* /*IN*/ pAudioFormat,			IHXValues*	/*IN*/  pValues			) PURE;    /************************************************************************     *  Method:     *      IHXAudioStream::Write     *  Purpose:     *	    Write audio data to Audio Services.      *	         *	    NOTE: If the renderer loses packets and there is no loss     *	    correction, then the renderer should write the next packet      *	    using a meaningful start time.  Audio Services will play      *      silence where packets are missing.     */    STDMETHOD(Write)	(THIS_			HXAudioData*		/*IN*/	pAudioData			) PURE;    /************************************************************************    *  Method:    *      IHXAudioStream::AddPreMixHook    *  Purpose:    *		Use this to "hook" audio stream data prior to the mixing.    *		Set bDisableWrite to TRUE to prevent this audio stream data    *		from being mixed with other audio stream data associated    *		with this audio player.    */    STDMETHOD(AddPreMixHook) (THIS_                             IHXAudioHook*    	/*IN*/ pHook,			     const HXBOOL	      	/*IN*/ bDisableWrite			     ) PURE;    /************************************************************************    *  Method:    *      IHXAudioStream::RemovePreMixHook    *  Purpose:    *		Use this to remove an already added "hook".    */    STDMETHOD(RemovePreMixHook) (THIS_                            	IHXAudioHook*    	/*IN*/ pHook			     	) PURE;    /************************************************************************    *  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			     	    ) PURE;    /************************************************************************    *  Method:    *      IHXAudioStream::GetStreamInfo    *  Purpose:    *		Use this to get information specific to this audio stream.    */    STDMETHOD_(IHXValues*,GetStreamInfo)      	(THIS) PURE;    /************************************************************************    *  Method:    *      IHXAudioStream::GetAudioVolume    *  Purpose:    *		Get the audio stream's volume interface. This volume controls    *		the volume level for this audio stream.    */    STDMETHOD_(IHXVolume*,GetAudioVolume) (THIS) PURE;};/**************************************************************************** *  *  Interface: *  *	IHXAudioDevice *  *  Purpose: *  *	Object that exports audio device API *	This interface is currently to be used ONLY by the RMA engine  *	internally. *  *  IID_IHXAudioDevice: *  *	{00000703-0901-11d1-8B06-00A024406D59} *  */DEFINE_GUID(IID_IHXAudioDevice, 0x00000703, 0x901, 0x11d1, 0x8b, 0x6, 0x0,             0xa0, 0x24, 0x40, 0x6d, 0x59);#undef  INTERFACE#define INTERFACE   IHXAudioDeviceDECLARE_INTERFACE_(IHXAudioDevice, IUnknown){    /*     *  IUnknown methods     */    STDMETHOD(QueryInterface)       (THIS_                    REFIID riid,                    void** ppvObj) PURE;    STDMETHOD_(ULONG32,AddRef)      (THIS) PURE;    STDMETHOD_(ULONG32,Release)     (THIS) PURE;    /*     *  IHXAudioDevice methods

⌨️ 快捷键说明

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