Renamed StartPlay in Play
Added wxVideoBaseDriver::GetSize
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3521
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
pcm->Signed(TRUE);
pcm->SetOrder(wxLITTLE_ENDIAN);
- if (!SetSoundFormat(*pcm))
+ if (!SetSoundFormat(*pcm)) {
+ delete pcm;
return FALSE;
+ }
delete pcm;
}
vid_out->DynamicSize(TRUE);
frame->Layout();
frame->Show(TRUE);
- wxYield();
vid_drv->AttachOutput(*vid_out);
+ vid_drv->Play();
return frame;
}
public:
friend class wxVideoOutput;
- ///
+ //
wxVideoBaseDriver();
- ///
+ //
wxVideoBaseDriver(wxInputStream& str);
- ///
+ //
virtual ~wxVideoBaseDriver();
- ///
+
+ //
+ virtual bool Play() = 0;
+ //
+ virtual bool Stop() = 0;
+ //
virtual bool Pause() = 0;
- ///
+ //
virtual bool Resume() = 0;
- ///
+ //
virtual bool SetVolume(wxUint8 vol) = 0;
- ///
+ //
virtual bool Resize(wxUint16 w, wxUint16 h) = 0;
+ //
+ virtual bool GetSize(wxSize& size) const = 0;
- ///
+ //
virtual bool IsCapable(wxVideoType WXUNUSED(v_type)) { return FALSE; }
- ///
+ //
virtual void OnFinished() {}
- ///
+ //
virtual bool AttachOutput(wxVideoOutput& output);
- ///
+ //
virtual void DetachOutput();
};
wxVideoXANIM::~wxVideoXANIM()
{
if (m_xanim_started)
- StopPlay();
+ Stop();
delete m_internal;
wxRemoveFile(m_filename);
}
-bool wxVideoXANIM::StartPlay()
+bool wxVideoXANIM::Play()
{
if (!m_paused && m_xanim_started)
return TRUE;
return TRUE;
}
- if (SendCommand(" ")) {
+ // The movie starts with xanim
+ if (RestartXANIM()) {
m_paused = FALSE;
return TRUE;
}
return FALSE;
}
-void wxVideoXANIM::StopPlay()
+bool wxVideoXANIM::Stop()
{
if (!m_xanim_started)
- return;
+ return FALSE;
SendCommand("q");
m_xanim_started = FALSE;
m_paused = FALSE;
+
+ return TRUE;
}
bool wxVideoXANIM::SetVolume(wxUint8 vol)
return FALSE;
}
+bool wxVideoXANIM::GetSize(wxSize& size) const
+{
+ // Not implemented
+ return FALSE;
+}
+
bool wxVideoXANIM::IsCapable(wxVideoType v_type)
{
if (v_type == wxVIDEO_MSAVI || v_type == wxVIDEO_MPEG ||
if (!wxVideoBaseDriver::AttachOutput(out))
return FALSE;
- return RestartXANIM();
+ return TRUE;
}
void wxVideoXANIM::DetachOutput()
// wxYield();
}
-// m_paused = TRUE;
+ m_paused = FALSE;
m_xanim_started = TRUE;
return TRUE;
wxVideoXANIM(wxInputStream& str);
~wxVideoXANIM();
- bool StartPlay();
+ bool Play();
bool Pause();
bool Resume();
- void StopPlay();
+ bool Stop();
bool SetVolume(wxUint8 vol);
bool Resize(wxUint16 w, wxUint16 h);
+ bool GetSize(wxSize& size) const;
bool IsCapable(wxVideoType v_type);