From 171774fcf39d89d62bccc2e035d44f2f3a6495e7 Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 25 Feb 2000 21:28:31 +0000 Subject: [PATCH] Ok. Vidwin works again on Windows. Extremely urgent: it must behave the same way as wxVideoXANIM git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- utils/wxMMedia2/lib/vidwin.cpp | 58 +++++++++++++++++++++++++++++++--- utils/wxMMedia2/lib/vidwin.h | 18 +++++++++-- 2 files changed, 68 insertions(+), 8 deletions(-) diff --git a/utils/wxMMedia2/lib/vidwin.cpp b/utils/wxMMedia2/lib/vidwin.cpp index e8e478039e..b6f5ee9914 100644 --- a/utils/wxMMedia2/lib/vidwin.cpp +++ b/utils/wxMMedia2/lib/vidwin.cpp @@ -99,25 +99,28 @@ bool wxVideoWindows::Resume() if (!m_paused || m_stopped) return TRUE; m_paused = FALSE; - return (mciSendCommand(m_internal->m_dev_id, MCI_PAUSE, 0, 0) == 0); + return (mciSendCommand(m_internal->m_dev_id, MCI_RESUME, 0, 0) == 0); } -bool wxVideoWindows::IsPaused() +bool wxVideoWindows::IsPaused() const { return m_paused; } -bool wxVideoWindows::IsStopped() +bool wxVideoWindows::IsStopped() const { return m_stopped; } bool wxVideoWindows::GetSize(wxSize& size) const { + // Two random numbers. + size.SetWidth(200); + size.SetHeight(200); return TRUE; } -bool wxVideoWindows::Resize(wxUint16 w, wxUint16 h) +bool wxVideoWindows::SetSize(wxSize size) { return TRUE; } @@ -161,8 +164,53 @@ bool wxVideoWindows::Play() bool wxVideoWindows::Stop() { + MCI_SEEK_PARMS seekStruct; + if (m_stopped) return FALSE; m_stopped = TRUE; - return (mciSendCommand(m_internal->m_dev_id, MCI_STOP, 0, NULL) == 0); + if (::mciSendCommand(m_internal->m_dev_id, MCI_STOP, 0, NULL) != 0) + return FALSE; + + seekStruct.dwCallback = 0; + seekStruct.dwTo = 0; + return (::mciSendCommand(m_internal->m_dev_id, MCI_SEEK, 0, (DWORD)(LPVOID)&seekStruct) == 0); +} + + +// TODO TODO + +wxString wxVideoWindows::GetMovieCodec() const +{ + return wxT("No info"); +} + +wxString wxVideoWindows::GetAudioCodec() const +{ + return wxT("No info"); +} + +wxUint32 wxVideoWindows::GetSampleRate() const +{ + return 22500; +} + +wxUint8 wxVideoWindows::GetChannels() const +{ + return 1; +} + +wxUint8 wxVideoWindows::GetBPS() const +{ + return 8; +} + +double wxVideoWindows::GetFrameRate() const +{ + return 1.0; +} + +wxUint32 wxVideoWindows::GetNbFrames() const +{ + return 0; } diff --git a/utils/wxMMedia2/lib/vidwin.h b/utils/wxMMedia2/lib/vidwin.h index db1877591f..fd8a64b2b6 100644 --- a/utils/wxMMedia2/lib/vidwin.h +++ b/utils/wxMMedia2/lib/vidwin.h @@ -72,16 +72,28 @@ public: bool Pause(); bool Resume(); - bool Resize(wxUint16 w, wxUint16 h); bool GetSize(wxSize& size) const; + bool SetSize(wxSize size); + + // Return codec name for each stream. + wxString GetMovieCodec() const; + wxString GetAudioCodec() const; + // Return misc. info about audio + wxUint32 GetSampleRate() const; + wxUint8 GetChannels() const; + wxUint8 GetBPS() const; + // Return the frame rate of the video (in frames/second) + double GetFrameRate() const; + // Return the total number of frames in the movie + wxUint32 GetNbFrames() const; bool IsCapable(wxVideoType v_type); bool AttachOutput(wxWindow& output); void DetachOutput(void); - bool IsPaused(); - bool IsStopped(); + bool IsPaused() const; + bool IsStopped() const; }; #endif