]> git.saurik.com Git - wxWidgets.git/blame - utils/wxMMedia/mmsolve.h
New way to grey out disabled toolbar icons.
[wxWidgets.git] / utils / wxMMedia / mmsolve.h
CommitLineData
4d6306eb
GL
1// /////////////////////////////////////////////////////////////////////////////
2// Name: mmsolve.h
3// Purpose: wxMMedia
4// Author: Guilhem Lavaux
5// Created: 1997
6// Updated: 1998
7// Copyright: (C) 1997, 1998, Guilhem Lavaux
8// License: wxWindows license
9// /////////////////////////////////////////////////////////////////////////////
10#ifndef __MMD_solve_H__
11#define __MMD_solve_H__
12#ifdef __GNUG__
13#pragma interface
14#endif
15
16#ifdef WX_PRECOMP
17#include "wx/wxprec.h"
18#else
19#include "wx/wx.h"
20#endif
21#include "mmfile.h"
22
23/** @name Solver classes */
24//@{
25
26typedef wxMMediaFile *(*wxMediaFileCreator)();
27
28/** wxMediaFileSolve is a class to do name resolution on multimedia files
29 * @memo Multimedia file solver
30 * @author Guilhem Lavaux
31 */
32class WXDLLEXPORT wxMediaFileSolve : public wxObject {
33protected:
34 typedef struct wxMFileList {
35 wxMediaFileCreator creator;
36 wxString mime_type, name, ext;
37 wxMFileList *next;
38 } wxMFileList;
39
40 static wxMFileList *m_first;
41 static wxUint8 m_devnum;
42
43 friend class wxMMDfileRegister;
44public:
45 wxMediaFileSolve() : wxObject() {}
46 ~wxMediaFileSolve() {}
47
48 /** It resolves using the extension of the specified filename
49 * @memo
50 * @return the multimedia codec
51 * @param filename
52 */
53 static wxMMediaFile *ByExtension(const wxString& filename);
54
55 /** It resolves using the real name of a codec
56 * @memo
57 * @return the multimedia codec
58 * @param devname
59 */
60 static wxMMediaFile *ByName(const wxString& devname);
61
62 /** It resolves using a mime type
63 * @memo
64 * @return the multimedia codec
65 * @param mimetype
66 */
67 static wxMMediaFile *ByType(const wxString& mimetype);
68
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
71 * @memo
72 * @return nothing
73 * @param names an array
74 * @param devices
75 */
76 static void ListMDevice(wxString*& names, wxUint8& devices);
77};
78
79///
80class wxMMDfileRegister {
81public:
82 ///
83 wxMMDfileRegister(wxMediaFileCreator cbk, char *mtype, char *ext, char *name);
84};
85
86#define MMD_REGISTER_FILE(mtype, name, class, ext) \
87static wxMMediaFile *wxMediaFileConstructor_##class() { return new class(); } \
88wxMMDfileRegister mmd_##class(wxMediaFileConstructor_##class, mtype, ext, name);
89
90//@}
91
92#endif