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
This commit is contained in:
Guilhem Lavaux 2000-02-25 21:28:31 +00:00
parent 0b8410f3ca
commit 171774fcf3
2 changed files with 68 additions and 8 deletions

View File

@ -99,25 +99,28 @@ bool wxVideoWindows::Resume()
if (!m_paused || m_stopped) if (!m_paused || m_stopped)
return TRUE; return TRUE;
m_paused = FALSE; 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; return m_paused;
} }
bool wxVideoWindows::IsStopped() bool wxVideoWindows::IsStopped() const
{ {
return m_stopped; return m_stopped;
} }
bool wxVideoWindows::GetSize(wxSize& size) const bool wxVideoWindows::GetSize(wxSize& size) const
{ {
// Two random numbers.
size.SetWidth(200);
size.SetHeight(200);
return TRUE; return TRUE;
} }
bool wxVideoWindows::Resize(wxUint16 w, wxUint16 h) bool wxVideoWindows::SetSize(wxSize size)
{ {
return TRUE; return TRUE;
} }
@ -161,8 +164,53 @@ bool wxVideoWindows::Play()
bool wxVideoWindows::Stop() bool wxVideoWindows::Stop()
{ {
MCI_SEEK_PARMS seekStruct;
if (m_stopped) if (m_stopped)
return FALSE; return FALSE;
m_stopped = TRUE; 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;
} }

View File

@ -72,16 +72,28 @@ public:
bool Pause(); bool Pause();
bool Resume(); bool Resume();
bool Resize(wxUint16 w, wxUint16 h);
bool GetSize(wxSize& size) const; 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 IsCapable(wxVideoType v_type);
bool AttachOutput(wxWindow& output); bool AttachOutput(wxWindow& output);
void DetachOutput(void); void DetachOutput(void);
bool IsPaused(); bool IsPaused() const;
bool IsStopped(); bool IsStopped() const;
}; };
#endif #endif