From aa13eec58591663854bc68c987578312238cf254 Mon Sep 17 00:00:00 2001 From: Ryan Norton Date: Sun, 7 Nov 2004 11:34:15 +0000 Subject: [PATCH] correct Stopping - go to start of movie if stopped - add in preliminary docs git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30337 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/classes.tex | 2 + docs/latex/wx/moviectrl.tex | 133 +++++++++++++++++++++++++++++++++++ docs/latex/wx/movieevt.tex | 31 ++++++++ src/mac/carbon/moviectrl.cpp | 4 +- 4 files changed, 169 insertions(+), 1 deletion(-) create mode 100644 docs/latex/wx/moviectrl.tex create mode 100644 docs/latex/wx/movieevt.tex diff --git a/docs/latex/wx/classes.tex b/docs/latex/wx/classes.tex index 4f0ddf2bf5..446e7d33f7 100644 --- a/docs/latex/wx/classes.tex +++ b/docs/latex/wx/classes.tex @@ -218,6 +218,8 @@ \input mcaptevt.tex \input mouseevt.tex \input moveevt.tex +\input movieevt.tex +\input moviectrl.tex \input mltchdlg.tex \input mutex.tex \input mutexlck.tex diff --git a/docs/latex/wx/moviectrl.tex b/docs/latex/wx/moviectrl.tex new file mode 100644 index 0000000000..7ca1e5da95 --- /dev/null +++ b/docs/latex/wx/moviectrl.tex @@ -0,0 +1,133 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: moviectrl.tex +%% Purpose: wxMovieCtrl docs +%% Author: Ryan Norton +%% Modified by: +%% Created: 11/7/2004 +%% RCS-ID: $Id$ +%% Copyright: (c) Ryan Norton +%% License: wxWindows license +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{\class{wxMovieCtrl}}\label{wxmoviectrl} + +PRELIMINARY + +Plays movies - Currently Windows and Mac only. + + +\wxheading{Derived from} + +\helpref{wxControl}{wxcontrol} + +\wxheading{Include files} + + + +\latexignore{\rtfignore{\wxheading{Members}}} + + +\membersection{wxMovieCtrl::wxMovieCtrl}\label{wxmoviectrlwxmoviectrl} + +\func{}{wxMovieCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{fileName}, \param{const wxString\& }{label = wxT("")}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}} + + +\func{}{wxMovieCtrl}{\void} + +Contructors + +\docparam{parent}{parent of this control. Must not be NULL.} +\docparam{id}{id to use for events} +\docparam{fileName}{File the movie is located at.} +\docparam{label}{Control label - possible caption for the movie.} +\docparam{pos}{Position to put control at.} +\docparam{size}{Size to put the control at and to stretch movie to.} +\docparam{style}{Optional styles.} +\docparam{name}{Window name.} + + +\membersection{wxMovieCtrl::Create}\label{wxmoviectrlcreate} + +\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID }{id}, \param{const wxString\& }{fileName}, \param{const wxString\& }{label = wxT("")}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize}, \param{long }{style = 0}, \param{const wxString\& }{name = wxPanelNameStr}} + +Creates this control. Returns \tt{false} if it can't load the movie located at \tt{fileName} + + +\docparam{parent}{parent of this control. Must not be NULL.} +\docparam{id}{id to use for events} +\docparam{fileName}{File the movie is located at.} +\docparam{label}{Control label - possible caption for the movie.} +\docparam{pos}{Position to put control at.} +\docparam{size}{Size to put the control at and to stretch movie to.} +\docparam{style}{Optional styles.} +\docparam{name}{Window name.} + + +\membersection{wxMovieCtrl::GetPlaybackRate}\label{wxmoviectrlgetplaybackrate} + +\func{double}{GetPlaybackRate}{\void} + +Obtains the current playback speed of the movie. 1.0 equals normal speed, 0.5 half, etc. + + +\membersection{wxMovieCtrl::GetState}\label{wxmoviectrlgetstate} + +\func{wxMovieCtrlState}{GetState}{\void} + +Obtains the state the playback of the movie is in - + +\twocolwidtha{7cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf wxMOVIECTRL\_STOPPED}}{The movie has stopped.} +\twocolitem{{\bf wxMOVIECTRL\_PAUSED}}{The movie is paused.} +\twocolitem{{\bf wxMOVIECTRL\_PLAYING}}{The movie is currently playing.} +\end{twocollist} + + +\membersection{wxMovieCtrl::Length}\label{wxmoviectrllength} + +\func{wxTimeSpan}{Length}{\void} + +Obtains the length - the total amount of time the movie has + + +\membersection{wxMovieCtrl::Pause}\label{wxmoviectrlpause} + +\func{bool}{Pause}{\void} + +Pauses playback of the movie. + + +\membersection{wxMovieCtrl::Play}\label{wxmoviectrlplay} + +\func{bool}{Play}{\void} + +Resumes playback of the movie. + + +\membersection{wxMovieCtrl::Seek}\label{wxmoviectrlseek} + +\func{bool}{Seek}{\param{const wxTimeSpan\& }{where}} + +Seeks to a position within the movie. + + +\membersection{wxMovieCtrl::SetPlaybackRate}\label{wxmoviectrlsetplaybackrate} + +\func{bool}{SetPlaybackRate}{\param{double }{dRate}} + +Sets the current playback speed of the movie. 1.0 equals normal speed, 0.5 half, etc. + + +\membersection{wxMovieCtrl::Stop}\label{wxmoviectrlstop} + +\func{bool}{Stop}{\void} + +Stops the movie and rewinds the movie to the start. + + +\membersection{wxMovieCtrl::Tell}\label{wxmoviectrltell} + +\func{wxTimeSpan}{Tell}{\void} + +Obtains the current position in time within the movie. diff --git a/docs/latex/wx/movieevt.tex b/docs/latex/wx/movieevt.tex new file mode 100644 index 0000000000..b415bc27b6 --- /dev/null +++ b/docs/latex/wx/movieevt.tex @@ -0,0 +1,31 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Name: movieevt.tex +%% Purpose: wxMovieEvent docs +%% Author: Ryan Norton +%% Modified by: +%% Created: 11/7/2004 +%% RCS-ID: $Id$ +%% Copyright: (c) Ryan Norton +%% License: wxWindows license +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{\class{wxMovieEvent}}\label{wxmovieevent} + +Event \helpref{wxMovieCtrl}{wxmoviectrl} uses. + +\wxheading{Derived from} + +\helpref{wxNotifyEvent}{wxnotifyevent} + +\wxheading{Include files} + + + +\wxheading{Event table macros} + +\twocolwidtha{7cm} +\begin{twocollist}\itemsep=0pt +\twocolitem{{\bf EVT\_MOVIE\_FINISHED(func)}}{Sent when a movie has finished playing in a \helpref{wxMovieCtrl}{wxmoviectrl}.} +\end{twocollist} + +\latexignore{\rtfignore{\wxheading{Members}}} diff --git a/src/mac/carbon/moviectrl.cpp b/src/mac/carbon/moviectrl.cpp index 86f296a90e..f4d141f787 100644 --- a/src/mac/carbon/moviectrl.cpp +++ b/src/mac/carbon/moviectrl.cpp @@ -76,6 +76,8 @@ public: else { Stop(); + ::GoToBeginningOfMovie(m_movie); + wxASSERT( ::GetMoviesError() == noErr ); wxMovieEvent theEvent(wxEVT_MOVIE_FINISHED, m_parent->GetId()); m_parent->GetParent()->ProcessEvent(theEvent); } @@ -234,7 +236,7 @@ bool wxMovieCtrl::Stop() if(::GetMoviesError() != noErr) return false; - ::GoToEndOfMovie(m_movie); + ::GoToBeginningOfMovie(m_movie); return ::GetMoviesError() == noErr; } -- 2.45.2