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