]>
Commit | Line | Data |
---|---|---|
e8482f24 GL |
1 | // ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: vidxanm.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 | /* Real -*- C++ -*- */ | |
11 | #ifndef __VID_xanim_H__ | |
12 | #define __VID_xanim_H__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface "vidxanm.h" | |
16 | #endif | |
17 | ||
18 | // ---------------------------------------------------------------------------- | |
19 | // headers | |
20 | // ---------------------------------------------------------------------------- | |
21 | // For compilers that support precompilation, includes "wx/wx.h". | |
22 | #include "wx/wxprec.h" | |
23 | ||
24 | #ifdef __BORLANDC__ | |
25 | #pragma hdrstop | |
26 | #endif | |
27 | ||
28 | // for all others, include the necessary headers (this file is usually all you | |
be5a51fb | 29 | // need because it includes almost all "standard" wxWidgets headers |
e8482f24 GL |
30 | #ifndef WX_PRECOMP |
31 | #include "wx/defs.h" | |
32 | #include "wx/string.h" | |
33 | #include "wx/process.h" | |
34 | #endif | |
35 | ||
36 | // ---------------------------------------------------------------------------- | |
37 | // System dependent headers | |
38 | ||
39 | #if defined(WXMMEDIA_INTERNAL) && (defined(__X__) || defined(__WXGTK__)) | |
40 | #include <X11/Xlib.h> | |
41 | #include <X11/Xatom.h> | |
42 | #endif | |
43 | ||
44 | // ---------------------------------------------------------------------------- | |
45 | // wxMMedia2 headers | |
46 | ||
15e8daec | 47 | #include "wx/mmedia/defs.h" |
e8482f24 GL |
48 | #include "wx/mmedia/vidbase.h" |
49 | ||
50 | // ---------------------------------------------------------------------------- | |
51 | // Internal types | |
52 | ||
53 | #ifdef WXMMEDIA_INTERNAL | |
54 | typedef struct wxXANIMinternal { | |
55 | Display *xanim_dpy; | |
56 | Window xanim_window; | |
57 | Atom xanim_atom, xanim_ret; | |
58 | } wxXANIMinternal; | |
59 | ||
60 | #ifndef __XANIM_COMMAND__ | |
61 | #define __XANIM_COMMAND__ "/usr/X11R6/bin/xanim" | |
62 | #endif | |
63 | ||
64 | #endif | |
65 | ||
66 | // ---------------------------------------------------------------------------- | |
67 | // Class definition | |
68 | ||
15e8daec | 69 | class WXDLLIMPEXP_MMEDIA wxVideoXANIM : public wxVideoBaseDriver { |
e8482f24 GL |
70 | DECLARE_DYNAMIC_CLASS(wxVideoXANIM) |
71 | protected: | |
72 | // Remember the state of the subprocess | |
73 | bool m_xanim_started, m_paused; | |
74 | // Pure X11 variables | |
75 | struct wxXANIMinternal *m_internal; | |
76 | wxString m_filename; | |
77 | wxProcess *m_xanim_detector; | |
78 | // Remember to delete the temporary file when necessary | |
79 | bool m_remove_file; | |
80 | wxUint32 m_size[2]; | |
81 | wxUint32 m_sampleRate; | |
82 | wxUint8 m_channels; | |
83 | wxUint8 m_bps; | |
84 | wxUint32 m_frames; | |
85 | double m_frameRate; | |
86 | wxString m_movieCodec, m_audioCodec; | |
87 | ||
88 | public: | |
89 | wxVideoXANIM(); | |
90 | wxVideoXANIM(wxInputStream& str); | |
91 | wxVideoXANIM(const wxString& filename); | |
92 | ~wxVideoXANIM(); | |
93 | ||
94 | bool Play(); | |
95 | bool Pause(); | |
96 | bool Resume(); | |
97 | bool Stop(); | |
98 | ||
99 | bool SetVolume(wxUint8 vol); | |
100 | bool SetSize(wxSize size); | |
101 | bool GetSize(wxSize& size) const; | |
102 | ||
103 | // Return the video codec name | |
104 | wxString GetMovieCodec() const; | |
105 | // Return the audio codec name | |
106 | wxString GetAudioCodec() const; | |
107 | // Return misc info about audio | |
108 | wxUint32 GetSampleRate() const; | |
109 | wxUint8 GetChannels() const; | |
110 | wxUint8 GetBPS() const; | |
111 | // Return frame rate | |
112 | double GetFrameRate() const; | |
113 | // Return number of frames in the movie | |
114 | wxUint32 GetNbFrames() const; | |
115 | ||
116 | bool IsCapable(wxVideoType v_type) const; | |
117 | ||
118 | bool AttachOutput(wxWindow& output); | |
119 | void DetachOutput(); | |
120 | ||
121 | bool IsPaused() const; | |
122 | bool IsStopped() const; | |
123 | ||
124 | friend class wxVideoXANIMProcess; | |
125 | ||
126 | protected: | |
127 | // Start the subprocess with the right parameters | |
128 | bool RestartXANIM(); | |
129 | // Send a command to the subprocess | |
130 | bool SendCommand(const char *command,char **ret = NULL, | |
131 | wxUint32 *size = NULL); | |
132 | ||
133 | // Collect informations from XAnim | |
134 | bool CollectInfo(); | |
135 | }; | |
136 | ||
137 | #endif |