]> git.saurik.com Git - wxWidgets.git/blame_incremental - utils/wxMMedia2/lib/vidbase.cpp
added support for several new events in wxCalendarCtrl: clicking on week
[wxWidgets.git] / utils / wxMMedia2 / lib / vidbase.cpp
... / ...
CommitLineData
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
27IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject)
28IMPLEMENT_DYNAMIC_CLASS(wxVideoOutput, wxWindow)
29
30wxVideoOutput::wxVideoOutput()
31 : wxWindow()
32{
33 m_dyn_size = TRUE;
34}
35
36wxVideoOutput::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{
41 m_dyn_size = TRUE;
42}
43
44///
45wxVideoOutput::~wxVideoOutput()
46{
47}
48
49wxVideoBaseDriver::wxVideoBaseDriver()
50{
51 m_video_output = NULL;
52}
53
54wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str)
55{
56 m_video_output = NULL;
57}
58
59wxVideoBaseDriver::~wxVideoBaseDriver()
60{
61}
62
63bool wxVideoBaseDriver::AttachOutput(wxVideoOutput& output)
64{
65 m_video_output = &output;
66 return TRUE;
67}
68
69void wxVideoBaseDriver::DetachOutput()
70{
71 m_video_output = NULL;
72}
73
74// Use an external frame for video output
75
76wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv)
77{
78 wxFrame *frame = new wxFrame(NULL, -1, "Video Output", wxDefaultPosition, wxSize(100, 100));
79 wxVideoOutput *vid_out = new wxVideoOutput(frame, -1, wxPoint(0, 0), wxSize(300, 300));
80
81 vid_out->DynamicSize(TRUE);
82 frame->Layout();
83 frame->Show(TRUE);
84
85 vid_drv->AttachOutput(*vid_out);
86 vid_drv->Play();
87
88 return frame;
89}