Define wxMediaEvent before it is used. Make OnMediaFinish compatible to wxObjectEventFunction. Warning fix.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30568 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2004-11-16 13:49:27 +00:00
parent 00ba414f7f
commit 226ec5a71a
4 changed files with 356 additions and 356 deletions

View File

@@ -64,6 +64,47 @@ enum wxMediaTimeFormat
#define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend")
#define wxMEDIABACKEND_QUICKTIME wxT("wxQTMediaBackend")
// ----------------------------------------------------------------------------
//
// wxMediaEvent
//
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMediaEvent : public wxNotifyEvent
{
public:
// ------------------------------------------------------------------------
// wxMediaEvent Constructor
//
// Normal constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
: wxNotifyEvent(commandType, id)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent Copy Constructor
//
// Normal copy constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(const wxMediaEvent &clone)
: wxNotifyEvent(clone)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent::Clone
//
// Allocates a copy of this object.
// Required for wxEvtHandler::AddPendingEvent
// ------------------------------------------------------------------------
virtual wxEvent *Clone() const
{ return new wxMediaEvent(*this); }
// Put this class on wxWidget's RTTI table
DECLARE_DYNAMIC_CLASS(wxMediaEvent)
};
// ----------------------------------------------------------------------------
//
// wxMediaCtrl
@@ -151,7 +192,7 @@ public:
wxLongLong GetDuration();
protected:
void OnMediaFinished(const class wxMediaEvent& evt);
void OnMediaFinished(wxMediaEvent& evt);
virtual void DoMoveWindow(int x, int y, int w, int h);
wxSize DoGetBestSize() const;
@@ -224,47 +265,6 @@ public:
DECLARE_CLASS(wxMediaBackend)
};
// ----------------------------------------------------------------------------
//
// wxMediaEvent
//
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMediaEvent : public wxNotifyEvent
{
public:
// ------------------------------------------------------------------------
// wxMediaEvent Constructor
//
// Normal constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
: wxNotifyEvent(commandType, id)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent Copy Constructor
//
// Normal copy constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(const wxMediaEvent &clone)
: wxNotifyEvent(clone)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent::Clone
//
// Allocates a copy of this object.
// Required for wxEvtHandler::AddPendingEvent
// ------------------------------------------------------------------------
virtual wxEvent *Clone() const
{ return new wxMediaEvent(*this); }
// Put this class on wxWidget's RTTI table
DECLARE_DYNAMIC_CLASS(wxMediaEvent)
};
//Event ID to give to our events
#define wxMEDIA_FINISHED_ID 13000
#define wxMEDIA_STOP_ID 13001

View File

@@ -430,7 +430,7 @@ MyFrame::MyFrame(const wxString& title)
//
this->Connect(wxID_MEDIACTRL, wxEVT_MEDIA_STOP,
(wxObjectEventFunction) (wxEventFunction)
(wxCommandEventFunction) &MyFrame::OnMediaStop);
(wxMediaEventFunction) &MyFrame::OnMediaStop);
//
// End of Events

View File

@@ -396,7 +396,7 @@ bool wxMediaCtrl::IsLooped()
return m_bLoop;
}
void wxMediaCtrl::OnMediaFinished(const wxMediaEvent& WXUNUSED(evt))
void wxMediaCtrl::OnMediaFinished(wxMediaEvent& WXUNUSED(evt))
{
if(m_bLoop)
{

View File

@@ -1083,7 +1083,7 @@ bool wxMCIMediaBackend::SetPosition(wxLongLong where)
{
MCI_SEEK_PARMS seekParms;
seekParms.dwCallback = 0;
seekParms.dwTo = where.GetValue();
seekParms.dwTo = (DWORD)where.GetValue();
//device was playing?
bool bReplay = GetState() == wxMEDIASTATE_PLAYING;