hxcore.h
来自「Amarok是一款在LINUX或其他类UNIX操作系统中运行的音频播放器软件。 」· C头文件 代码 · 共 2,111 行 · 第 1/4 页
H
2,111 行
/* * * 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 _HXCORE_H_#define _HXCORE_H_/* * Forward declarations of some interfaces defined or used here-in. */typedef _INTERFACE IUnknown IUnknown;typedef _INTERFACE IHXStream IHXStream;typedef _INTERFACE IHXStream2 IHXStream2;typedef _INTERFACE IHXStreamSource IHXStreamSource;typedef _INTERFACE IHXPlayer IHXPlayer;typedef _INTERFACE IHXClientEngine IHXClientEngine;typedef _INTERFACE IHXScheduler IHXScheduler;typedef _INTERFACE IHXClientAdviseSink IHXClientAdviseSink;typedef _INTERFACE IHXValues IHXValues;typedef _INTERFACE IHXBuffer IHXBuffer;typedef _INTERFACE IHXPacket IHXPacket;// $Private:typedef _INTERFACE IHXPersistenceManager IHXPersistenceManager;typedef _INTERFACE IHXRendererAdviseSink IHXRendererAdviseSink;typedef _INTERFACE IHXLayoutSite IHXLayoutSite;typedef _INTERFACE IHXProtocolValidator IHXProtocolValidator;typedef _INTERFACE IHXUpdateProperties IHXUpdateProperties;typedef _INTERFACE IHXUpdateProperties2 IHXUpdateProperties2;typedef _INTERFACE IHXPersistentComponentManager IHXPersistentComponentManager;typedef _INTERFACE IHXPersistentComponent IHXPersistentComponent;typedef _INTERFACE IHXPersistentRenderer IHXPersistentRenderer;typedef _INTERFACE IHXCoreMutex IHXCoreMutex;typedef _INTERFACE IHXMacBlitMutex IHXMacBlitMutex;// $EndPrivate.typedef _INTERFACE IHXRenderer IHXRenderer;typedef _INTERFACE IHXPlayer2 IHXPlayer2;typedef _INTERFACE IHXRequest IHXrequest;typedef _INTERFACE IHXPlayerNavigator IHXPlayerNavigator;typedef _INTERFACE IHXGroupSink IHXGroupSink;typedef struct _PersistentComponentInfo PersistentComponentInfo;typedef struct _HXxEvent HXxEvent;#ifdef _MAC_CFM#pragma export on#endif#if defined _UNIX && !(defined _VXWORKS)/* Includes needed for select() stuff */#include <sys/time.h>#include <sys/types.h>#include <unistd.h>#endif#ifdef _BEOS // fd_set stuff#include <net/socket.h>#endif#include "hxwin.h"/* Used in renderer and advise sink interface */enum BUFFERING_REASON{ BUFFERING_START_UP = 0, BUFFERING_SEEK, BUFFERING_CONGESTION, BUFFERING_LIVE_PAUSE};/**************************************************************************** * * Function: * * CreateEngine() * * Purpose: * * Function implemented by the RMA core to return a pointer to the * client engine. This function would be run by top level clients. */STDAPI CreateEngine ( IHXClientEngine** /*OUT*/ ppEngine );/**************************************************************************** * * Function: * * CloseEngine() * * Purpose: * * Function implemented by the RMA core to close the engine which * was returned in CreateEngine(). */STDAPI CloseEngine ( IHXClientEngine* /*IN*/ pEngine );#ifdef _MAC_CFM#pragma export off#endif/* * Definitions of Function Pointers to CreateEngine() and Close Engine(). * These types are provided as a convenince to authors of top level clients. */typedef HX_RESULT (HXEXPORT_PTR FPRMCREATEENGINE)(IHXClientEngine** ppEngine);typedef HX_RESULT (HXEXPORT_PTR FPRMCLOSEENGINE) (IHXClientEngine* pEngine);/**************************************************************************** * * Interface: * * IHXStream * * Purpose: * * Interface provided by the client engine to the renderers. This * interface allows access to stream related information and properties. * * IID_IHXStream: * * {00000400-0901-11d1-8B06-00A024406D59} * */DEFINE_GUID(IID_IHXStream, 0x00000400, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);#undef INTERFACE#define INTERFACE IHXStreamDECLARE_INTERFACE_(IHXStream, IUnknown){ /* * IUnknown methods */ STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /* * IHXStream methods */ /************************************************************************ * Method: * IHXStream::GetSource * Purpose: * Get the interface to the source object of which the stream is * a part of. * */ STDMETHOD(GetSource) (THIS_ REF(IHXStreamSource*) pSource) PURE; /************************************************************************ * Method: * IHXStream::GetStreamNumber * Purpose: * Get the stream number for this stream relative to the source * object of which the stream is a part of. * */ STDMETHOD_(UINT16,GetStreamNumber) (THIS) PURE; /************************************************************************ * Method: * IHXStream::GetStreamType * Purpose: * Get the MIME type for this stream. NOTE: The returned string is * assumed to be valid for the life of the IHXStream from which it * was returned. * */ STDMETHOD_(const char*,GetStreamType) (THIS) PURE; /************************************************************************ * Method: * IHXStream::GetHeader * Purpose: * Get the header for this stream. * */ STDMETHOD_(IHXValues*,GetHeader) (THIS) PURE; /************************************************************************ * Method: * IHXStream::ReportQualityOfService * Purpose: * Call this method to report to the playback context that the * quality of service for this stream has changed. The unQuality * should be on a scale of 0 to 100, where 100 is the best possible * quality for this stream. Although the transport engine can * determine lost packets and report these through the user * interface, only the renderer of this stream can determine the * "real" perceived damage associated with this loss. * * NOTE: The playback context may use this value to indicate loss * in quality to the user interface. When the effects of a lost * packet are eliminated the renderer should call this method with * a unQuality of 100. * */ STDMETHOD(ReportQualityOfService) (THIS_ UINT8 unQuality) PURE; /************************************************************************ * Method: * IHXStream::ReportRebufferStatus * Purpose: * Call this method to report to the playback context that the * available data has dropped to a critically low level, and that * rebuffering should occur. The renderer should call back into this * interface as it receives additional data packets to indicate the * status of its rebuffering effort. * * NOTE: The values of unNeeded and unAvailable are used to indicate * the general status of the rebuffering effort. For example, if a * renderer has "run dry" and needs 5 data packets to play smoothly * again, it should call ReportRebufferStatus() with 5,0 then as * packet arrive it should call again with 5,1; 5,2... and eventually * 5,5. * */ STDMETHOD(ReportRebufferStatus) (THIS_ UINT8 unNeeded, UINT8 unAvailable) PURE; /************************************************************************ * Method: * IHXStream::SetGranularity * Purpose: * Sets the desired Granularity for this stream. The actual * granularity will be the lowest granularity of all streams. * Valid to call before stream actually begins. Best to call during * IHXRenderer::OnHeader(). */ STDMETHOD(SetGranularity) (THIS_ ULONG32 ulGranularity) PURE; /************************************************************************ * Method: * IHXStream::GetRendererCount * Purpose: * Returns the current number of renderer instances supported by * this stream instance. */ STDMETHOD_(UINT16, GetRendererCount)(THIS) PURE; /************************************************************************ * Method: * IHXStream::GetRenderer * Purpose: * Returns the Nth renderer instance supported by this stream. */ STDMETHOD(GetRenderer) (THIS_ UINT16 nIndex, REF(IUnknown*) pUnknown) PURE;};/**************************************************************************** * * Interface: * * IHXStream2 * * Purpose: * * Interface provided by the client engine to the renderers. This * interface allows access to stream related information and properties. * * IID_IHXStream: * * {00000400-0901-11d1-8B06-00A024406D5a} * */DEFINE_GUID(IID_IHXStream2, 0x00000400, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x5a);#undef INTERFACE#define INTERFACE IHXStream2DECLARE_INTERFACE_(IHXStream2, IHXStream){ /************************************************************************ * Method: * IHXStream2::ReportAudioRebufferStatus * Purpose: * For audio only, when it's called, the rebuffer will only occur when * there aren't any packets in the transport and the amount of audio in * audio device falls below the minimum startup audio pushdown(1000ms * by default) * * Non-audio renderers should still call ReportRebufferStatus(), the * rebuffer will occur when the core drains out all the packets from * the transport buffer * * The rest semantic are the same between the 2 calls. */ STDMETHOD(ReportAudioRebufferStatus) (THIS_ UINT8 unNeeded, UINT8 unAvailable) PURE;};/**************************************************************************** * * Interface: * * IHXStreamSource * * Purpose: * * Interface provided by the client engine to the renderers. This * interface allows access to source related information and properties. * * IID_IHXStreamSource: * * {00000401-0901-11d1-8B06-00A024406D59} * */DEFINE_GUID(IID_IHXStreamSource, 0x00000401, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);#undef INTERFACE#define INTERFACE IHXStreamSourceDECLARE_INTERFACE_(IHXStreamSource, IUnknown){ /* * IUnknown methods */ STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /* * IHXStreamSource methods */ /************************************************************************ * Method: * IHXStreamSource::IsLive * Purpose: * Ask the source whether it is live * */ STDMETHOD_ (HXBOOL,IsLive) (THIS) PURE; /************************************************************************ * Method: * IHXStreamSource::GetPlayer * Purpose: * Get the interface to the player object of which the source is * a part of. * */ STDMETHOD(GetPlayer) (THIS_ REF(IHXPlayer*) pPlayer) PURE; /************************************************************************ * Method: * IHXStreamSource::GetURL * Purpose: * Get the URL for this source. NOTE: The returned string is * assumed to be valid for the life of the IHXStreamSource from which * it was returned. * */ STDMETHOD_(const char*,GetURL) (THIS) PURE; /************************************************************************ * Method: * IHXStreamSource::GetStreamCount * Purpose: * Returns the current number of stream instances supported by * this source instance. */ STDMETHOD_(UINT16, GetStreamCount)(THIS) PURE; /************************************************************************ * Method: * IHXStreamSource::GetStream * Purpose: * Returns the Nth stream instance supported by this source. */ STDMETHOD(GetStream) (THIS_ UINT16 nIndex, REF(IUnknown*) pUnknown) PURE;};/**************************************************************************** * * Interface: * * IHXPlayer * * Purpose: * * Interface provided by the client engine to the renderers. This * interface allows access to player related information, properties, * and operations. * * IID_IHXPlayer: * * {00000402-0901-11d1-8B06-00A024406D59} * */DEFINE_GUID(IID_IHXPlayer, 0x00000402, 0x901, 0x11d1, 0x8b, 0x6, 0x0, 0xa0, 0x24, 0x40, 0x6d, 0x59);#undef INTERFACE#define INTERFACE IHXPlayerDECLARE_INTERFACE_(IHXPlayer, IUnknown){ /* * IUnknown methods */ STDMETHOD(QueryInterface) (THIS_ REFIID riid, void** ppvObj) PURE; STDMETHOD_(ULONG32,AddRef) (THIS) PURE; STDMETHOD_(ULONG32,Release) (THIS) PURE; /* * IHXPlayer methods */ /************************************************************************ * Method: * IHXPlayer::GetClientEngine * Purpose: * Get the interface to the client engine object of which the * player is a part of. * */ STDMETHOD(GetClientEngine) (THIS_ REF(IHXClientEngine*) pEngine) PURE; /************************************************************************ * Method: * IHXPlayer::IsDone * Purpose: * Ask the player if it is done with the current presentation * */ STDMETHOD_(HXBOOL,IsDone) (THIS) PURE; /************************************************************************ * Method: * IHXPlayer::IsLive * Purpose: * Ask the player whether it contains the live source * */ STDMETHOD_(HXBOOL,IsLive) (THIS) PURE; /************************************************************************ * Method: * IHXPlayer::GetCurrentPlayTime * Purpose: * Get the current time on the Player timeline * */ STDMETHOD_(ULONG32,GetCurrentPlayTime) (THIS) PURE; /************************************************************************ * Method: * IHXPlayer::OpenURL * Purpose: * Tell the player to begin playback of all its sources. * */ STDMETHOD(OpenURL) (THIS_ const char* pURL) PURE; /************************************************************************ * Method: * IHXPlayer::Begin * Purpose: * Tell the player to begin playback of all its sources. * */ STDMETHOD(Begin) (THIS) PURE; /************************************************************************ * Method: * IHXPlayer::Stop * Purpose: * Tell the player to stop playback of all its sources. * */ STDMETHOD(Stop) (THIS) PURE; /************************************************************************ * Method: * IHXPlayer::Pause * Purpose: * Tell the player to pause playback of all its sources. * */ STDMETHOD(Pause) (THIS) PURE;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?