]> git.saurik.com Git - wxWidgets.git/blob - utils/wxMMedia2/lib/vidbase.cpp
added default ctor for wxDirDialog
[wxWidgets.git] / utils / wxMMedia2 / lib / vidbase.cpp
1 ////////////////////////////////////////////////////////////////////////////////
2 // Name: vidbdrv.cpp
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 #ifdef __GNUG__
11 #pragma implementation "vidbase.h"
12 #endif
13
14 #include <wx/wxprec.h>
15
16 #ifndef WX_PRECOMP
17 #include <wx/stream.h>
18 #include <wx/wfstream.h>
19 #endif
20
21 #include "vidbase.h"
22
23 #ifdef __BORLANDC__
24 #pragma hdrstop
25 #endif
26
27 #if !USE_SHARED_LIBRARY
28 IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject)
29 IMPLEMENT_DYNAMIC_CLASS(wxVideoOutput, wxWindow)
30 #endif
31
32 wxVideoOutput::wxVideoOutput()
33 : wxWindow()
34 {
35 m_dyn_size = TRUE;
36 }
37
38 wxVideoOutput::wxVideoOutput(wxWindow *parent, const wxWindowID id, const wxPoint& position,
39 const wxSize& size, const long style,
40 const wxString& name)
41 : wxWindow(parent, id, position, size, style, name)
42 {
43 m_dyn_size = TRUE;
44 }
45
46 ///
47 wxVideoOutput::~wxVideoOutput()
48 {
49 }
50
51 wxVideoBaseDriver::wxVideoBaseDriver()
52 {
53 m_video_output = NULL;
54 }
55
56 wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str)
57 {
58 m_video_output = NULL;
59 }
60
61 wxVideoBaseDriver::~wxVideoBaseDriver()
62 {
63 }
64
65 bool wxVideoBaseDriver::AttachOutput(wxVideoOutput& output)
66 {
67 m_video_output = &output;
68 return TRUE;
69 }
70
71 void wxVideoBaseDriver::DetachOutput()
72 {
73 m_video_output = NULL;
74 }
75
76 // Use an external frame for video output
77
78 wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv)
79 {
80 wxFrame *frame = new wxFrame(NULL, -1, "Video Output", wxDefaultPosition, wxSize(100, 100));
81 wxVideoOutput *vid_out = new wxVideoOutput(frame, -1, wxPoint(0, 0), wxSize(300, 300));
82
83 vid_out->DynamicSize(TRUE);
84 frame->Layout();
85 frame->Show(TRUE);
86
87 vid_drv->AttachOutput(*vid_out);
88 vid_drv->Play();
89
90 return frame;
91 }