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__
15 #pragma interface "vidxanm.h"
18 // ----------------------------------------------------------------------------
20 // ----------------------------------------------------------------------------
21 // For compilers that support precompilation, includes "wx/wx.h".
22 #include "wx/wxprec.h"
28 #include "wx/process.h"
30 // for all others, include the necessary headers (this file is usually all you
31 // need because it includes almost all "standard" wxWidgets headers
34 #include "wx/string.h"
37 // ----------------------------------------------------------------------------
38 // System dependent headers
40 #if defined(WXMMEDIA_INTERNAL) && (defined(__X__) || defined(__WXGTK__))
42 #include <X11/Xatom.h>
45 // ----------------------------------------------------------------------------
48 #include "wx/mmedia/defs.h"
49 #include "wx/mmedia/vidbase.h"
51 // ----------------------------------------------------------------------------
54 #ifdef WXMMEDIA_INTERNAL
55 typedef struct wxXANIMinternal
{
58 Atom xanim_atom
, xanim_ret
;
61 #ifndef __XANIM_COMMAND__
62 #define __XANIM_COMMAND__ "/usr/X11R6/bin/xanim"
67 // ----------------------------------------------------------------------------
70 class WXDLLIMPEXP_MMEDIA wxVideoXANIM
: public wxVideoBaseDriver
{
71 DECLARE_DYNAMIC_CLASS(wxVideoXANIM
)
73 // Remember the state of the subprocess
74 bool m_xanim_started
, m_paused
;
76 struct wxXANIMinternal
*m_internal
;
78 wxProcess
*m_xanim_detector
;
79 // Remember to delete the temporary file when necessary
82 wxUint32 m_sampleRate
;
87 wxString m_movieCodec
, m_audioCodec
;
91 wxVideoXANIM(wxInputStream
& str
);
92 wxVideoXANIM(const wxString
& filename
);
100 bool SetVolume(wxUint8 vol
);
101 bool SetSize(wxSize size
);
102 bool GetSize(wxSize
& size
) const;
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;
113 double GetFrameRate() const;
114 // Return number of frames in the movie
115 wxUint32
GetNbFrames() const;
117 bool IsCapable(wxVideoType v_type
) const;
119 bool AttachOutput(wxWindow
& output
);
122 bool IsPaused() const;
123 bool IsStopped() const;
125 friend class wxVideoXANIMProcess
;
128 // Start the subprocess with the right parameters
130 // Send a command to the subprocess
131 bool SendCommand(const char *command
,char **ret
= NULL
,
132 wxUint32
*size
= NULL
);
134 // Collect informations from XAnim