
/*
  File: include/sq2_audiosys/Interface_MediaSystem.h
  Description: Interface to the Sonique 2 audio system
  Part of the Mantis project
  (c) 2002 Lycos Inc.

  This file is distributed for the sole purpose of allowing you to write
  software to interface with Sonique 2 and other Mantis programs. It is
  not to be modified or used for any other purpose without written
  authorization.

  If you redistribute this file, it must be in the original package
  complete with all other files provided, including the usage agreement.

  Do not remove this notice.
*/

#ifndef _MEDIAFILTER_H_
#define _MEDIAFILTER_H_

#include "typesport.h"
//#include "filesys.h"
#include "Interface_ErrorSys.h"
#include "HeapPtr.h"



// {913BD758-24D2-4aaa-8940-A150BBA05ADC}
DEFINE_MID(MID_MEDIATYPE_RAW, 0x913bd758, 0x24d2, 0x4aaa, 0x89, 0x40, 0xa1, 0x50, 0xbb, 0xa0, 0x5a, 0xdc);

// {4A6092D5-E508-467b-9537-3E067C7C30DA}
DEFINE_MID(MID_MEDIATYPE_PCM, 0x4a6092d5, 0xe508, 0x467b, 0x95, 0x37, 0x3e, 0x06, 0x7c, 0x7c, 0x30, 0xda);


// {343BE74A-40DD-4ad3-8EB4-20BF53E3EBF6}
DEFINE_MID(GFID_MEDIAFILTER, 0x343be74a, 0x40dd, 0x4ad3, 0x8e, 0xb4, 0x20, 0xbf, 0x53, 0xe3, 0xeb, 0xf6);

// {01990F1A-9578-464e-991B-3C3E6E6D71FE}
DEFINE_MID(GFID_MEDIASTREAM, 0x01990f1a, 0x9578, 0x464e, 0x99, 0x1b, 0x3c, 0x3e, 0x6e, 0x6d, 0x71, 0xfe);

// {A1A10FE3-8C35-4f8a-A1B5-FF8C7FC2AC65}
DEFINE_MID(GFID_MEDIAENDPOINT, 0xa1a10fe3, 0x8c35, 0x4f8a, 0xa1, 0xb5, 0xff, 0x8c, 0x7f, 0xc2, 0xac, 0x65);

// {F7C5C697-E083-4680-9A59-0C4D0144BCAE}
DEFINE_MID(GFID_MEDIAFILTER_DSP, 0xf7c5c697, 0xe083, 0x4680, 0x9a, 0x59, 0x0c, 0x4d, 0x01, 0x44, 0xbc, 0xae);

// {00DDE748-2A83-4217-A718-30A00231509A}
DEFINE_MID(GFID_MEDIAFILTER_METAFILTER, 0xdde748, 0x2a83, 0x4217, 0xa7, 0x18, 0x30, 0xa0, 0x2, 0x31, 0x50, 0x9a);

// {4A37FD9E-5A29-45aa-931D-5D341383D5B8}
DEFINE_MID(GFID_MEDIA_MISC, 0x4a37fd9e, 0x5a29, 0x45aa, 0x93, 0x1d, 0x5d, 0x34, 0x13, 0x83, 0xd5, 0xb8);

// {D13270EF-2FAA-4a01-9EE6-5391F9B641C2}
DEFINE_MID(GFID_MEDIA_AUDIOSETTINGS, 0xd13270ef, 0x2faa, 0x4a01, 0x9e, 0xe6, 0x53, 0x91, 0xf9, 0xb6, 0x41, 0xc2);

// {619AEA1C-44A6-4558-AC4D-44819711803A}
DEFINE_MID(MID_MEDIA_AUDIOSETTINGS, 0x619aea1c, 0x44a6, 0x4558, 0xac, 0x4d, 0x44, 0x81, 0x97, 0x11, 0x80, 0x3a);




class MMediaFormat
{
public:
    virtual void	__stdcall AddRef( )		= 0;
	virtual void	__stdcall Release( )	= 0;

	MID MediaType;
};

class MPCMMediaFormat : public MMediaFormat
{
public:
	uint32 nSampleRate;
	uint32 nNumChannels;
	uint32 nBitsPerSample;
	bool bIsReal, bIsSigned;

	uint32 GetBytesPerSecond() { return nSampleRate*nNumChannels*((nBitsPerSample+7)/8); }
	uint32 GetBytesPerMilliseconds(int ms) { return nSampleRate*ms/1000*nNumChannels*((nBitsPerSample+7)/8); }
};

