]> git.saurik.com Git - wxWidgets.git/blame - utils/wxMMedia/vidbase.cpp
Added test for sprintf and vsnprintf to fix string.cpp for non-GNU systems.
[wxWidgets.git] / utils / wxMMedia / vidbase.cpp
CommitLineData
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
13#include <wx/fstream.h>
14#include "vidbase.h"
15#ifdef WX_PRECOMP
16#include "wx_prec.h"
17#else
18#include "wx/wx.h"
19#endif
20
21#ifdef __BORLANDC__
22#pragma hdrstop
23#endif
24
25wxVideoOutput::wxVideoOutput()
26 : wxWindow()
27{
28 dyn_size = TRUE;
29}
30
31wxVideoOutput::wxVideoOutput(wxWindow *parent, const wxWindowID id, const wxPoint& position,
32 const wxSize& size, const long style,
33 const wxString& name)
34 : wxWindow(parent, id, position, size, style, name)
35{
36 dyn_size = TRUE;
37}
38
39///
40wxVideoOutput::~wxVideoOutput()
41{
42}
43
44wxVideoBaseDriver::wxVideoBaseDriver()
45 : wxMMediaFile()
46{
47}
48
49wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str, bool seekable)
50 : wxMMediaFile(str, FALSE, seekable)
51{
52}
53
54wxVideoBaseDriver::wxVideoBaseDriver(const wxString& fname)
55 : wxMMediaFile(fname)
56{
57}
58
59wxVideoBaseDriver::~wxVideoBaseDriver()
60{
61}
62
63bool wxVideoBaseDriver::AttachOutput(wxVideoOutput& output)
64{
65 video_output = &output;
66 return TRUE;
67}
68
69void wxVideoBaseDriver::DetachOutput()
70{
71 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);
80
81 vid_out->DynamicSize(TRUE);
82 vid_drv->AttachOutput(*vid_out);
83 frame->Layout();
84 frame->Show(TRUE);
85
86 return frame;
87}