]> git.saurik.com Git - wxWidgets.git/blame - contrib/src/mmedia/vidbase.cpp
and restored error checking too: this completes sequence of 3 check ins making wx...
[wxWidgets.git] / contrib / src / mmedia / vidbase.cpp
CommitLineData
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
28IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject)
29
30///
31wxVideoBaseDriver::wxVideoBaseDriver()
32{
33 m_video_output = NULL;
34}
35
42c37dec 36wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& WXUNUSED(str))
e8482f24
GL
37{
38 m_video_output = NULL;
39}
40
42c37dec 41wxVideoBaseDriver::wxVideoBaseDriver(const wxString& WXUNUSED(filename))
e8482f24
GL
42{
43 m_video_output = NULL;
44}
45
46wxVideoBaseDriver::~wxVideoBaseDriver()
47{
48}
49
50bool wxVideoBaseDriver::AttachOutput(wxWindow& output)
51{
52 m_video_output = &output;
dea7e44a 53 return true;
e8482f24
GL
54}
55
56void wxVideoBaseDriver::DetachOutput()
57{
58 m_video_output = NULL;
59}
60
61// Use an external frame for video output
62
63wxFrame *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}