From 51884c240488d748cca010c390c46fb23933f141 Mon Sep 17 00:00:00 2001 From: Ryan Norton Date: Mon, 8 Nov 2004 02:23:43 +0000 Subject: [PATCH] finalize MAC implementation git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/moviectrl.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/mac/carbon/moviectrl.cpp b/src/mac/carbon/moviectrl.cpp index ba21a9a1d4..9b8aba6d0a 100644 --- a/src/mac/carbon/moviectrl.cpp +++ b/src/mac/carbon/moviectrl.cpp @@ -74,8 +74,6 @@ public: else { Stop(); - ::GoToBeginningOfMovie(m_movie); - wxASSERT( ::GetMoviesError() == noErr ); wxMovieEvent theEvent(wxEVT_MOVIE_FINISHED, m_parent->GetId()); m_parent->GetParent()->ProcessEvent(theEvent); } @@ -247,12 +245,13 @@ bool wxMovieCtrl::Pause() bool wxMovieCtrl::Stop() { m_timer->SetPaused(false); + m_timer->Stop(); ::StopMovie(m_movie); if(::GetMoviesError() != noErr) return false; - ::GoToBeginningOfMovie(m_movie); + ::GoToEndOfMovie(m_movie); return ::GetMoviesError() == noErr; } @@ -272,7 +271,8 @@ bool wxMovieCtrl::SetPlaybackRate(double dRate) bool wxMovieCtrl::Seek(const wxTimeSpan& where) { TimeRecord theTimeRecord; - theTimeRecord.value.lo = ((size_t)where.GetMilliseconds().ToLong()) * 10; + memset(&theTimeRecord, 0, sizeof(TimeRecord)); + theTimeRecord.value.lo = ((size_t)where.GetMilliseconds().ToLong()); theTimeRecord.scale = ::GetMovieTimeScale(m_movie); theTimeRecord.base = ::GetMovieTimeBase(m_movie); ::SetMovieTime(m_movie, &theTimeRecord); @@ -285,12 +285,12 @@ bool wxMovieCtrl::Seek(const wxTimeSpan& where) wxTimeSpan wxMovieCtrl::Tell() { - return (wxTimeSpan) ::GetMovieTime(m_movie, NULL); + return wxTimeSpan(0,0,0, ::GetMovieTime(m_movie, NULL)); } wxTimeSpan wxMovieCtrl::Length() { - return (wxTimeSpan) ::GetMovieDuration(m_movie); + return wxTimeSpan(0,0,0, ::GetMovieDuration(m_movie)); } #endif // wxUSE_DATETIME @@ -298,10 +298,10 @@ wxTimeSpan wxMovieCtrl::Length() wxMovieCtrlState wxMovieCtrl::GetState() { if( m_timer->IsRunning() == true ) - return wxMOVIECTRL_STOPPED; + return wxMOVIECTRL_PLAYING; if ( m_timer->GetPaused() == false ) - return wxMOVIECTRL_PLAYING; + return wxMOVIECTRL_STOPPED; else return wxMOVIECTRL_PAUSED; } -- 2.47.2