]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/mmedia/sndaiff.cpp
Include wx/statbmp.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / contrib / src / mmedia / sndaiff.cpp
index c0427a7493caad9ec03dd07cb8293d9a0fdbe029..1ec1769119cbffd7b70fb26feddd877ac6d01c97 100644 (file)
@@ -4,10 +4,8 @@
 // Date: 08/11/1999
 // Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
 // CVSID: $Id$
+// wxWindows licence
 // --------------------------------------------------------------------------
-#ifdef __GNUG__
-#pragma implementation "sndaiff.cpp"
-#endif
 
 #include "wx/wxprec.h"
 
@@ -63,25 +61,25 @@ bool wxSoundAiff::CanRead()
     wxUint32 signature1, signature2, len;
     
     if (m_input->Read(&signature1, 4).LastRead() != 4)
-        return FALSE;
+        return false;
     
     if (wxUINT32_SWAP_ON_BE(signature1) != FORM_SIGNATURE) {
         m_input->Ungetch(&signature1, 4);
-        return FALSE;
+        return false;
     }
     
     m_input->Read(&len, 4);
     if (m_input->LastRead() != 4) {
         m_input->Ungetch(&len, m_input->LastRead());
         m_input->Ungetch(&signature1, 4);
-        return FALSE;
+        return false;
     }
     
     if (m_input->Read(&signature2, 4).LastRead() != 4) {
         m_input->Ungetch(&signature2, m_input->LastRead());
         m_input->Ungetch(&len, 4);
         m_input->Ungetch(&signature1, 4);
-        return FALSE;
+        return false;
     }
     
     m_input->Ungetch(&signature2, 4);
@@ -91,12 +89,12 @@ bool wxSoundAiff::CanRead()
     if (
         wxUINT32_SWAP_ON_BE(signature2) != AIFF_SIGNATURE &&
         wxUINT32_SWAP_ON_BE(signature2) != AIFC_SIGNATURE)
-        return FALSE;
+        return false;
     
-    return TRUE;
+    return true;
 }
 
-#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return FALSE; }
+#define FAIL_WITH(condition, err) if (condition) { m_snderror = err; return false; }
 
 bool wxSoundAiff::PrepareToPlay()
 {
@@ -106,17 +104,18 @@ bool wxSoundAiff::PrepareToPlay()
     
     if (!m_input) {
         m_snderror = wxSOUND_INVSTRM;
-        return FALSE;
+        return false;
     }
     m_snderror = wxSOUND_NOERROR;
     
-    data.BigEndianOrdered(TRUE);
+    data.BigEndianOrdered(true);
     
     FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM);
     FAIL_WITH(wxUINT32_SWAP_ON_BE(signature) != FORM_SIGNATURE, wxSOUND_INVSTRM);
     // "FORM"
     
     len = data.Read32(); 
+    wxUnusedVar(len);
     FAIL_WITH(m_input->LastRead() != 4, wxSOUND_INVSTRM);
     // dummy len
     
@@ -126,7 +125,7 @@ bool wxSoundAiff::PrepareToPlay()
         wxUINT32_SWAP_ON_BE(signature) != AIFC_SIGNATURE, wxSOUND_INVSTRM);
     // "AIFF" / "AIFC"
     
-    end_headers = FALSE;
+    end_headers = false;
     while (!end_headers) {
         FAIL_WITH(m_input->Read(&signature, 4).LastRead() != 4, wxSOUND_INVSTRM);
         
@@ -147,11 +146,11 @@ bool wxSoundAiff::PrepareToPlay()
                 sndformat.SetSampleRate((wxUint32) srate);
                 sndformat.SetBPS(bps);
                 sndformat.SetChannels(channels);
-                sndformat.Signed(FALSE);
+                sndformat.Signed(false);
                 sndformat.SetOrder(wxBIG_ENDIAN);
                 
                 if (!SetSoundFormat(sndformat))
-                    return FALSE;
+                    return false;
                 // We pass all data left
                 m_input->SeekI(len-18, wxFromCurrent);
                 break;
@@ -164,7 +163,7 @@ bool wxSoundAiff::PrepareToPlay()
                 m_base_offset = m_input->TellI();
                 // len-8 bytes of samples
                 FinishPreparation(len - 8);
-                end_headers = TRUE;
+                end_headers = true;
                 break;
             }
             default:
@@ -172,28 +171,28 @@ bool wxSoundAiff::PrepareToPlay()
                 break;
         }
     }
-    return TRUE;
+    return true;
 }
 
 bool wxSoundAiff::PrepareToRecord(wxUint32 WXUNUSED(time))
 {
     // TODO
-    return FALSE;
+    return false;
 }
 
 bool wxSoundAiff::FinishRecording()
 {
     // TODO
-    return FALSE;
+    return false;
 }
 
 bool wxSoundAiff::RepositionStream(wxUint32 WXUNUSED(position))
 {
     // If the stream is not seekable "TellI() returns wxInvalidOffset" we cannot reposition stream
     if (m_base_offset == wxInvalidOffset)
-        return FALSE;
+        return false;
     m_input->SeekI(m_base_offset, wxFromStart);
-    return TRUE;
+    return true;
 }
 
 wxUint32 wxSoundAiff::GetData(void *buffer, wxUint32 len)