MediaFormats.h

00001 /* 
00002  *      Copyright (C) 2003-2005 Gabest
00003  *      http://www.gabest.org
00004  *
00005  *  This Program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2, or (at your option)
00008  *  any later version.
00009  *   
00010  *  This Program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00013  *  GNU General Public License for more details.
00014  *   
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with GNU Make; see the file COPYING.  If not, write to
00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 
00018  *  http://www.gnu.org/copyleft/gpl.html
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 };

Generated on Tue Dec 13 14:46:55 2005 for guliverkli by  doxygen 1.4.5