📄 hxaudstr.h
字号:
/* ***** BEGIN LICENSE BLOCK *****
* Version: RCSL 1.0/RPSL 1.0
*
* Portions Copyright (c) 1995-2002 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
* Version 1.0 (the "RPSL") available at
* http://www.helixcommunity.org/content/rpsl unless you have licensed
* the file under the RealNetworks Community Source License Version 1.0
* (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.
*
* 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,
REF(IUnknown*) /*OUT*/ ppUnknown,
IUnknown* /*IN*/ pUnkOuter);
/************************************************************************
* Method:
* IHXUpdateProperties::UpdatePacketTimeOffset
* Purpose:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -