]>
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 | IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject) |
28 | IMPLEMENT_DYNAMIC_CLASS(wxVideoOutput, wxWindow) | |
526ddb13 | 29 | |
4d6306eb GL |
30 | wxVideoOutput::wxVideoOutput() |
31 | : wxWindow() | |
32 | { | |
526ddb13 | 33 | m_dyn_size = TRUE; |
4d6306eb GL |
34 | } |
35 | ||
36 | wxVideoOutput::wxVideoOutput(wxWindow *parent, const wxWindowID id, const wxPoint& position, | |
37 | const wxSize& size, const long style, | |
38 | const wxString& name) | |
39 | : wxWindow(parent, id, position, size, style, name) | |
40 | { | |
526ddb13 | 41 | m_dyn_size = TRUE; |
4d6306eb GL |
42 | } |
43 | ||
44 | /// | |
45 | wxVideoOutput::~wxVideoOutput() | |
46 | { | |
47 | } | |
48 | ||
49 | wxVideoBaseDriver::wxVideoBaseDriver() | |
4d6306eb | 50 | { |
526ddb13 | 51 | m_video_output = NULL; |
4d6306eb GL |
52 | } |
53 | ||
526ddb13 | 54 | wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str) |
4d6306eb | 55 | { |
526ddb13 | 56 | m_video_output = NULL; |
4d6306eb GL |
57 | } |
58 | ||
59 | wxVideoBaseDriver::~wxVideoBaseDriver() | |
60 | { | |
61 | } | |
62 | ||
63 | bool wxVideoBaseDriver::AttachOutput(wxVideoOutput& output) | |
64 | { | |
526ddb13 | 65 | m_video_output = &output; |
4d6306eb GL |
66 | return TRUE; |
67 | } | |
68 | ||
69 | void wxVideoBaseDriver::DetachOutput() | |
70 | { | |
526ddb13 | 71 | m_video_output = NULL; |
4d6306eb GL |
72 | } |
73 | ||
74 | // Use an external frame for video output | |
75 | ||
76 | wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv) | |
77 | { | |
78 | wxFrame *frame = new wxFrame(NULL, -1, "Video Output", wxDefaultPosition, wxSize(100, 100)); | |
526ddb13 | 79 | wxVideoOutput *vid_out = new wxVideoOutput(frame, -1, wxPoint(0, 0), wxSize(300, 300)); |
4d6306eb GL |
80 | |
81 | vid_out->DynamicSize(TRUE); | |
4d6306eb GL |
82 | frame->Layout(); |
83 | frame->Show(TRUE); | |
526ddb13 GL |
84 | |
85 | vid_drv->AttachOutput(*vid_out); | |
b83290c3 | 86 | vid_drv->Play(); |
4d6306eb GL |
87 | |
88 | return frame; | |
89 | } |