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 <atlcoll.h>
00025 #include "BaseGraph.h"
00026
00027 class CMediaFormatCategory
00028 {
00029 public:
00030 protected:
00031 CString m_label, m_specreqnote;
00032 CList<CString> m_exts, m_backupexts;
00033 bool m_fAudioOnly;
00034 engine_t m_engine;
00035
00036 public:
00037 CMediaFormatCategory();
00038 CMediaFormatCategory(
00039 CString label, CList<CString>& exts, bool fAudioOnly = false,
00040 CString specreqnote = _T(""), engine_t e = DirectShow);
00041 CMediaFormatCategory(
00042 CString label, CString exts, bool fAudioOnly = false,
00043 CString specreqnote = _T(""), engine_t e = DirectShow);
00044 virtual ~CMediaFormatCategory();
00045
00046 void UpdateData(bool fSave);
00047
00048 CMediaFormatCategory(CMediaFormatCategory& mfc);
00049 CMediaFormatCategory& operator = (const CMediaFormatCategory& mfc);
00050
00051 void RestoreDefaultExts();
00052 void SetExts(CList<CString>& exts);
00053 void SetExts(CString exts);
00054
00055 bool FindExt(CString ext) {return m_exts.Find(ext.TrimLeft(_T(".")).MakeLower()) != NULL;}
00056
00057 CString GetLabel() {return m_label;}
00058 CString GetFilter();
00059 CString GetExts(bool fAppendEngine = false);
00060 CString GetExtsWithPeriod(bool fAppendEngine = false);
00061 CString GetBackupExtsWithPeriod(bool fAppendEngine = false);
00062 CString GetSpecReqNote() {return m_specreqnote;}
00063 bool IsAudioOnly() {return m_fAudioOnly;}
00064 engine_t GetEngineType() {return m_engine;}
00065 void SetEngineType(engine_t e) {m_engine = e;}
00066 };
00067
00068 class CMediaFormats : public CArray<CMediaFormatCategory>
00069 {
00070 protected:
00071 engine_t m_iRtspHandler;
00072 bool m_fRtspFileExtFirst;
00073
00074 public:
00075 CMediaFormats();
00076 virtual ~CMediaFormats();
00077
00078 void UpdateData(bool fSave);
00079
00080 engine_t GetRtspHandler(bool& fRtspFileExtFirst);
00081 void SetRtspHandler(engine_t e, bool fRtspFileExtFirst);
00082
00083 bool IsUsingEngine(CString path, engine_t e);
00084 engine_t GetEngine(CString path);
00085
00086 bool FindExt(CString ext, bool fAudioOnly = false);
00087 };