1998-11-09 13:37:38 -05:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: vidbdrv.cpp
|
|
|
|
// Purpose: wxMMedia
|
|
|
|
// Author: Guilhem Lavaux
|
|
|
|
// Created: 1997
|
|
|
|
// Updated: 1998
|
|
|
|
// Copyright: (C) 1997, 1998, Guilhem Lavaux
|
|
|
|
// License: wxWindows license
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma implementation "vidbase.h"
|
|
|
|
#endif
|
1999-08-17 13:51:33 -04:00
|
|
|
|
|
|
|
#include <wx/wxprec.h>
|
|
|
|
|
|
|
|
#ifndef WX_PRECOMP
|
|
|
|
#include <wx/stream.h>
|
1998-12-23 13:16:19 -05:00
|
|
|
#include <wx/wfstream.h>
|
1998-11-09 13:37:38 -05:00
|
|
|
#endif
|
|
|
|
|
1999-08-17 13:51:33 -04:00
|
|
|
#include "vidbase.h"
|
|
|
|
|
1998-11-09 13:37:38 -05:00
|
|
|
#ifdef __BORLANDC__
|
|
|
|
#pragma hdrstop
|
|
|
|
#endif
|
|
|
|
|
1999-08-14 08:06:35 -04:00
|
|
|
IMPLEMENT_ABSTRACT_CLASS(wxVideoBaseDriver, wxObject)
|
|
|
|
IMPLEMENT_DYNAMIC_CLASS(wxVideoOutput, wxWindow)
|
|
|
|
|
1998-11-09 13:37:38 -05:00
|
|
|
wxVideoOutput::wxVideoOutput()
|
|
|
|
: wxWindow()
|
|
|
|
{
|
1999-08-14 08:06:35 -04:00
|
|
|
m_dyn_size = TRUE;
|
1998-11-09 13:37:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
wxVideoOutput::wxVideoOutput(wxWindow *parent, const wxWindowID id, const wxPoint& position,
|
|
|
|
const wxSize& size, const long style,
|
|
|
|
const wxString& name)
|
|
|
|
: wxWindow(parent, id, position, size, style, name)
|
|
|
|
{
|
1999-08-14 08:06:35 -04:00
|
|
|
m_dyn_size = TRUE;
|
1998-11-09 13:37:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
///
|
|
|
|
wxVideoOutput::~wxVideoOutput()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
wxVideoBaseDriver::wxVideoBaseDriver()
|
|
|
|
{
|
1999-08-14 08:06:35 -04:00
|
|
|
m_video_output = NULL;
|
1998-11-09 13:37:38 -05:00
|
|
|
}
|
|
|
|
|
1999-08-14 08:06:35 -04:00
|
|
|
wxVideoBaseDriver::wxVideoBaseDriver(wxInputStream& str)
|
1998-11-09 13:37:38 -05:00
|
|
|
{
|
1999-08-14 08:06:35 -04:00
|
|
|
m_video_output = NULL;
|
1998-11-09 13:37:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
wxVideoBaseDriver::~wxVideoBaseDriver()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
bool wxVideoBaseDriver::AttachOutput(wxVideoOutput& output)
|
|
|
|
{
|
1999-08-14 08:06:35 -04:00
|
|
|
m_video_output = &output;
|
1998-11-09 13:37:38 -05:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
void wxVideoBaseDriver::DetachOutput()
|
|
|
|
{
|
1999-08-14 08:06:35 -04:00
|
|
|
m_video_output = NULL;
|
1998-11-09 13:37:38 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Use an external frame for video output
|
|
|
|
|
|
|
|
wxFrame *wxVideoCreateFrame(wxVideoBaseDriver *vid_drv)
|
|
|
|
{
|
|
|
|
wxFrame *frame = new wxFrame(NULL, -1, "Video Output", wxDefaultPosition, wxSize(100, 100));
|
1999-08-14 08:06:35 -04:00
|
|
|
wxVideoOutput *vid_out = new wxVideoOutput(frame, -1, wxPoint(0, 0), wxSize(300, 300));
|
1998-11-09 13:37:38 -05:00
|
|
|
|
|
|
|
vid_out->DynamicSize(TRUE);
|
|
|
|
frame->Layout();
|
|
|
|
frame->Show(TRUE);
|
1999-08-14 08:06:35 -04:00
|
|
|
|
|
|
|
vid_drv->AttachOutput(*vid_out);
|
1999-08-29 10:40:11 -04:00
|
|
|
vid_drv->Play();
|
1998-11-09 13:37:38 -05:00
|
|
|
|
|
|
|
return frame;
|
|
|
|
}
|