X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4a31544cb557d2faad4196b79f1d96ea2d44ac55..814028444d682b23af3809227cd485f4bebc1286:/samples/mediaplayer/mediaplayer.cpp?ds=sidebyside diff --git a/samples/mediaplayer/mediaplayer.cpp b/samples/mediaplayer/mediaplayer.cpp index 9f73770f3f..0b56f3f53f 100644 --- a/samples/mediaplayer/mediaplayer.cpp +++ b/samples/mediaplayer/mediaplayer.cpp @@ -67,7 +67,18 @@ #include "wx/filename.h" // For wxFileName::GetName() #include "wx/config.h" // for native wxConfig -#ifndef __WXMSW__ +// Under MSW we have several different backends but when linking statically +// they may be discarded by the linker (this definitely happens with MSVC) so +// force linking them. You don't have to do this in your code if you don't plan +// to use them, of course. +#if defined(__WXMSW__) && !defined(WXUSINGDLL) + #include "wx/link.h" + wxFORCE_LINK_MODULE(wxmediabackend_am) + wxFORCE_LINK_MODULE(wxmediabackend_qt) + wxFORCE_LINK_MODULE(wxmediabackend_wmp10) +#endif // static wxMSW build + +#ifndef wxHAS_IMAGES_IN_RESOURCES #include "../sample.xpm" #endif @@ -76,12 +87,6 @@ // things we need // ---------------------------------------------------------------------------- -// RN: I'm not sure why this is here - even minimal doesn't check for -// wxUSE_GUI. I may have added it myself though... -#if !wxUSE_GUI -#error "This is a GUI sample" -#endif - #if !wxUSE_MEDIACTRL || !wxUSE_MENUS || !wxUSE_SLIDER || !wxUSE_TIMER || \ !wxUSE_NOTEBOOK || !wxUSE_LISTCTRL #error "Not all required elements are enabled. Please modify setup.h!" @@ -138,7 +143,7 @@ class wxMediaPlayerApp : public wxApp { public: #ifdef __WXMAC__ - virtual void MacOpenFile(const wxString & fileName ); + virtual void MacOpenFiles(const wxArrayString & fileNames ); #endif virtual bool OnInit(); @@ -399,7 +404,7 @@ const wxChar* wxGetMediaStateText(int nState) // // IMPLEMENT_APP does this, and also implements the platform-specific entry // routine, such as main or WinMain(). Use IMPLEMENT_APP_NO_MAIN if you do -// not desire this behavior. +// not desire this behaviour. // ---------------------------------------------------------------------------- IMPLEMENT_APP(wxMediaPlayerApp) @@ -458,10 +463,10 @@ bool wxMediaPlayerApp::OnInit() #ifdef __WXMAC__ -void wxMediaPlayerApp::MacOpenFile(const wxString & fileName ) +void wxMediaPlayerApp::MacOpenFiles(const wxArrayString & fileNames ) { - // Called when a user drags a file over our app - m_frame->DoOpenFile(fileName, true /* new page */); + // Called when a user drags files over our app + m_frame->DoOpenFile(fileNames[0], true /* new page */); } #endif // __WXMAC__ @@ -530,7 +535,7 @@ wxMediaPlayerFrame::wxMediaPlayerFrame(const wxString& title) wxT("Select a backend manually")); helpMenu->Append(wxID_ABOUT, - wxT("&About...\tF1"), + wxT("&About\tF1"), wxT("Show about dialog")); @@ -1640,7 +1645,7 @@ wxMediaPlayerNotebookPage::wxMediaPlayerNotebookPage(wxMediaPlayerFrame* parentF // m_slider = new wxSlider(this, wxID_SLIDER, 0, // init 0, // start - 0, // end + 1, // end, dummy but must be greater than start wxDefaultPosition, wxDefaultSize, wxSL_HORIZONTAL ); sizer->Add(m_slider, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND , 5);