typedef double MediaTime;
#define PACKET_FIRST	1
#define PACKET_LAST		2
#define PACKET_SEEKED	4
class MPacket
{
public:
    virtual void	__stdcall AddRef()  = 0;
	virtual void	__stdcall Release() = 0;

	void* pData;
	uint32 nLength;
	uint32 lFlags, lStreamID, lInstanceID;
	MediaTime tTimeStart, tTimeLength;
	RefPtr<MMediaFormat> pFormat;
};

class MMediaOutput;
class MMediaFilter;
class MMediaInput
{
public:
	virtual WString __stdcall GetInputName( ) const							= 0;
	virtual MRESULT __stdcall CanHandle( MMediaOutput* pOutput, uint32 *plConfidence, uint32 *plMerit )	= 0;
	virtual MRESULT __stdcall AttachInput( MMediaOutput* pOutput )			= 0;
	virtual MRESULT __stdcall GetFilter( MMediaFilter** ppToHere )			= 0;
};

class MMediaOutput
{
public:
	virtual WString __stdcall GetOutputName( ) const						= 0;
	virtual MRESULT __stdcall GetPacket( RefPtr<MPacket>& pToHere )			= 0;
	virtual MRESULT __stdcall GetFormats( Array<RefPtr<MMediaFormat> >& Formats )	= 0;
	virtual MRESULT __stdcall SelectFormat( MMediaFormat* pFormat )			= 0;
	virtual MRESULT __stdcall AttachOutput( MMediaInput* pInput )			= 0;
	virtual MRESULT __stdcall GetFilter( MMediaFilter** ppToHere )			= 0;
};

// {A191EDE4-A273-4b1f-9EEF-4415AB1E37A0}
DEFINE_MID(MID_MEDIAINFORMATION, 0xa191ede4, 0xa273, 0x4b1f, 0x9e, 0xef, 0x44, 0x15, 0xab, 0x1e, 0x37, 0xa0);
// {BFF68F24-8D1E-4b99-85C3-E9A649B8F982}
DEFINE_MID(MID_MEDIASETTINGS, 0xbff68f24, 0x8d1e, 0x4b99, 0x85, 0xc3, 0xe9, 0xa6, 0x49, 0xb8, 0xf9, 0x82);

typedef enum {
	MediaInfo_String = 1, MediaInfo_Integer = 2, MediaInfo_Real = 3, MediaInfo_TypeMask = 15,
	MediaInfo_Dynamic = 0, MediaInfo_Sticky = 16, MediaInfo_Fixed = 32, MediaInfo_ModuleSpecific = 48, MediaInfo_AttribMask = 48,
	MediaInfo_Setting = 64,
	MediaInfo_OnlyAvailableDuringPlayback = 128,
} MediaInfoType;
class MediaInfo
{
public:
	MediaInfoType Type;
	WString Name, Desc;
};
class MMediaInformation : public MGeneric
{
public:
	virtual MRESULT __stdcall GetStringInfo( const wchar_t* wsWhich, WString& wsToHere )		= 0;
	virtual MRESULT __stdcall GetIntegerInfo( const wchar_t* wsWhich, int32& lToHere )			= 0;
	virtual MRESULT __stdcall GetRealInfo( const wchar_t* wsWhich, double& lfToHere )			= 0;
	virtual MRESULT __stdcall EnumerateInformation( Array<MediaInfo>& Info )					= 0;
};
class MPreferences;
class MMediaSettings : public MMediaInformation
{
public:
	virtual MRESULT __stdcall SetStringInfo( const wchar_t* wsWhich, const WString& Info )		= 0;
	virtual MRESULT __stdcall SetIntegerInfo( const wchar_t* wsWhich, int32 Info )				= 0;
	virtual MRESULT __stdcall SetRealInfo( const wchar_t* wsWhich, double Info )				= 0;
	virtual MRESULT __stdcall LoadSettings( MPreferences* pPrefs )								= 0;
	virtual MRESULT __stdcall SaveSettings( MPreferences* pPrefs )								= 0;

	//Used to communicate with filters from outside the chain (or even inside)
	virtual MRESULT __stdcall FilterMessage( const wchar_t* wsMessageName, void* pData )		= 0;
};

typedef enum { MediaState_Stopped = 1, MediaState_Locked = 2, MediaState_Paused = 3, MediaState_FormatDetection = 4, MediaState_Playing = 5 } MediaState;
typedef enum { Information_Quick = 1, Information_Thorough = 2 } InformationHint;

