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:
@@ -64,6 +64,47 @@ enum wxMediaTimeFormat
|
|||||||
#define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend")
|
#define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend")
|
||||||
#define wxMEDIABACKEND_QUICKTIME wxT("wxQTMediaBackend")
|
#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
|
// wxMediaCtrl
|
||||||
@@ -151,7 +192,7 @@ public:
|
|||||||
wxLongLong GetDuration();
|
wxLongLong GetDuration();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void OnMediaFinished(const class wxMediaEvent& evt);
|
void OnMediaFinished(wxMediaEvent& evt);
|
||||||
virtual void DoMoveWindow(int x, int y, int w, int h);
|
virtual void DoMoveWindow(int x, int y, int w, int h);
|
||||||
wxSize DoGetBestSize() const;
|
wxSize DoGetBestSize() const;
|
||||||
|
|
||||||
@@ -224,47 +265,6 @@ public:
|
|||||||
DECLARE_CLASS(wxMediaBackend)
|
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
|
//Event ID to give to our events
|
||||||
#define wxMEDIA_FINISHED_ID 13000
|
#define wxMEDIA_FINISHED_ID 13000
|
||||||
#define wxMEDIA_STOP_ID 13001
|
#define wxMEDIA_STOP_ID 13001
|
||||||
|
@@ -430,7 +430,7 @@ MyFrame::MyFrame(const wxString& title)
|
|||||||
//
|
//
|
||||||
this->Connect(wxID_MEDIACTRL, wxEVT_MEDIA_STOP,
|
this->Connect(wxID_MEDIACTRL, wxEVT_MEDIA_STOP,
|
||||||
(wxObjectEventFunction) (wxEventFunction)
|
(wxObjectEventFunction) (wxEventFunction)
|
||||||
(wxCommandEventFunction) &MyFrame::OnMediaStop);
|
(wxMediaEventFunction) &MyFrame::OnMediaStop);
|
||||||
|
|
||||||
//
|
//
|
||||||
// End of Events
|
// End of Events
|
||||||
|
@@ -396,7 +396,7 @@ bool wxMediaCtrl::IsLooped()
|
|||||||
return m_bLoop;
|
return m_bLoop;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxMediaCtrl::OnMediaFinished(const wxMediaEvent& WXUNUSED(evt))
|
void wxMediaCtrl::OnMediaFinished(wxMediaEvent& WXUNUSED(evt))
|
||||||
{
|
{
|
||||||
if(m_bLoop)
|
if(m_bLoop)
|
||||||
{
|
{
|
||||||
|
@@ -1083,7 +1083,7 @@ bool wxMCIMediaBackend::SetPosition(wxLongLong where)
|
|||||||
{
|
{
|
||||||
MCI_SEEK_PARMS seekParms;
|
MCI_SEEK_PARMS seekParms;
|
||||||
seekParms.dwCallback = 0;
|
seekParms.dwCallback = 0;
|
||||||
seekParms.dwTo = where.GetValue();
|
seekParms.dwTo = (DWORD)where.GetValue();
|
||||||
|
|
||||||
//device was playing?
|
//device was playing?
|
||||||
bool bReplay = GetState() == wxMEDIASTATE_PLAYING;
|
bool bReplay = GetState() == wxMEDIASTATE_PLAYING;
|
||||||
|
Reference in New Issue
Block a user