1 // /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
8 // License: wxWindows license
9 // /////////////////////////////////////////////////////////////////////////////
10 #ifndef __MMD_solve_H__
11 #define __MMD_solve_H__
17 #include "wx/wxprec.h"
23 /** @name Solver classes */
26 typedef wxMMediaFile
*(*wxMediaFileCreator
)();
28 /** wxMediaFileSolve is a class to do name resolution on multimedia files
29 * @memo Multimedia file solver
30 * @author Guilhem Lavaux
32 class WXDLLEXPORT wxMediaFileSolve
: public wxObject
{
34 typedef struct wxMFileList
{
35 wxMediaFileCreator creator
;
36 wxString mime_type
, name
, ext
;
40 static wxMFileList
*m_first
;
41 static wxUint8 m_devnum
;
43 friend class wxMMDfileRegister
;
45 wxMediaFileSolve() : wxObject() {}
46 ~wxMediaFileSolve() {}
48 /** It resolves using the extension of the specified filename
50 * @return the multimedia codec
53 static wxMMediaFile
*ByExtension(const wxString
& filename
);
55 /** It resolves using the real name of a codec
57 * @return the multimedia codec
60 static wxMMediaFile
*ByName(const wxString
& devname
);
62 /** It resolves using a mime type
64 * @return the multimedia codec
67 static wxMMediaFile
*ByType(const wxString
& mimetype
);
69 /** It lists all codecs currently registered in "names". "names" is allocated
70 * by it and devices returns the number of codecs the list contains
73 * @param names an array
76 static void ListMDevice(wxString
*& names
, wxUint8
& devices
);
80 class wxMMDfileRegister
{
83 wxMMDfileRegister(wxMediaFileCreator cbk
, char *mtype
, char *ext
, char *name
);
86 #define MMD_REGISTER_FILE(mtype, name, class, ext) \
87 static wxMMediaFile *wxMediaFileConstructor_##class() { return new class(); } \
88 wxMMDfileRegister mmd_##class(wxMediaFileConstructor_##class, mtype, ext, name);