]>
Commit | Line | Data |
---|---|---|
e8482f24 GL |
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 | ||
92a19c2e | 14 | #include "wx/wxprec.h" |
e8482f24 GL |
15 | |
16 | #ifndef WX_PRECOMP | |
17 | #include <wx/stream.h> | |
18 | #include <wx/wfstream.h> | |
f815011f | 19 | #include <wx/intl.h> |
e8482f24 GL |
20 | #endif |
21 | ||
22 | #include "wx/mmedia/vidbase.h" | |
23 | ||
24 | #ifdef __BORLANDC__ | |
25 | #pragma hdrstop | |
26 | #endif | |
27 | ||
28 | IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject) | |
29 | ||
30 | /// | |
31 | wxVideoBaseDriver::wxVideoBaseDriver() | |
32 | { | |
33 | m_video_output = NULL; | |
34 | } | |
35 | ||
42c37dec | 36 | wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& WXUNUSED(str)) |
e8482f24 GL |
37 | { |
38 | m_video_output = NULL; | |
39 | } | |
40 | ||
42c37dec | 41 | wxVideoBaseDriver::wxVideoBaseDriver(const wxString& WXUNUSED(filename)) |
e8482f24 GL |
42 | { |
43 | m_video_output = NULL; | |
44 | } | |
45 | ||
46 | wxVideoBaseDriver::~wxVideoBaseDriver() | |
47 | { | |
48 | } | |
49 | ||
50 | bool wxVideoBaseDriver::AttachOutput(wxWindow& output) | |
51 | { | |
52 | m_video_output = &output; | |
dea7e44a | 53 | return true; |
e8482f24 GL |
54 | } |
55 | ||
56 | void wxVideoBaseDriver::DetachOutput() | |
57 | { | |
58 | m_video_output = NULL; | |
59 | } | |
60 | ||
61 | // Use an external frame for video output | |
62 | ||
63 | wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv) | |
64 | { | |
dea7e44a WS |
65 | wxFrame *frame = new wxFrame(NULL, wxID_ANY, _("Video Output"), wxDefaultPosition, wxSize(100, 100)); |
66 | wxWindow *vid_out = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(300, 300)); | |
e8482f24 GL |
67 | |
68 | frame->Layout(); | |
dea7e44a | 69 | frame->Show(true); |
e8482f24 GL |
70 | |
71 | vid_drv->AttachOutput(*vid_out); | |
72 | vid_drv->Play(); | |
73 | ||
74 | return frame; | |
75 | } |