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