// {E9779F92-5976-4dba-84E8-4A78DAB08C9D}
DEFINE_MID(MID_MEDIAFILTER, 0xe9779f92, 0x5976, 0x4dba, 0x84, 0xe8, 0x4a, 0x78, 0xda, 0xb0, 0x8c, 0x9d);

class MMediaChain;
class MMediaFilter : public MGeneric
{
public:
	virtual MRESULT __stdcall GetNumInputs( ) const												= 0;
	virtual MRESULT __stdcall GetNumOutputs( ) const											= 0;
	virtual MRESULT __stdcall GetInput(  MMediaInput** ppToHere, int32 nWhich ) const			= 0;
	virtual MRESULT __stdcall GetInput(  MMediaInput** ppToHere, const wchar_t* wsWhich ) const	= 0;
	virtual MRESULT __stdcall GetOutput( MMediaOutput** ppToHere, int32 nWhich ) const			= 0;
	virtual MRESULT __stdcall GetOutput( MMediaOutput** ppToHere, const wchar_t* wsWhich ) const= 0;
	virtual MRESULT __stdcall AddedToChain( MMediaChain* pChain )								= 0;
	virtual MRESULT __stdcall ChangeState( MediaState State )									= 0;
	virtual MRESULT __stdcall GatherFilterInformation( InformationHint Hint )					= 0;
	virtual MRESULT __stdcall SeekFilter( double tTime, bool bAccurately, bool bFlush )		    = 0;
	virtual MRESULT __stdcall FlushFilter()				                                        = 0;
};

// {54F6EAFB-7103-437a-90D1-1300F840B240}
DEFINE_MID(MID_MEDIAFILEHINT, 0x54f6eafb, 0x7103, 0x437a, 0x90, 0xd1, 0x13, 0x00, 0xf8, 0x40, 0xb2, 0x40);

class FileHint
{
public:
	WString wsFilter;
	WString wsDescription;
};

class MimeHint
{
public:
	WString wsMimeType;
	WString wsDescription;
};

class MMediaFileHint : public MGeneric
{
public:
	virtual MRESULT __stdcall GetFileFilter( Array<FileHint>& Filters ) const					= 0;
	virtual MRESULT __stdcall GetMimeFilter( Array<MimeHint>& Filters ) const					= 0;
};

// {7658A9F6-C3DE-45f4-9AB7-A5EC110139E3}
DEFINE_MID(MID_MEDIAOUTPUTCONTROL, 0x7658a9f6, 0xc3de, 0x45f4, 0x9a, 0xb7, 0xa5, 0xec, 0x11, 0x01, 0x39, 0xe3);

class MMediaOutputControl : public MGeneric
{
public:
	virtual MRESULT __stdcall SetVolume( double lfVolume )			= 0;
	virtual MRESULT __stdcall GetVolume( double& lfVolume ) const	= 0;
	virtual MRESULT __stdcall SetPanning( double lfPan )			= 0;
	virtual MRESULT __stdcall GetPanning( double& lfPan ) const		= 0;
	virtual MRESULT __stdcall RampVolume( double lfFrom, double lfTo, double lfTime )	= 0;
};

// {53AC8900-4504-4943-8F79-18FDBD05CB5C}
DEFINE_MID(MID_MEDIASTREAM, 0x53ac8900, 0x4504, 0x4943, 0x8f, 0x79, 0x18, 0xfd, 0xbd, 0x05, 0xcb, 0x5c);

class MMediaStream : public MMediaFilter
{
public:
	virtual MRESULT __stdcall CanOpen( const wchar_t* wsLocation, uint32 *plConfidence, uint32 *plMerit )	= 0;
    virtual MRESULT __stdcall GetScanLevel( const wchar_t* wsLocation )                                     = 0;
	virtual MRESULT __stdcall Open( const wchar_t* wsLocation )												= 0;
	virtual MRESULT __stdcall Close( )																		= 0;
	virtual MRESULT __stdcall Length( uint32 *total, uint32 *available )									= 0;
	virtual MRESULT __stdcall SyncRead( uint32 dwOffset, void* pData, uint32 length, uint32* pBytesRead )	= 0;
	virtual bool	__stdcall CanSeek( )																	= 0;
	virtual MRESULT __stdcall GetStreamOffset( uint32* StreamOffset )										= 0;
	virtual MRESULT __stdcall SetStreamOffset( uint32 Offset )												= 0;
};

