]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/samples/mmedia/mmbman.cpp
Applied patch [ 795491 ] Multimon sample compatibility with various conditions
[wxWidgets.git] / contrib / samples / mmedia / mmbman.cpp
index f84803f84b71ba82aedd4017a8fab00ed47f3291..fbb30965a56ef689974eaee33c7514ea1873c47b 100644 (file)
@@ -41,6 +41,7 @@
 #include "wx/mmedia/sndaiff.h"
 #include "wx/mmedia/sndpcm.h"
 #include "wx/mmedia/sndulaw.h"
 #include "wx/mmedia/sndaiff.h"
 #include "wx/mmedia/sndpcm.h"
 #include "wx/mmedia/sndulaw.h"
+#include "wx/mmedia/sndmsad.h"
 
 #ifdef __UNIX__
 #include "wx/mmedia/sndoss.h"
 
 #ifdef __UNIX__
 #include "wx/mmedia/sndoss.h"
@@ -247,7 +248,7 @@ bool MMBoardSoundFile::NeedWindow()
     return FALSE;
 }
 
     return FALSE;
 }
 
-void MMBoardSoundFile::SetWindow(wxWindow *window)
+void MMBoardSoundFile::SetWindow(wxWindow *WXUNUSED(window))
 {
 }
 
 {
 }
 
@@ -276,14 +277,25 @@ wxString MMBoardSoundFile::GetStringType()
     switch (m_file_type) {
         case MMBoard_WAVE:
             return wxString(wxT("WAVE file"));
     switch (m_file_type) {
         case MMBoard_WAVE:
             return wxString(wxT("WAVE file"));
+            #if 0
+            // break is not reachable after return
             break;
             break;
+            #endif
         case MMBoard_AIFF:
             return wxString(wxT("AIFF file"));
         case MMBoard_AIFF:
             return wxString(wxT("AIFF file"));
+            #if 0
+            // break is not reachable after return
             break;
             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;
         default:
             return wxString(wxT("Unknown file"));
             break;
+        #endif
     }
     }
+    return wxString(wxT("Unknown file"));
 }
 
 wxString MMBoardSoundFile::GetStringInformation()
 }
 
 wxString MMBoardSoundFile::GetStringInformation()
@@ -310,6 +322,16 @@ wxString MMBoardSoundFile::GetStringInformation()
        
        break;
     }
        
        break;
     }
+    case wxSOUND_MSADPCM: {
+        wxSoundFormatMSAdpcm *adpcm_format = (wxSoundFormatMSAdpcm *)format;
+
+        info += wxString::Format(wxT("Microsoft ADPCM\n"));
+        info += wxString::Format(wxT("Sampling Rate: %d\n")
+                                 wxT("Number of channels: %d\n"),
+                                 adpcm_format->GetSampleRate(),
+                                 adpcm_format->GetChannels());
+        break;
+    }
     case wxSOUND_ULAW: {
         wxSoundFormatUlaw *ulaw_format = (wxSoundFormatUlaw *)format;
        info += wxT("ULAW\n");
     case wxSOUND_ULAW: {
         wxSoundFormatUlaw *ulaw_format = (wxSoundFormatUlaw *)format;
        info += wxT("ULAW\n");
@@ -408,7 +430,7 @@ MMBoardTime MMBoardVideoFile::GetLength()
     return btime;
 }
 
     return btime;
 }
 
-void MMBoardVideoFile::SetPosition(MMBoardTime btime)
+void MMBoardVideoFile::SetPosition(MMBoardTime WXUNUSED(btime))
 {
 }
 
 {
 }
 
@@ -432,12 +454,12 @@ wxString MMBoardVideoFile::GetStringInformation()
     wxString info;
 
     info = wxT("Video codec: ");
     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 += 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());
                              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;
 }
 
     return info;
 }
 
@@ -498,7 +520,7 @@ wxSoundStream *MMBoardManager::OpenSoundStream()
     return new wxSoundStreamWin();
 #endif
 
     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;
 }
 
   return NULL;
 }