1 // /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
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__
14 // ----------------------------------------------------------------------------
16 // ----------------------------------------------------------------------------
17 // For compilers that support precompilation, includes "wx/wx.h".
18 #include "wx/wxprec.h"
24 #include "wx/process.h"
26 // for all others, include the necessary headers (this file is usually all you
27 // need because it includes almost all "standard" wxWidgets headers
30 #include "wx/string.h"
33 // ----------------------------------------------------------------------------
34 // System dependent headers
36 #if defined(WXMMEDIA_INTERNAL) && (defined(__X__) || defined(__WXGTK__))
38 #include <X11/Xatom.h>
41 // ----------------------------------------------------------------------------
44 #include "wx/mmedia/defs.h"
45 #include "wx/mmedia/vidbase.h"
47 // ----------------------------------------------------------------------------
50 #ifdef WXMMEDIA_INTERNAL
51 typedef struct wxXANIMinternal
{
54 Atom xanim_atom
, xanim_ret
;
57 #ifndef __XANIM_COMMAND__
58 #define __XANIM_COMMAND__ "/usr/X11R6/bin/xanim"
63 // ----------------------------------------------------------------------------
66 class WXDLLIMPEXP_MMEDIA wxVideoXANIM
: public wxVideoBaseDriver
{
67 DECLARE_DYNAMIC_CLASS(wxVideoXANIM
)
69 // Remember the state of the subprocess
70 bool m_xanim_started
, m_paused
;
72 struct wxXANIMinternal
*m_internal
;
74 wxProcess
*m_xanim_detector
;
75 // Remember to delete the temporary file when necessary
78 wxUint32 m_sampleRate
;
83 wxString m_movieCodec
, m_audioCodec
;
87 wxVideoXANIM(wxInputStream
& str
);
88 wxVideoXANIM(const wxString
& filename
);
96 bool SetVolume(wxUint8 vol
);
97 bool SetSize(wxSize size
);
98 bool GetSize(wxSize
& size
) const;
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;
109 double GetFrameRate() const;
110 // Return number of frames in the movie
111 wxUint32
GetNbFrames() const;
113 bool IsCapable(wxVideoType v_type
) const;
115 bool AttachOutput(wxWindow
& output
);
118 bool IsPaused() const;
119 bool IsStopped() const;
121 friend class wxVideoXANIMProcess
;
124 // Start the subprocess with the right parameters
126 // Send a command to the subprocess
127 bool SendCommand(const char *command
,char **ret
= NULL
,
128 wxUint32
*size
= NULL
);
130 // Collect informations from XAnim