]>
Commit | Line | Data |
---|---|---|
4d6306eb 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 | |
6c5e6376 GL |
13 | |
14 | #include <wx/wxprec.h> | |
15 | ||
16 | #ifndef WX_PRECOMP | |
17 | #include <wx/stream.h> | |
926c550d | 18 | #include <wx/wfstream.h> |
4d6306eb GL |
19 | #endif |
20 | ||
6c5e6376 GL |
21 | #include "vidbase.h" |
22 | ||
4d6306eb GL |
23 | #ifdef __BORLANDC__ |
24 | #pragma hdrstop | |
25 | #endif | |
26 | ||
526ddb13 GL |
27 | #if !USE_SHARED_LIBRARY |
28 | IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject) | |
29 | IMPLEMENT_DYNAMIC_CLASS(wxVideoOutput, wxWindow) | |
30 | #endif | |
31 | ||
4d6306eb GL |
32 | wxVideoOutput::wxVideoOutput() |
33 | : wxWindow() | |
34 | { | |
526ddb13 | 35 | m_dyn_size = TRUE; |
4d6306eb GL |
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 | { | |
526ddb13 | 43 | m_dyn_size = TRUE; |
4d6306eb GL |
44 | } |
45 | ||
46 | /// | |
47 | wxVideoOutput::~wxVideoOutput() | |
48 | { | |
49 | } | |
50 | ||
51 | wxVideoBaseDriver::wxVideoBaseDriver() | |
4d6306eb | 52 | { |
526ddb13 | 53 | m_video_output = NULL; |
4d6306eb GL |
54 | } |
55 | ||
526ddb13 | 56 | wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str) |
4d6306eb | 57 | { |
526ddb13 | 58 | m_video_output = NULL; |
4d6306eb GL |
59 | } |
60 | ||
61 | wxVideoBaseDriver::~wxVideoBaseDriver() | |
62 | { | |
63 | } | |
64 | ||
65 | bool wxVideoBaseDriver::AttachOutput(wxVideoOutput& output) | |
66 | { | |
526ddb13 | 67 | m_video_output = &output; |
4d6306eb GL |
68 | return TRUE; |
69 | } | |
70 | ||
71 | void wxVideoBaseDriver::DetachOutput() | |
72 | { | |
526ddb13 | 73 | m_video_output = NULL; |
4d6306eb GL |
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)); | |
526ddb13 | 81 | wxVideoOutput *vid_out = new wxVideoOutput(frame, -1, wxPoint(0, 0), wxSize(300, 300)); |
4d6306eb GL |
82 | |
83 | vid_out->DynamicSize(TRUE); | |
4d6306eb GL |
84 | frame->Layout(); |
85 | frame->Show(TRUE); | |
526ddb13 GL |
86 | wxYield(); |
87 | ||
88 | vid_drv->AttachOutput(*vid_out); | |
4d6306eb GL |
89 | |
90 | return frame; | |
91 | } |