]>
Commit | Line | Data |
---|---|---|
4d6306eb GL |
1 | // ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: mmfile.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_file_H__ | |
11 | #define __MMD_file_H__ | |
12 | ||
13 | #ifdef __GNUG__ | |
14 | #pragma interface | |
15 | #endif | |
16 | ||
4d6306eb GL |
17 | #include "wx/string.h" |
18 | #include "wx/stream.h" | |
19 | #include "mmtype.h" | |
20 | ||
21 | /// | |
22 | typedef enum { | |
23 | wxMMFILE_NOERROR, | |
24 | wxMMFILE_INVALID, | |
25 | wxMMFILE_EOF | |
26 | } /// | |
27 | wxMMFileError; | |
28 | ||
29 | typedef struct { | |
30 | wxInt8 hours; | |
31 | wxUint8 minutes, seconds; | |
32 | } wxMMtime; | |
33 | ||
34 | /// Common base class for multimedia file. | |
35 | class wxMMediaFile { | |
36 | public: | |
37 | wxMMediaFile(); | |
38 | /// | |
39 | wxMMediaFile(wxInputStream& is, bool preload, bool seekable); | |
40 | /// | |
41 | wxMMediaFile(wxOutputStream& is, bool seekable); | |
42 | /// | |
43 | wxMMediaFile(const wxString& fname); | |
44 | /// | |
45 | virtual ~wxMMediaFile(); | |
46 | ||
47 | /// | |
48 | wxInputStream *GetIRawData(); | |
49 | wxOutputStream *GetORawData(); | |
50 | /// | |
51 | wxString GetCurrentFile(); | |
52 | ||
53 | /// | |
54 | virtual void SetFile(wxInputStream& is, | |
55 | bool preload = FALSE, bool seekable = FALSE); | |
56 | /// | |
57 | virtual void SetFile(wxOutputStream& is, bool seekable = FALSE); | |
58 | /// | |
59 | void SetFile(const wxString& fname); | |
60 | ||
61 | /// | |
62 | wxMMFileError GetFileError() const { return m_mmerror; } | |
63 | /// | |
64 | virtual wxMMtime GetLength(); | |
65 | /// | |
66 | virtual wxMMtime GetPosition(); | |
67 | /// | |
68 | virtual bool StartPlay() = 0; | |
69 | /// | |
70 | virtual void StopPlay() = 0; | |
71 | protected: | |
72 | /// | |
73 | wxMMFileError m_mmerror; | |
74 | /// | |
75 | wxInputStream *m_istream, *m_i_temp; | |
76 | /// | |
77 | wxOutputStream *m_ostream, *m_o_temp; | |
78 | /// | |
79 | wxString m_tmpfname, m_mfname; | |
80 | /// | |
81 | bool m_seekable; | |
82 | ||
83 | /// | |
84 | void CacheIO(); | |
85 | /// | |
86 | void CleanUpPrevious(); | |
87 | }; | |
88 | ||
89 | #endif |