From 2bbf230a16e2299eeac1f5edea1c067b7358efbc Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 11 Sep 2003 09:55:21 +0000 Subject: [PATCH] Applied patch [ 795423 ] Unicode and warning fixes in contrib/mmedia lib and sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23502 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/mmedia/sndwin.h | 2 +- contrib/include/wx/mmedia/vidwin.h | 2 +- contrib/samples/mmedia/mmbman.cpp | 23 +++++++++++++++++------ contrib/samples/mmedia/mmboard.cpp | 18 +++++++++--------- contrib/src/mmedia/sndwin.cpp | 2 +- contrib/src/mmedia/vidwin.cpp | 2 +- 6 files changed, 30 insertions(+), 19 deletions(-) diff --git a/contrib/include/wx/mmedia/sndwin.h b/contrib/include/wx/mmedia/sndwin.h index d178f401c2..52d866d1db 100644 --- a/contrib/include/wx/mmedia/sndwin.h +++ b/contrib/include/wx/mmedia/sndwin.h @@ -24,7 +24,7 @@ class WXDLLIMPEXP_MMEDIA wxSoundStreamWin : public wxSoundStream { wxSoundStream& Write(const void *buffer, wxUint32 len); wxSoundStream& Read(void *buffer, wxUint32 len); - bool SetSoundFormat(wxSoundFormatBase& base); + bool SetSoundFormat(const wxSoundFormatBase& base); bool StartProduction(int evt); bool StopProduction(); diff --git a/contrib/include/wx/mmedia/vidwin.h b/contrib/include/wx/mmedia/vidwin.h index a5e7a38913..c0b0a319ae 100644 --- a/contrib/include/wx/mmedia/vidwin.h +++ b/contrib/include/wx/mmedia/vidwin.h @@ -90,7 +90,7 @@ public: // Return the total number of frames in the movie wxUint32 GetNbFrames() const; - bool IsCapable(wxVideoType v_type); + bool IsCapable(wxVideoType v_type) const; bool AttachOutput(wxWindow& output); void DetachOutput(void); diff --git a/contrib/samples/mmedia/mmbman.cpp b/contrib/samples/mmedia/mmbman.cpp index b60fc8429e..fbb30965a5 100644 --- a/contrib/samples/mmedia/mmbman.cpp +++ b/contrib/samples/mmedia/mmbman.cpp @@ -248,7 +248,7 @@ bool MMBoardSoundFile::NeedWindow() return FALSE; } -void MMBoardSoundFile::SetWindow(wxWindow *window) +void MMBoardSoundFile::SetWindow(wxWindow *WXUNUSED(window)) { } @@ -277,14 +277,25 @@ wxString MMBoardSoundFile::GetStringType() switch (m_file_type) { case MMBoard_WAVE: return wxString(wxT("WAVE file")); + #if 0 + // break is not reachable after return break; + #endif case MMBoard_AIFF: return wxString(wxT("AIFF file")); + #if 0 + // break is not reachable after return break; + #endif + #if 0 + // default moved outside switch for those compilers + // which complain about lack of return in function default: return wxString(wxT("Unknown file")); break; + #endif } + return wxString(wxT("Unknown file")); } wxString MMBoardSoundFile::GetStringInformation() @@ -419,7 +430,7 @@ MMBoardTime MMBoardVideoFile::GetLength() return btime; } -void MMBoardVideoFile::SetPosition(MMBoardTime btime) +void MMBoardVideoFile::SetPosition(MMBoardTime WXUNUSED(btime)) { } @@ -443,12 +454,12 @@ wxString MMBoardVideoFile::GetStringInformation() wxString info; info = wxT("Video codec: "); - info += m_video_driver->GetMovieCodec() + "\n"; + info += m_video_driver->GetMovieCodec() + _T("\n"); info += wxT("Audio codec: "); info += m_video_driver->GetAudioCodec(); - info += wxString::Format(" Sample rate: %d Channels: %d\n", m_video_driver->GetSampleRate(), + info += wxString::Format(_T(" Sample rate: %d Channels: %d\n"), m_video_driver->GetSampleRate(), m_video_driver->GetBPS()); - info += wxString::Format(" Frame rate: %.01f", m_video_driver->GetFrameRate()); + info += wxString::Format(_T(" Frame rate: %.01f"), m_video_driver->GetFrameRate()); return info; } @@ -509,7 +520,7 @@ wxSoundStream *MMBoardManager::OpenSoundStream() return new wxSoundStreamWin(); #endif - wxMessageBox("You are trying to open a multimedia but you have not devices", "Error", wxOK | wxICON_ERROR, NULL); + wxMessageBox(_T("You are trying to open a multimedia but you have not devices"), _T("Error"), wxOK | wxICON_ERROR, NULL); return NULL; } diff --git a/contrib/samples/mmedia/mmboard.cpp b/contrib/samples/mmedia/mmboard.cpp index a5450edfa1..8d4df27c0b 100644 --- a/contrib/samples/mmedia/mmboard.cpp +++ b/contrib/samples/mmedia/mmboard.cpp @@ -164,7 +164,7 @@ IMPLEMENT_APP(MMBoardApp) bool MMBoardApp::OnInit() { // create the main application window - MMBoardFrame *frame = new MMBoardFrame("Multimedia Board", + MMBoardFrame *frame = new MMBoardFrame(_T("Multimedia Board"), wxPoint(50, 50), wxSize(450, 340)); // and show it (the frames, unlike simple controls, are not shown when @@ -174,16 +174,16 @@ bool MMBoardApp::OnInit() m_caps = TestMultimediaCaps(); if (!m_caps) { - wxMessageBox("Your system has no multimedia capabilities. We are exiting now.", "Major error !", wxOK | wxICON_ERROR, NULL); + wxMessageBox(_T("Your system has no multimedia capabilities. We are exiting now."), _T("Major error !"), wxOK | wxICON_ERROR, NULL); return FALSE; } wxString msg; - msg.Printf("Detected : %s%s%s", (m_caps & MM_SOUND_OSS) ? "OSS " : "", - (m_caps & MM_SOUND_ESD) ? "ESD " : "", - (m_caps & MM_SOUND_WIN) ? "WIN" : ""); + msg.Printf(_T("Detected : %s%s%s"), (m_caps & MM_SOUND_OSS) ? _T("OSS ") : _T(""), + (m_caps & MM_SOUND_ESD) ? _T("ESD ") : _T(""), + (m_caps & MM_SOUND_WIN) ? _T("WIN") : _T("")); - wxMessageBox(msg, "Good !", wxOK | wxICON_INFORMATION, NULL); + wxMessageBox(msg, _T("Good !"), wxOK | wxICON_INFORMATION, NULL); // success: wxApp::OnRun() will be called which will enter the main message // loop and the application will run. If we returned FALSE here, the @@ -298,7 +298,7 @@ MMBoardFrame::MMBoardFrame(const wxString& title, const wxPoint& pos, const wxSi m_fileType = new wxStaticText(infoPanel, -1, wxT("")); wxStaticLine *line = new wxStaticLine(infoPanel, -1); - m_infoText = new wxStaticText(infoPanel, -1, ""); + m_infoText = new wxStaticText(infoPanel, -1, _T("")); UpdateInfoText(); @@ -402,7 +402,7 @@ void MMBoardFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) wxT("an example of the capabilities of the wxWindows multimedia classes.\n") wxT("Copyright 1999, 2000, Guilhem Lavaux.\n")); - wxMessageBox(msg, "About MMBoard", wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, _T("About MMBoard"), wxOK | wxICON_INFORMATION, this); } void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) @@ -418,7 +418,7 @@ void MMBoardFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) } // select a file to be opened - selected_file = wxLoadFileSelector("multimedia", "*", NULL, this); + selected_file = wxLoadFileSelector(_T("multimedia"), _T("*"), NULL, this); if (selected_file.IsNull()) return; diff --git a/contrib/src/mmedia/sndwin.cpp b/contrib/src/mmedia/sndwin.cpp index 78ad0292b0..7e0795e895 100644 --- a/contrib/src/mmedia/sndwin.cpp +++ b/contrib/src/mmedia/sndwin.cpp @@ -693,7 +693,7 @@ void wxSoundStreamWin::NotifyDoneBuffer(wxUint32 WXUNUSED(dev_handle), int flag) // ------------------------------------------------------------------------- // SetSoundFormat() // ------------------------------------------------------------------------- -bool wxSoundStreamWin::SetSoundFormat(wxSoundFormatBase& base) +bool wxSoundStreamWin::SetSoundFormat(const wxSoundFormatBase& base) { // TODO: detect best format return wxSoundStream::SetSoundFormat(base); diff --git a/contrib/src/mmedia/vidwin.cpp b/contrib/src/mmedia/vidwin.cpp index 1d9bf5c7c1..608d1ae029 100644 --- a/contrib/src/mmedia/vidwin.cpp +++ b/contrib/src/mmedia/vidwin.cpp @@ -155,7 +155,7 @@ bool wxVideoWindows::SetSize(wxSize WXUNUSED(size)) return TRUE; } -bool wxVideoWindows::IsCapable(wxVideoType v_type) +bool wxVideoWindows::IsCapable(wxVideoType v_type) const { return (v_type == wxVIDEO_MSAVI); } -- 2.45.2