typedef enum { Callback_RenderStarted = 11, Callback_RenderComplete = 1, Callback_StreamIDChanged = 2, Callback_InstanceIDChanged = 9, Callback_RenderStopped = 3, Callback_FormatChangeUnacceptable = 4, Callback_StickyInformationChanged = 5, Callback_LastPacketDecoded = 6, Callback_Notification = 7, Callback_Seeked = 8, Callback_Repeated = 10 } CallbackEvent;
class MMediaCallback : public MGeneric
{
public:
	virtual void __stdcall Callback( MMediaChain* pChain, CallbackEvent Event, uint32 ID, MRESULT reason )	= 0;
};

// {009ECF12-6EA3-479a-833D-D3AC3CBD2762}
DEFINE_MID(MID_MEDIAEVENTS, 0x9ecf12, 0x6ea3, 0x479a, 0x83, 0x3d, 0xd3, 0xac, 0x3c, 0xbd, 0x27, 0x62);

class MMediaEvents : public MGeneric
{
public:
	virtual MRESULT __stdcall RegisterCallback( MMediaCallback* pCallback, uint32 ID )						= 0;
	virtual MRESULT __stdcall UnregisterCallback( MMediaCallback* pCallback, uint32 ID )					= 0;
};

// {56063664-DFE2-4a78-A449-467DFEFBDFC5}
DEFINE_MID(MID_MEDIANOTIFICATION, 0x56063664, 0xdfe2, 0x4a78, 0xa4, 0x49, 0x46, 0x7d, 0xfe, 0xfb, 0xdf, 0xc5);

class MMediaNotification : public MGeneric
{
public:
	virtual MRESULT __stdcall RegisterNotification( MMediaCallback* pCallback, uint32 Instance, double lfTime, uint32 ID )	= 0;
	virtual MRESULT __stdcall CancelNotification( MMediaCallback* pCallback, uint32 Instance, double lfTime, uint32 ID )		= 0;
};

// {405965D2-A8F7-4316-AA24-DD83463AC6D1}
DEFINE_MID(MID_MEDIACHAIN, 0x405965d2, 0xa8f7, 0x4316, 0xaa, 0x24, 0xdd, 0x83, 0x46, 0x3a, 0xc6, 0xd1);

class MMediaChain : public MMediaEvents, public MMediaNotification, public MMediaSettings
{
public:
	virtual MRESULT __stdcall RegisterStream( MMediaStream* pStream )										= 0;
	virtual MRESULT __stdcall RegisterFilter( MMediaFilter* pFilter )										= 0;
	virtual MRESULT __stdcall RegisterDSPFilter( MMediaFilter* pDSPFilter )									= 0;
	virtual MRESULT __stdcall RegisterMetaFilter( MMediaFilter* pFilter )									= 0;
	virtual MRESULT __stdcall ReleaseUnusedComponents( )													= 0;
	virtual MRESULT __stdcall SetEndpoint( MMediaFilter* pEndpoint )										= 0;
	virtual MRESULT __stdcall WaitForReady( double PlayBufferLevel )										= 0;
	virtual MRESULT __stdcall PlayWhenReady( double PlayBufferLevel )										= 0;
	virtual MRESULT __stdcall BuildChain( const wchar_t* wsURL, int32 MaxScanLevel = 0x7FFFFFFF )			= 0;
	virtual MRESULT __stdcall ClearChain( )																	= 0;
	virtual MRESULT __stdcall AddFilter( MMediaFilter* pFilter )											= 0;
	virtual MRESULT __stdcall SetState( MediaState State )													= 0;
	//State of the chain for playback is undefined after a call to GatherInformation. You need to reset(stop) or destroy it. You must not be in stop to call it.
	virtual MRESULT __stdcall GatherInformation( InformationHint Hint )										= 0;
	virtual MRESULT __stdcall Seek( double tTime, bool bAccurately, bool bFlush )							= 0;
	virtual MRESULT __stdcall Flush()                                           							= 0;

	virtual MRESULT __stdcall LoadSettings( MPreferences* pPrefs )											= 0;

	virtual MRESULT __stdcall EnumerateChain( MMediaFilter** ppToHere )										= 0;
	virtual MRESULT __stdcall GetOutputControl( MMediaOutputControl** ppToHere )							= 0;
	virtual MRESULT __stdcall SetStreamID( uint32 lStreamID, uint32 lInstanceID )							= 0;

