]>
Commit | Line | Data |
---|---|---|
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 | IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject) | |
28 | ||
29 | /// | |
30 | wxVideoBaseDriver::wxVideoBaseDriver() | |
31 | { | |
32 | m_video_output = NULL; | |
33 | } | |
34 | ||
35 | wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str) | |
36 | { | |
37 | m_video_output = NULL; | |
38 | } | |
39 | ||
40 | wxVideoBaseDriver::~wxVideoBaseDriver() | |
41 | { | |
42 | } | |
43 | ||
44 | bool wxVideoBaseDriver::AttachOutput(wxWindow& output) | |
45 | { | |
46 | m_video_output = &output; | |
47 | return TRUE; | |
48 | } | |
49 | ||
50 | void wxVideoBaseDriver::DetachOutput() | |
51 | { | |
52 | m_video_output = NULL; | |
53 | } | |
54 | ||
55 | // Use an external frame for video output | |
56 | ||
57 | wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv) | |
58 | { | |
59 | wxFrame *frame = new wxFrame(NULL, -1, "Video Output", wxDefaultPosition, wxSize(100, 100)); | |
60 | wxWindow *vid_out = new wxWindow(frame, -1, wxPoint(0, 0), wxSize(300, 300)); | |
61 | ||
62 | frame->Layout(); | |
63 | frame->Show(TRUE); | |
64 | ||
65 | vid_drv->AttachOutput(*vid_out); | |
66 | vid_drv->Play(); | |
67 | ||
68 | return frame; | |
69 | } |