00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #pragma once
00023
00024 #include <atlbase.h>
00025 #include "..\..\..\..\include\winddk\devioctl.h"
00026 #include "..\..\..\..\include\winddk\ntddcdrm.h"
00027 #include <qnetwork.h>
00028 #include "..\asyncreader\asyncio.h"
00029 #include "..\asyncreader\asyncrdr.h"
00030
00031 typedef struct {UINT chunkID; long chunkSize;} ChunkHeader;
00032
00033 #define RIFFID 'FFIR'
00034 #define WAVEID 'EVAW'
00035 typedef struct {ChunkHeader hdr; UINT WAVE;} RIFFChunk;
00036
00037 #define FormatID ' tmf'
00038 typedef struct {ChunkHeader hdr; PCMWAVEFORMAT pcm;} FormatChunk;
00039
00040 #define DataID 'atad'
00041 typedef struct {ChunkHeader hdr;} DataChunk;
00042
00043 typedef struct {RIFFChunk riff; FormatChunk frm; DataChunk data;} WAVEChunck;
00044
00045 class CCDDAStream : public CAsyncStream
00046 {
00047 private:
00048 CCritSec m_csLock;
00049
00050 LONGLONG m_llPosition, m_llLength;
00051
00052 HANDLE m_hDrive;
00053 CDROM_TOC m_TOC;
00054 UINT m_nFirstSector, m_nStartSector, m_nStopSector;
00055
00056 WAVEChunck m_header;
00057
00058 public:
00059 CCDDAStream();
00060 virtual ~CCDDAStream();
00061
00062 CString m_discTitle, m_trackTitle;
00063 CString m_discArtist, m_trackArtist;
00064
00065 bool Load(const WCHAR* fnw);
00066
00067
00068 HRESULT SetPointer(LONGLONG llPos);
00069 HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
00070 LONGLONG Size(LONGLONG* pSizeAvailable);
00071 DWORD Alignment();
00072 void Lock();
00073 void Unlock();
00074 };
00075
00076 [uuid("54A35221-2C8D-4a31-A5DF-6D809847E393")]
00077 class CCDDAReader
00078 : public CAsyncReader
00079 , public IFileSourceFilter
00080 , public IAMMediaContent
00081 {
00082 CCDDAStream m_stream;
00083 CStringW m_fn;
00084
00085 public:
00086 CCDDAReader(IUnknown* pUnk, HRESULT* phr);
00087 ~CCDDAReader();
00088
00089 DECLARE_IUNKNOWN;
00090 STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
00091
00092
00093
00094 STDMETHODIMP Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt);
00095 STDMETHODIMP GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt);
00096
00097
00098
00099 STDMETHODIMP GetTypeInfoCount(UINT* pctinfo);
00100 STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
00101 STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR** rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
00102 STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pdispparams, VARIANT* pvarResult, EXCEPINFO* pexcepinfo, UINT* puArgErr);
00103
00104 STDMETHODIMP get_AuthorName(BSTR* pbstrAuthorName);
00105 STDMETHODIMP get_Title(BSTR* pbstrTitle);
00106 STDMETHODIMP get_Rating(BSTR* pbstrRating);
00107 STDMETHODIMP get_Description(BSTR* pbstrDescription);
00108 STDMETHODIMP get_Copyright(BSTR* pbstrCopyright);
00109 STDMETHODIMP get_BaseURL(BSTR* pbstrBaseURL);
00110 STDMETHODIMP get_LogoURL(BSTR* pbstrLogoURL);
00111 STDMETHODIMP get_LogoIconURL(BSTR* pbstrLogoURL);
00112 STDMETHODIMP get_WatermarkURL(BSTR* pbstrWatermarkURL);
00113 STDMETHODIMP get_MoreInfoURL(BSTR* pbstrMoreInfoURL);
00114 STDMETHODIMP get_MoreInfoBannerImage(BSTR* pbstrMoreInfoBannerImage);
00115 STDMETHODIMP get_MoreInfoBannerURL(BSTR* pbstrMoreInfoBannerURL);
00116 STDMETHODIMP get_MoreInfoText(BSTR* pbstrMoreInfoText);
00117 };
00118