	virtual MRESULT __stdcall GetStringInfo( const wchar_t* wsWhich, WString& wsToHere )					= 0;
	virtual MRESULT __stdcall GetIntegerInfo( const wchar_t* wsWhich, int32& lToHere )						= 0;
	virtual MRESULT __stdcall GetRealInfo( const wchar_t* wsWhich, double& lfToHere )						= 0;
	virtual MRESULT __stdcall EnumerateInformation( Array<MediaInfo>& Info )								= 0;

	virtual MRESULT __stdcall SetStringInfo( const wchar_t* wsWhich, const WString& Info )					= 0;
	virtual MRESULT __stdcall SetIntegerInfo( const wchar_t* wsWhich, int32 Info )							= 0;
	virtual MRESULT __stdcall SetRealInfo( const wchar_t* wsWhich, double Info )							= 0;

	//MGeneric
	virtual uint32  __stdcall AddRef()																		= 0;
	virtual uint32  __stdcall Release()																										= 0;
	virtual MRESULT __stdcall QueryModule(const MID& iid, void** ppv, bool bAddReference = true, const MGeneric* pPrev = NULL )				= 0;
	
};

// {18366D2B-474A-4284-845C-77752BB59EC9}
DEFINE_MID(MID_PACKETPOOL, 0x18366d2b, 0x474a, 0x4284, 0x84, 0x5c, 0x77, 0x75, 0x2b, 0xb5, 0x9e, 0xc9);

class MPacketPool : public MGeneric
{
public:
	virtual MRESULT NewPacket( RefPtr<MPacket>& toHere, uint32 Size )	= 0;
	virtual MRESULT NewPacket( RefPtr<MPacket>& toHere, uint32 Size, const MPacket* pCopyDetailsFrom )	= 0;
};

// {CA04F8EE-B758-42db-ACA8-2EDE969B852C}
DEFINE_MID(MID_FORMATCONVERTER, 0xca04f8ee, 0xb758, 0x42db, 0xac, 0xa8, 0x2e, 0xde, 0x96, 0x9b, 0x85, 0x2c);

class MFormatConverter : public MMediaFilter
{
public:
	virtual MRESULT __stdcall SetDestinationFormat( MMediaFormat* pFormat )									= 0;
};



class MScriptObject;
class MAudioSettings : public MGeneric
{
public:
	virtual MRESULT	__stdcall Init(MPreferences* pPrefs)													= 0;
	virtual MRESULT	__stdcall InitScript(MScriptObject* pParent)													= 0;
	virtual void	__stdcall Deinit()																		= 0;
};

enum
{
	ERR_MEDIA_ALREADYINTHISSTATE,
	ERR_MEDIA_NOENDPOINTSELECTED,
	ERR_MEDIA_NOSUITABLESTREAMFOUND,
	ERR_MEDIA_CHAINCONNECTIONFAILED,
	ERR_MEDIA_CHAININCOMPLETE,
	ERR_MEDIA_NOTVALIDINTHISSTATE,
	ERR_MEDIA_UNKNOWNSTATE,
	ERR_MEDIA_INCOMPATIBLEFORMAT,
	ERR_MEDIA_NOTATTACHEDTOCHAIN,
	ERR_MEDIA_NOMOREPACKETS,
	ERR_MEDIA_FORMATUNSUPPORTED,
	ERR_MEDIA_SEEKINGIMPOSSIBLE,
	ERR_MEDIA_SOUNDDEVICEFAILED,
	ERR_MEDIA_INCOMPLETECHAIN,
	ERR_MEDIA_UNSUPPORTEDMEDIATYPE,
   	ERR_MEDIA_UNSUPPORTEDOUTPUTTYPE,
	ERR_MEDIA_CHAINBUILDFAILED_FILTER_GETINPUTFAILED,
	ERR_MEDIA_CHAINBUILDFAILED_FILTER_GETOUTPUTFAILED,
	ERR_MEDIA_CHAINBUILDFAILED_FILTER_STATECHANGEFAILED,
	ERR_MEDIA_CHAINBUILDFAILED_FILTER_FORMATDETECTIONSTATECHANGEFAILED,
	ERR_MEDIA_CHAINBUILDFAILED_FILTER_CANHANDLEFAILED,
	ERR_MEDIA_FILTER_REGISTERCALLBACKFAILED,
	ERR_MEDIA_CHAINBUILDFAILED_ENDPOINT_FORMATDETECTIONSTATECHANGEFAILED,
	ERR_MEDIA_CHAINBUILDFAILED_ENDPOINT_GETINPUTFAILED,
	ERR_MEDIA_CHAINBUILDFAILED_ENDPOINT_CANHANDLEFAILED,
    ERR_MEDIA_SCANLEVELTOOHIGH,
	ERR_MEDIA__NUM
};

