Ryan's cumulative wxActiveX and media control patch (1427775)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
236
docs/latex/wx/activexcontainer.tex
Normal file
236
docs/latex/wx/activexcontainer.tex
Normal file
@@ -0,0 +1,236 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: activexcontainer.tex
|
||||
%% Purpose: wxActiveXContainer docs
|
||||
%% Author: Ryan Norton <wxprojects@comcast.net>
|
||||
%% Modified by:
|
||||
%% Created: 01/30/2005
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) Ryan Norton
|
||||
%% License: wxWindows license
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxActiveXContainer}}\label{wxactivexcontainer}
|
||||
|
||||
wxActiveXContainer is a host for an activex control on Windows (and
|
||||
as such is a platform-specific class). Note that the HWND that the class
|
||||
contains is the actual HWND of the activex control so using dynamic events
|
||||
and connecting to wxEVT\_SIZE, for example, will recieve the actual size
|
||||
message sent to the control.
|
||||
|
||||
It is somewhat similar to the ATL class CAxWindow in operation.
|
||||
|
||||
The size of the activex control's content is generally gauranteed to be that
|
||||
of the client size of the parent of this wxActiveXContainer.
|
||||
|
||||
You can also process activex events through wxEVT\_ACTIVEX or the
|
||||
corresponding message map macro EVT\_ACTIVEX.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxActiveXEvent}{wxactivexevent}
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxControl}{wxcontrol}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/msw/ole/activex.h>
|
||||
|
||||
\wxheading{Example}
|
||||
|
||||
This is an example of how to use the Adobe Acrobat Reader ActiveX control to read PDF files
|
||||
(requires Acrobat Reader 4 and up). Controls like this are typically found and dumped from
|
||||
OLEVIEW.exe that is distributed with Microsoft Visual C++. This example also demonstrates
|
||||
how to create a backend for \helpref{wxMediaCtrl}{wxmediactrl}.
|
||||
|
||||
\begin{verbatim}
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
//
|
||||
// wxPDFMediaBackend
|
||||
//
|
||||
// http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/iac/IACOverview.pdf
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
#include "wx/mediactrl.h" // wxMediaBackendCommonBase
|
||||
#include "wx/msw/ole/activex.h" // wxActiveXContainer
|
||||
#include "wx/msw/ole/automtn.h" // wxAutomationObject
|
||||
|
||||
const IID DIID__DPdf = {0xCA8A9781,0x280D,0x11CF,{0xA2,0x4D,0x44,0x45,0x53,0x54,0x00,0x00}};
|
||||
const IID DIID__DPdfEvents = {0xCA8A9782,0x280D,0x11CF,{0xA2,0x4D,0x44,0x45,0x53,0x54,0x00,0x00}};
|
||||
const CLSID CLSID_Pdf = {0xCA8A9780,0x280D,0x11CF,{0xA2,0x4D,0x44,0x45,0x53,0x54,0x00,0x00}};
|
||||
|
||||
class WXDLLIMPEXP_MEDIA wxPDFMediaBackend : public wxMediaBackendCommonBase
|
||||
{
|
||||
public:
|
||||
wxPDFMediaBackend() : m_pAX(NULL) {}
|
||||
virtual ~wxPDFMediaBackend()
|
||||
{
|
||||
if(m_pAX)
|
||||
{
|
||||
m_pAX->DissociateHandle();
|
||||
delete m_pAX;
|
||||
}
|
||||
}
|
||||
virtual bool CreateControl(wxControl* ctrl, wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style,
|
||||
const wxValidator& validator,
|
||||
const wxString& name)
|
||||
{
|
||||
IDispatch* pDispatch;
|
||||
if( ::CoCreateInstance(CLSID_Pdf, NULL,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
DIID__DPdf, (void**)&pDispatch) != 0 )
|
||||
return false;
|
||||
|
||||
m_PDF.SetDispatchPtr(pDispatch); // wxAutomationObject will release itself
|
||||
|
||||
if ( !ctrl->wxControl::Create(parent, id, pos, size,
|
||||
(style & ~wxBORDER_MASK) | wxBORDER_NONE,
|
||||
validator, name) )
|
||||
return false;
|
||||
|
||||
m_ctrl = wxStaticCast(ctrl, wxMediaCtrl);
|
||||
m_pAX = new wxActiveXContainer(ctrl,
|
||||
DIID__DPdf,
|
||||
pDispatch);
|
||||
|
||||
wxPDFMediaBackend::ShowPlayerControls(wxMEDIACTRLPLAYERCONTROLS_NONE);
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool Play()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
virtual bool Pause()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
virtual bool Stop()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool Load(const wxString& fileName)
|
||||
{
|
||||
if(m_PDF.CallMethod(wxT("LoadFile"), fileName).GetBool())
|
||||
{
|
||||
m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)0));
|
||||
NotifyMovieLoaded(); // initial refresh
|
||||
wxSizeEvent event;
|
||||
m_pAX->OnSize(event);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
virtual bool Load(const wxURI& location)
|
||||
{
|
||||
return m_PDF.CallMethod(wxT("LoadFile"), location.BuildUnescapedURI()).GetBool();
|
||||
}
|
||||
virtual bool Load(const wxURI& WXUNUSED(location),
|
||||
const wxURI& WXUNUSED(proxy))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual wxMediaState GetState()
|
||||
{
|
||||
return wxMEDIASTATE_STOPPED;
|
||||
}
|
||||
|
||||
virtual bool SetPosition(wxLongLong where)
|
||||
{
|
||||
m_PDF.CallMethod(wxT("setCurrentPage"), wxVariant((long)where.GetValue()));
|
||||
return true;
|
||||
}
|
||||
virtual wxLongLong GetPosition()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual wxLongLong GetDuration()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
virtual void Move(int WXUNUSED(x), int WXUNUSED(y),
|
||||
int WXUNUSED(w), int WXUNUSED(h))
|
||||
{
|
||||
}
|
||||
wxSize GetVideoSize() const
|
||||
{
|
||||
return wxDefaultSize;
|
||||
}
|
||||
|
||||
virtual double GetPlaybackRate()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual bool SetPlaybackRate(double)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual double GetVolume()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
virtual bool SetVolume(double)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool ShowPlayerControls(wxMediaCtrlPlayerControls flags)
|
||||
{
|
||||
if(flags)
|
||||
{
|
||||
m_PDF.CallMethod(wxT("setShowToolbar"), true);
|
||||
m_PDF.CallMethod(wxT("setShowScrollbars"), true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_PDF.CallMethod(wxT("setShowToolbar"), false);
|
||||
m_PDF.CallMethod(wxT("setShowScrollbars"), false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxActiveXContainer* m_pAX;
|
||||
wxAutomationObject m_PDF;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxPDFMediaBackend)
|
||||
};
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxPDFMediaBackend, wxMediaBackend);
|
||||
\end{verbatim}
|
||||
|
||||
Put this in one of your existant source files and then create a wxMediaCtrl with
|
||||
\begin{verbatim}
|
||||
//[this] is the parent window, "myfile.pdf" is the PDF file to open
|
||||
wxMediaCtrl* mymediactrl = new wxMediaCtrl(this, wxT("myfile.pdf"), wxID_ANY,
|
||||
wxDefaultPosition, wxSize(300,300),
|
||||
0, wxT("wxPDFMediaBackend"));
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
\membersection{wxActiveXContainer::wxActiveXContainer}\label{wxactivexcontainerwxactivexcontainer}
|
||||
|
||||
\func{}{wxActiveXContainer}{
|
||||
\param{wxWindow* }{parent},
|
||||
\param{REFIID }{iid},
|
||||
\param{IUnknown* }{pUnk},
|
||||
}
|
||||
|
||||
Creates this activex container.
|
||||
|
||||
\docparam{parent}{parent of this control. Must not be NULL.}
|
||||
\docparam{iid}{COM IID of pUnk to query. Must be a valid interface to an activex control.}
|
||||
\docparam{pUnk}{Interface of activex control}
|
||||
|
75
docs/latex/wx/activexevt.tex
Normal file
75
docs/latex/wx/activexevt.tex
Normal file
@@ -0,0 +1,75 @@
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Name: activexevt.tex
|
||||
%% Purpose: wxActiveXEvent docs
|
||||
%% Author: Ryan Norton <wxprojects@comcast.net>
|
||||
%% Modified by:
|
||||
%% Created: 01/30/2005
|
||||
%% RCS-ID: $Id$
|
||||
%% Copyright: (c) Ryan Norton
|
||||
%% License: wxWindows license
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
\section{\class{wxActiveXEvent}}\label{wxactivexevent}
|
||||
|
||||
An event class for handling activex events passed from
|
||||
\helpref{wxActiveXContainer}{wxactivexcontainer}. ActiveX events are basically
|
||||
a function call with the parameters passed through an array of wxVariants along
|
||||
with a return value that is a wxVariant itself. What type the parameters or
|
||||
return value are depends on the context (i.e. what the .idl specifies).
|
||||
|
||||
Note that unlike the third party wxActiveX function names are not supported.
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxCommandEvent}{wxcommandevent}
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/msw/ole/activex.h>
|
||||
|
||||
\wxheading{Event table macros}
|
||||
|
||||
\twocolwidtha{7cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{{\bf EVT\_ACTIVEX(func)}}{
|
||||
Sent when the activex control hosted by \helpref{wxActiveXContainer}{wxactivexcontainer}
|
||||
recieves an activex event.}
|
||||
\end{twocollist}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
\membersection{wxActiveXEvent::ParamCount}\label{wxactivexeventparamcount}
|
||||
|
||||
\constfunc{int}{ParamCount}{\void}
|
||||
|
||||
Obtains the number of parameters passed through the activex event.
|
||||
|
||||
|
||||
\membersection{wxActiveXEvent::ParamType}\label{wxactivexeventparamtype}
|
||||
|
||||
\constfunc{wxString}{ParamType}{\param{int }{idx}}
|
||||
|
||||
Obtains the param type of the param number idx specifies as a string.
|
||||
|
||||
|
||||
\membersection{wxActiveXEvent::ParamName}\label{wxactivexeventparamname}
|
||||
|
||||
\constfunc{wxString}{ParamName}{\param{int }{idx}}
|
||||
|
||||
Obtains the param name of the param number idx specifies as a string.
|
||||
|
||||
|
||||
\membersection{wxActiveXEvent::operator[]}\label{wxactivexeventoparray}
|
||||
|
||||
\func{wxVariant&}{operator[]}{\param{int }{idx}}
|
||||
|
||||
Obtains the actual parameter value specified by idx.
|
||||
|
||||
|
||||
\membersection{wxActiveXEvent::GetDispatchId}\label{wxactivexeventgetdispatchid}
|
||||
|
||||
\constfunc{DISPID}{GetDispatchId}{\param{int }{idx}}
|
||||
|
||||
Returns the dispatch id of this activex event. This is the numeric value from
|
||||
the .idl file specified by the id().
|
||||
|
@@ -8,6 +8,8 @@
|
||||
\input accel.tex
|
||||
\input accessible.tex
|
||||
\input activevt.tex
|
||||
\input activexcontainer.tex
|
||||
\input activexevt.tex
|
||||
\input app.tex
|
||||
\input archive.tex
|
||||
\input array.tex
|
||||
|
@@ -18,6 +18,10 @@ wxMediaCtrl uses native backends to render media, for example on Windows
|
||||
there is a ActiveMovie/DirectShow backend, and on Macintosh there is a
|
||||
QuickTime backend.
|
||||
|
||||
\wxheading{See also}
|
||||
|
||||
\helpref{wxMediaEvent}{wxmediaevent}
|
||||
|
||||
\wxheading{Derived from}
|
||||
|
||||
\helpref{wxControl}{wxcontrol}
|
||||
@@ -28,6 +32,7 @@ QuickTime backend.
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
||||
|
||||
\membersection{Rendering media}\label{renderingmediawxmediactrl}
|
||||
|
||||
Depending upon the backend, wxMediaCtrl can render
|
||||
@@ -48,6 +53,7 @@ capabilities of the backend. For example, QuickTime cannot set
|
||||
the playback rate of certain streaming media - while DirectShow is
|
||||
slightly more flexible in that regard.
|
||||
|
||||
|
||||
\membersection{Operation}\label{operationwxmediactrl}
|
||||
|
||||
When wxMediaCtrl plays a file, it plays until the stop position
|
||||
@@ -86,6 +92,50 @@ because some streams are not seekable, and when stop is called
|
||||
on them they return to the beginning, thus wxMediaCtrl tries
|
||||
to keep consistant for all types of media.
|
||||
|
||||
Note that when changing the state of the media through Play()
|
||||
and other methods, the media may not actually be in the
|
||||
wxMEDIASTATE\_PLAYING, for example. If you are relying on the
|
||||
media being in certain state catch the event relevant to the state.
|
||||
See \helpref{wxMediaEvent}{wxmediaevent} for the kinds of events
|
||||
that you can catch.
|
||||
|
||||
|
||||
\membersection{Video size}\label{videosizewxmediactrl}
|
||||
|
||||
By default, wxMediaCtrl will scale the size of the video to the
|
||||
requested amount passed to either it's constructor or Create().
|
||||
After calling Load or performing an equivilant operation, you
|
||||
can subsequently obtain the "real" size of the video (if there
|
||||
is any) by calling GetBestSize(). Note that the actual result
|
||||
on the display will be slightly different when ShowPlayerControls
|
||||
is activated and the actual video size will be less then
|
||||
specified due to the extra controls provided by the native toolkit.
|
||||
In addition, the backend may modify GetBestSize() to include the
|
||||
size of the extra controls - so if you want the real size of the
|
||||
video just disable ShowPlayerControls().
|
||||
|
||||
The idea with setting GetBestSize to the size of the video is
|
||||
that GetBestSize is a wxWindow-derived function that is called
|
||||
when sizers on a window recalculate. What this means is that
|
||||
if you use sizers by default the video will show in it's
|
||||
original size without any extra assistance needed from the user.
|
||||
|
||||
|
||||
\membersection{Player controls}\label{playercontrolswxmediactrl}
|
||||
|
||||
Normally, when you use wxMediaCtrl it is just a window for the video to
|
||||
play in. However, some toolkits have their own media player interface.
|
||||
For example, QuickTime generally has a bar below the video with a slider.
|
||||
A special feature available to wxMediaCtrl, you can use the toolkit's interface instead of
|
||||
making your own by using the \helpref{ShowPlayerControls()}{wxmediactrlshowplayercontrols}
|
||||
function. There are several options for the flags parameter, with
|
||||
the two general flags being wxMEDIACTRLPLAYERCONTROLS\_NONE which turns off
|
||||
the native interface, and wxMEDIACTRLPLAYERCONTROLS\_DEFAULT which lets
|
||||
wxMediaCtrl decide what native controls on the interface. Be sure to review
|
||||
the caveats outlined in \helpref{Video size}{videosizewxmediactrl} before
|
||||
doing so.
|
||||
|
||||
|
||||
\membersection{Choosing a backend}\label{choosingbackendwxmediactrl}
|
||||
|
||||
Generally, you should almost certainly leave this part up to
|
||||
@@ -99,17 +149,48 @@ The following are valid backend identifiers -
|
||||
\twocolwidtha{7cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{{\bf wxMEDIABACKEND\_DIRECTSHOW}}{
|
||||
Use ActiveMovie/DirectShow. Requires wxUSE\_DIRECTSHOW to be
|
||||
enabled, requires linkage with the static library strmiids.lib,
|
||||
and is available on Windows Only.}
|
||||
Use ActiveMovie/DirectShow. Uses the native ActiveMovie
|
||||
(I.E. DirectShow) control. Default backend on Windows and
|
||||
supported by nearly all Windows versions, even some
|
||||
Windows CE versions. May display a windows media player
|
||||
logo while inactive. }
|
||||
\twocolitem{{\bf wxMEDIABACKEND\_QUICKTIME}}{
|
||||
Use QuickTime. Windows and Mac Only. NOTE: On Mac Systems lower than OSX 10.2 this defaults to emulating window positioning and suffers from several bugs, including not working correctly embedded in a wxNotebook. }
|
||||
\twocolitem{{\bf wxMEDIABACKEND\_MCI}}{
|
||||
Use Media Command Interface. Windows Only. }
|
||||
Use QuickTime. Mac Only.
|
||||
WARNING: May not working correctly embedded in a wxNotebook.
|
||||
}
|
||||
\twocolitem{{\bf wxMEDIABACKEND\_GSTREAMER}}{
|
||||
Use GStreamer. Unix Only. }
|
||||
Use GStreamer. Unix Only. Requires GStreamer 0.8 along
|
||||
with at the very least the xvimagesink, xoverlay, and
|
||||
gst-play modules of gstreamer to function. You need the correct
|
||||
modules to play the relavant files, for example the mad module
|
||||
to play mp3s, etc.}
|
||||
\twocolitem{{\bf wxMEDIABACKEND\_WMP10}}{
|
||||
Uses Windows Media Player 10 (Windows only) - works on mobile
|
||||
machines with Windows Media Player 10 and desktop machines with
|
||||
either Windows Media Player 9 or 10
|
||||
}
|
||||
\end{twocollist}
|
||||
|
||||
Note that other backends such as wxMEDIABACKEND\_MCI can now be
|
||||
found at wxCode.
|
||||
|
||||
\membersection{Creating a backend}\label{creatingabackendwxmediactrl}
|
||||
|
||||
Creating a backend for wxMediaCtrl is a rather simple process. Simply derive
|
||||
from wxMediaBackendCommonBase and implement the methods you want. The methods
|
||||
in wxMediaBackend correspond to those in wxMediaCtrl except for CreateControl
|
||||
which does the actual creation of the control, in cases where a custom control
|
||||
is not needed you may simply call wxControl::Create.
|
||||
|
||||
You need to make sure to use the DECLARE\_CLASS and IMPLEMENT\_CLASS macros.
|
||||
|
||||
The only real tricky part is that you need to make sure the file in compiled
|
||||
in, which if there are just backends in there will not happen and you may need
|
||||
to use a force link hack (see http://www.wxwidgets.org/wiki/index.php/RTTI).
|
||||
|
||||
This is a rather simple example of how to create a backend in the
|
||||
\helpref{wxActiveXContainer}{wxactivexcontainer} documentation.
|
||||
|
||||
\membersection{wxMediaCtrl::wxMediaCtrl}\label{wxmediactrlwxmediactrl}
|
||||
|
||||
\func{}{wxMediaCtrl}{\void}
|
||||
@@ -173,25 +254,38 @@ wxMediaCtrl figure it out.}
|
||||
\docparam{name}{Window name.}
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Length}\label{wxmediactrlgetduration}
|
||||
\membersection{wxMediaCtrl::GetBestSize}\label{wxmediactrlgetbestsize}
|
||||
|
||||
\func{wxFileOffset}{GetDuration}{\void}
|
||||
\func{wxSize}{GetBestSize}{\void}
|
||||
|
||||
Obtains the length - the total amount of time the movie has in milliseconds.
|
||||
Obtains the best size relative to the original/natural size of the
|
||||
video, if there is any. See \helpref{Video size}{videosizewxmediactrl}
|
||||
for more information.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Tell}\label{wxmediactrlgetposition}
|
||||
\membersection{wxMediaCtrl::GetPlaybackRate}\label{wxmediactrlgetplaybackrate}
|
||||
|
||||
\func{wxFileOffset}{GetPosition}{\void}
|
||||
\func{double}{GetPlaybackrate}{\void}
|
||||
|
||||
Obtains the current position in time within the movie in milliseconds.
|
||||
Obtains the playback rate, or speed of the media. \tt{1.0} represents normal
|
||||
speed, while \tt{2.0} represents twice the normal speed of the media, for
|
||||
example. Not supported on the GStreamer (Unix) backend.
|
||||
Returns 0 on failure.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::GetVolume}\label{wxmediactrlgetvolume}
|
||||
|
||||
\func{double}{GetVolume}{\void}
|
||||
|
||||
Gets the volume of the media from a 0.0 to 1.0 range. Note that due to rounding
|
||||
and other errors this may not be the exact value sent to SetVolume.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::GetState}\label{wxmediactrlgetstate}
|
||||
|
||||
\func{wxMediaCtrlState}{GetState}{\void}
|
||||
|
||||
Obtains the state the playback of the movie is in -
|
||||
Obtains the state the playback of the media is in -
|
||||
|
||||
\twocolwidtha{7cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
@@ -201,6 +295,13 @@ Obtains the state the playback of the movie is in -
|
||||
\end{twocollist}
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Length}\label{wxmediactrllength}
|
||||
|
||||
\func{wxFileOffset}{Length}{\void}
|
||||
|
||||
Obtains the length - the total amount of time the movie has in milliseconds.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Load}\label{wxmediactrlload}
|
||||
|
||||
\func{bool}{Load}{\param{const wxString\& }{fileName}}
|
||||
@@ -210,9 +311,31 @@ Loads the file that \tt{fileName} refers to. Returns false if loading fails.
|
||||
|
||||
\membersection{wxMediaCtrl::Load}\label{wxmediactrlloaduri}
|
||||
|
||||
\func{bool}{Load}{\param{const wxURI\& }{location}}
|
||||
\func{bool}{Load}{\param{const wxURI\& }{uri}}
|
||||
|
||||
Loads the location that \tt{uri} refers to. Note that this is very implementation-dependant, although HTTP URI/URLs are generally supported, for example. Returns false if loading fails.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Load}\label{wxmediactrlloaduriwithproxy}
|
||||
|
||||
\func{bool}{Load}{\param{const wxURI\& }{uri}, \param{const wxURI\& }{proxy}}
|
||||
|
||||
Loads the location that \tt{uri} refers to with the proxy \tt{proxy}. Not implemented on most backends so it should be called with caution. Returns false if loading fails.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::LoadURI}\label{wxmediactrlloaduriliteral}
|
||||
|
||||
\func{bool}{LoadURI}{\param{const wxURI\& }{uri}}
|
||||
|
||||
Same as \helpref{Load}{wxmediactrlloaduri}. Kept for wxPython compatability.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::LoadURIWithProxy}\label{wxmediactrlloaduriwithproxyliteral}
|
||||
|
||||
\func{bool}{LoadURIWithProxy}{\param{const wxURI\& }{uri}, \param{const wxURI\& }{proxy}}
|
||||
|
||||
Same as \helpref{Load}{wxmediactrlloaduriwithproxy}. Kept for wxPython compatability.
|
||||
|
||||
Loads the url that \tt{location} refers to. Returns false if loading fails.
|
||||
|
||||
\membersection{wxMediaCtrl::Pause}\label{wxmediactrlpause}
|
||||
|
||||
@@ -235,54 +358,65 @@ Resumes playback of the movie.
|
||||
Seeks to a position within the movie.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Stop}\label{wxmediactrlstop}
|
||||
\membersection{wxMediaCtrl::SetPlaybackRate}\label{wxmediactrlsetplaybackrate}
|
||||
|
||||
\func{bool}{Stop}{\void}
|
||||
\func{bool}{SetPlaybackRate}{\param{double }{dRate}}
|
||||
|
||||
Stops the media.
|
||||
|
||||
See \helpref{Operation}{operationwxmediactrl} for an overview of how stopping works.
|
||||
Sets the playback rate, or speed of the media, to that referred by \tt{dRate}.
|
||||
\tt{1.0} represents normal speed, while \tt{2.0} represents twice the normal
|
||||
speed of the media, for example. Not supported on the GStreamer (Unix) backend.
|
||||
Returns true if successful.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::SetVolume}\label{wxmediactrlsetvolume}
|
||||
|
||||
\func{bool}{SetVolume}{\param{double }{dVolume}}
|
||||
|
||||
Sets the volume of the media from a 0.0 to 1.0 range.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::GetVolume}\label{wxmediactrlgetvolume}
|
||||
|
||||
\func{double}{GetVolume}{\void}
|
||||
|
||||
Gets the volume of the media from a 0.0 to 1.0 range.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::GetPlaybackRate}\label{wxmediactrlgetplaybackrate}
|
||||
|
||||
\func{double}{GetPlaybackrate}{\void}
|
||||
|
||||
Gets the playback rate of the media; for example 2.0 is double speed.
|
||||
Not implemented on MCI or GStreamer.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::SetPlaybackRate}\label{wxmediactrlsetplaybackrate}
|
||||
|
||||
\func{bool}{SetPlaybackrate}{\param{double }{dVolume}}
|
||||
|
||||
Sets the rate that the media plays; for example 0.5 is half speed.
|
||||
Sets the volume of the media from a 0.0 to 1.0 range to that referred
|
||||
by \tt{dVolume}. \tt{1.0} represents full volume, while \tt{0.5}
|
||||
represents half (50 percent) volume, for example. Note that this may not be
|
||||
exact due to conversion and rounding errors, although setting the volume to
|
||||
full or none is always exact. Returns true if successful.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::ShowPlayerControls}\label{wxmediactrlshowplayercontrols}
|
||||
|
||||
\func{bool}{ShowPlayerControls}{\param{wxMediaCtrlPlayerControls }{flags}}
|
||||
\func{bool}{ShowPlayerControls}{\param{wxMediaCtrlPlayerControls }{flags = wxMEDIACTRLPLAYERCONTROLS\_DEFAULT}}
|
||||
|
||||
Normally, when you use wxMediaCtrl it is just a window for the video to
|
||||
play in. However, platforms generally have their own media player interface,
|
||||
like quicktime has a bar below the video with a slider etc.. If you want that native
|
||||
interface instead of making your own use this function. There are several options
|
||||
for the flags parameter, however you can look at the mediactrl header for these.
|
||||
The two general flags are wxMEDIACTRLPLAYERCONTROLS\_NONE which turns off the
|
||||
native interface, and wxMEDIACTRLPLAYERCONTROLS\_DEFAULT which lets wxMediaCtrl
|
||||
decide what native controls on the interface.
|
||||
A special feature to wxMediaCtrl. Applications using native toolkits such as
|
||||
QuickTime usually have a scrollbar, play button, and more provided to
|
||||
them by the toolkit. By default wxMediaCtrl does not do this. However, on
|
||||
the directshow and quicktime backends you can show or hide the native controls
|
||||
provided by the underlying toolkit at will using ShowPlayerControls. Simply
|
||||
calling the function with default parameters tells wxMediaCtrl to use the
|
||||
default controls provided by the toolkit. The function takes a
|
||||
\tt{wxMediaCtrlPlayerControls} enumeration as follows:
|
||||
|
||||
\twocolwidtha{7cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{{\bf wxMEDIACTRLPLAYERCONTROLS\_NONE}}{No controls. return wxMediaCtrl to it's default state.}
|
||||
\twocolitem{{\bf wxMEDIACTRLPLAYERCONTROLS\_STEP}}{Step controls like fastfoward, step one frame etc.}
|
||||
\twocolitem{{\bf wxMEDIACTRLPLAYERCONTROLS\_VOLUME}}{Volume controls like the speaker icon, volume slider, etc.}
|
||||
\twocolitem{{\bf wxMEDIACTRLPLAYERCONTROLS\_DEFAULT}}{Default controls for the toolkit. Currently a typedef for wxMEDIACTRLPLAYERCONTROLS\_STEP and wxMEDIACTRLPLAYERCONTROLS\_VOLUME.}
|
||||
\end{twocollist}
|
||||
|
||||
For more see \helpref{Player controls}{playercontrolswxmediactrl}. Currently
|
||||
only implemented on the QuickTime and DirectShow backends. The function
|
||||
returns true on success.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Stop}\label{wxmediactrlstop}
|
||||
|
||||
\func{bool}{Stop}{\void}
|
||||
|
||||
Stops the media.
|
||||
|
||||
See \helpref{Operation}{operationwxmediactrl} for an overview of how
|
||||
stopping works.
|
||||
|
||||
|
||||
\membersection{wxMediaCtrl::Tell}\label{wxmediactrlgetposition}
|
||||
|
||||
\func{wxFileOffset}{Tell}{\void}
|
||||
|
||||
Obtains the current position in time within the movie in milliseconds.
|
||||
|
@@ -25,10 +25,26 @@ Event \helpref{wxMediaCtrl}{wxmediactrl} uses.
|
||||
|
||||
\twocolwidtha{7cm}
|
||||
\begin{twocollist}\itemsep=0pt
|
||||
\twocolitem{{\bf EVT\_MEDIA\_LOADED(func)}}{Sent when a media has loaded enough data that it can start playing.}
|
||||
\twocolitem{{\bf EVT\_MEDIA\_LOADED(func)}}{
|
||||
Sent when a media has loaded enough data that it can start playing.}
|
||||
\twocolitem{{\bf EVT\_MEDIA\_STOP(func)}}{
|
||||
Triggerred right before the media stops. You can Veto this event to prevent it from stopping, causing it to continue playing - even if it has reached that end of the media. }
|
||||
\twocolitem{{\bf EVT\_MEDIA\_FINISHED(func)}}{Sent when a media has finished playing in a \helpref{wxMediaCtrl}{wxmediactrl}. Note that if you connect to this event and don't skip it, it will override the looping behaviour of the media control.}
|
||||
Send when a media has switched to the wxMEDIASTATE\_STOPPED state.
|
||||
You may be able to Veto this event to prevent it from stopping,
|
||||
causing it to continue playing - even if it has reached that end of the media
|
||||
(note that this may not have the desired effect - if you want to loop the
|
||||
media, for example, catch the EVT\_MEDIA\_FINISHED and play there instead). }
|
||||
\twocolitem{{\bf EVT\_MEDIA\_FINISHED(func)}}{
|
||||
Sent when a media has finished playing in a \helpref{wxMediaCtrl}{wxmediactrl}.
|
||||
}
|
||||
\twocolitem{{\bf EVT\_MEDIA\_STATECHANGED(func)}}{
|
||||
Send when a media has switched its state (from any media state).
|
||||
}
|
||||
\twocolitem{{\bf EVT\_MEDIA\_PLAY(func)}}{
|
||||
Send when a media has switched to the wxMEDIASTATE\_PLAYING state.
|
||||
}
|
||||
\twocolitem{{\bf EVT\_MEDIA\_PAUSE(func)}}{
|
||||
Send when a media has switched to the wxMEDIASTATE\_PAUSED state.
|
||||
}
|
||||
\end{twocollist}
|
||||
|
||||
\latexignore{\rtfignore{\wxheading{Members}}}
|
||||
|
Reference in New Issue
Block a user