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