]> git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia/mmfile.h
Added test for sprintf and vsnprintf to fix string.cpp for non-GNU systems.
[wxWidgets.git] / utils / wxMMedia / mmfile.h
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
17 #ifdef WX_PRECOMP
18 #include "wx_prec.h"
19 #else
20 #include "wx/wx.h"
21 #endif
22 #include "wx/string.h"
23 #include "wx/stream.h"
24 #include "mmtype.h"
25
26 ///
27 typedef enum {
28 wxMMFILE_NOERROR,
29 wxMMFILE_INVALID,
30 wxMMFILE_EOF
31 } ///
32 wxMMFileError;
33
34 typedef struct {
35 wxInt8 hours;
36 wxUint8 minutes, seconds;
37 } wxMMtime;
38
39 /// Common base class for multimedia file.
40 class wxMMediaFile {
41 public:
42 wxMMediaFile();
43 ///
44 wxMMediaFile(wxInputStream& is, bool preload, bool seekable);
45 ///
46 wxMMediaFile(wxOutputStream& is, bool seekable);
47 ///
48 wxMMediaFile(const wxString& fname);
49 ///
50 virtual ~wxMMediaFile();
51
52 ///
53 wxInputStream *GetIRawData();
54 wxOutputStream *GetORawData();
55 ///
56 wxString GetCurrentFile();
57
58 ///
59 virtual void SetFile(wxInputStream& is,
60 bool preload = FALSE, bool seekable = FALSE);
61 ///
62 virtual void SetFile(wxOutputStream& is, bool seekable = FALSE);
63 ///
64 void SetFile(const wxString& fname);
65
66 ///
67 wxMMFileError GetFileError() const { return m_mmerror; }
68 ///
69 virtual wxMMtime GetLength();
70 ///
71 virtual wxMMtime GetPosition();
72 ///
73 virtual bool StartPlay() = 0;
74 ///
75 virtual void StopPlay() = 0;
76 protected:
77 ///
78 wxMMFileError m_mmerror;
79 ///
80 wxInputStream *m_istream, *m_i_temp;
81 ///
82 wxOutputStream *m_ostream, *m_o_temp;
83 ///
84 wxString m_tmpfname, m_mfname;
85 ///
86 bool m_seekable;
87
88 ///
89 void CacheIO();
90 ///
91 void CleanUpPrevious();
92 };
93
94 #endif