#define ERR_MEDIA__MODULE "MediaSystem"

inline MError* GetMediaErrors(MError* Errors)
{
	Errors[ERR_MEDIA_ALREADYINTHISSTATE].Name		=	"the audio system is already in this state";
	Errors[ERR_MEDIA_NOENDPOINTSELECTED].Name		=	"no final destination was selected for the media to arrive at";
	Errors[ERR_MEDIA_NOSUITABLESTREAMFOUND].Name	=	"no stream reader was found which could read this stream";
	Errors[ERR_MEDIA_CHAINCONNECTIONFAILED].Name	=	"a module refused to be inserted into the media chain";
	Errors[ERR_MEDIA_CHAININCOMPLETE].Name			=	"an incomplete chain can't be used";
	Errors[ERR_MEDIA_NOTVALIDINTHISSTATE].Name		=	"the operation you attempted is only valid in a state which the chain currently is not in";
	Errors[ERR_MEDIA_UNKNOWNSTATE].Name				=	"the state you asked the system to transition into is unknown by one or more of the components";
	Errors[ERR_MEDIA_INCOMPATIBLEFORMAT].Name		=	"the format a module is providing is incompatible with the module it is providing it to";
	Errors[ERR_MEDIA_NOTATTACHEDTOCHAIN].Name		=	"the module was unable to perform the requested function as it needs to be attached to a chain to do so";
	Errors[ERR_MEDIA_NOMOREPACKETS].Name			=	"no more packets were available downstream to complete the request";
	Errors[ERR_MEDIA_FORMATUNSUPPORTED].Name		=	"this action is unsupported while decoding data of the current format and source";
	Errors[ERR_MEDIA_SEEKINGIMPOSSIBLE].Name		=	"the current format or source doesn't support seeking";
	Errors[ERR_MEDIA_SOUNDDEVICEFAILED].Name		=	"the sound device was unable to complete this request";
	Errors[ERR_MEDIA_INCOMPLETECHAIN].Name			=	"the chain could not be completely built for this data stream";
	Errors[ERR_MEDIA_UNSUPPORTEDMEDIATYPE].Name		=	"there is no plugin which can handle this media type";
	Errors[ERR_MEDIA_UNSUPPORTEDOUTPUTTYPE].Name	=	"the output device is unable to handle audio of the format that the decoder provides";

	Errors[ERR_MEDIA_CHAINBUILDFAILED_FILTER_GETINPUTFAILED].Name						= "the audio chain could not be built because a filter's GetInput method failed";
	Errors[ERR_MEDIA_CHAINBUILDFAILED_FILTER_GETOUTPUTFAILED].Name						= "the audio chain could not be built because a filter's GetOutput method failed";
	Errors[ERR_MEDIA_CHAINBUILDFAILED_FILTER_STATECHANGEFAILED].Name					= "the audio chain could not be built because a filter's StateChange method failed";
	Errors[ERR_MEDIA_CHAINBUILDFAILED_FILTER_FORMATDETECTIONSTATECHANGEFAILED].Name		= "the audio chain could not be built because a filter's StateChange method for the format detection state failed";
	Errors[ERR_MEDIA_CHAINBUILDFAILED_FILTER_CANHANDLEFAILED].Name						= "the audio chain could not be built because a filter's CanHandle method failed";
	Errors[ERR_MEDIA_FILTER_REGISTERCALLBACKFAILED].Name								= "the audio chain could not be built because a filter's RegisterCallback method failed";
	Errors[ERR_MEDIA_CHAINBUILDFAILED_ENDPOINT_FORMATDETECTIONSTATECHANGEFAILED].Name	= "the audio chain could not be built because an endpoints's StateChange method for the format detection state failed";
	Errors[ERR_MEDIA_CHAINBUILDFAILED_ENDPOINT_GETINPUTFAILED].Name						= "the audio chain could not be built because an endpoints's GetInput method failed";
	Errors[ERR_MEDIA_CHAINBUILDFAILED_ENDPOINT_CANHANDLEFAILED].Name					= "the audio chain could not be built because an endpoints's CanHandle method failed";

    Errors[ERR_MEDIA_SCANLEVELTOOHIGH].Name                                             = "this media type is too difficult to scan for information";
	return Errors;
}

#endif//_MEDIAFILTER_H_
