]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/mmedia/vidbase.h
reverted Robert's change
[wxWidgets.git] / contrib / include / wx / mmedia / vidbase.h
1 // /////////////////////////////////////////////////////////////////////////////
2 // Name: vidbase.h
3 // Purpose: wxMMedia
4 // Author: Guilhem Lavaux
5 // Created: 1997
6 // Updated: 1998
7 // Copyright: (C) 1997, 1998, Guilhem Lavaux
8 // CVS: $Id$
9 // License: wxWindows license
10 // /////////////////////////////////////////////////////////////////////////////
11 /* Real -*- C++ -*- */
12 #ifndef __VID_bdrv_H__
13 #define __VID_bdrv_H__
14
15 #ifdef __GNUG__
16 #pragma interface "vidbase.h"
17 #endif
18
19 // ----------------------------------------------------------------------------
20 // headers
21 // ----------------------------------------------------------------------------
22 // For compilers that support precompilation, includes "wx/wx.h".
23 #include "wx/wxprec.h"
24
25 #ifdef __BORLANDC__
26 #pragma hdrstop
27 #endif
28
29 // for all others, include the necessary headers (this file is usually all you
30 // need because it includes almost all "standard" wxWindows headers
31 #ifndef WX_PRECOMP
32 #include "wx/defs.h"
33 #include "wx/stream.h"
34 #include "wx/string.h"
35 #include "wx/window.h"
36 #include "wx/frame.h"
37 #endif
38
39 // ----------------------------------------------------------------------------
40 // wxMMedia2 (video) types
41
42 typedef enum {
43 wxVIDEO_MSAVI,
44 wxVIDEO_MPEG,
45 wxVIDEO_QT,
46 wxVIDEO_GIF,
47 wxVIDEO_JMOV,
48 wxVIDEO_FLI,
49 wxVIDEO_IFF,
50 wxVIDEO_SGI,
51 wxVIDEO_MPEG2
52 } wxVideoType;
53
54 // ----------------------------------------------------------------------------
55 // Classes definition
56
57 class WXDLLEXPORT wxVideoBaseDriver : public wxObject {
58 DECLARE_ABSTRACT_CLASS(wxVideoBaseDriver)
59 protected:
60 wxWindow *m_video_output;
61 public:
62 // Ctors
63 wxVideoBaseDriver();
64 wxVideoBaseDriver(wxInputStream& str);
65 wxVideoBaseDriver(const wxString& filename);
66 // Dtor
67 virtual ~wxVideoBaseDriver();
68
69 // Usual functions ... They all return FALSE in case of errors.
70 virtual bool Play() = 0;
71 virtual bool Stop() = 0;
72 virtual bool Pause() = 0;
73 virtual bool Resume() = 0;
74
75 // Size management
76 virtual bool SetSize(wxSize size) = 0;
77 virtual bool GetSize(wxSize& size) const = 0;
78
79 // Test the capability of the driver to handle the specified type
80 virtual bool IsCapable(wxVideoType WXUNUSED(v_type)) const { return FALSE; }
81
82 // Return the video codec name
83 virtual wxString GetMovieCodec() const = 0;
84 // Return the audio codec name
85 virtual wxString GetAudioCodec() const = 0;
86 // Return misc info about audio
87 virtual wxUint32 GetSampleRate() const = 0;
88 virtual wxUint8 GetChannels() const = 0;
89 virtual wxUint8 GetBPS() const = 0;
90 // Return frame rate
91 virtual double GetFrameRate() const = 0;
92 // Return number of frames
93 virtual wxUint32 GetNbFrames() const = 0;
94
95 // Called when the movie finished
96 virtual void OnFinished() {}
97
98 // Attaches the video output to a window. The video will be shown in that window.
99 virtual bool AttachOutput(wxWindow& output);
100 virtual void DetachOutput();
101
102 // They return the state of the movie.
103 virtual bool IsPaused() const = 0;
104 virtual bool IsStopped() const = 0;
105 };
106
107 WXDLLEXPORT wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv);
108
109
110 #endif