X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42c37decc53971441199dfe4d8adf7fb842b2336..6f0344c7ff90ee54cc03a9df0f6d9f8e1f6b4897:/contrib/src/mmedia/sndaiff.cpp diff --git a/contrib/src/mmedia/sndaiff.cpp b/contrib/src/mmedia/sndaiff.cpp index c0427a7493..4567d3ae9e 100644 --- a/contrib/src/mmedia/sndaiff.cpp +++ b/contrib/src/mmedia/sndaiff.cpp @@ -4,6 +4,7 @@ // Date: 08/11/1999 // Author: Guilhem Lavaux (C) 1999 // CVSID: $Id$ +// wxWindows licence // -------------------------------------------------------------------------- #ifdef __GNUG__ #pragma implementation "sndaiff.cpp" @@ -63,25 +64,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 +92,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 +107,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 +128,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 +149,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 +166,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 +174,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)