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