X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8482f24cfc00645607f8526fde38d39e0dcaa63..209f3e1453dd576919bf1cc8f696218dae23c34b:/contrib/src/mmedia/sndcpcm.cpp?ds=sidebyside diff --git a/contrib/src/mmedia/sndcpcm.cpp b/contrib/src/mmedia/sndcpcm.cpp index 3eddf09eb2..9f4e56c0f0 100644 --- a/contrib/src/mmedia/sndcpcm.cpp +++ b/contrib/src/mmedia/sndcpcm.cpp @@ -4,6 +4,7 @@ // Date: 08/11/1999 // Author: Guilhem Lavaux (C) 1999, 2000 // CVSID: $Id$ +// wxWindows licence // -------------------------------------------------------------------------- #ifdef __GNUG__ #pragma implementation "sndcpcm.cpp" @@ -51,7 +52,7 @@ wxUint32 wxSoundStreamPcm::GetBestSize() const // ----------------------------------------------------------------------- #define DEFINE_CONV(name, input_type, output_type, convert) \ -static void Convert_##name##(const void *buf_in, void *buf_out, wxUint32 len) \ +static void Convert_##name(const void *buf_in, void *buf_out, wxUint32 len) \ {\ register input_type src; \ register const input_type *t_buf_in = (input_type *)buf_in; \ @@ -279,11 +280,11 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format) if (m_sndio->SetSoundFormat(format)) { m_function_out = NULL; m_function_in = NULL; - return TRUE; + return true; } if (format.GetType() != wxSOUND_PCM) { m_snderror = wxSOUND_INVFRMT; - return FALSE; + return false; } if (m_sndformat) delete m_sndformat; @@ -300,11 +301,11 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format) src_rate = pcm_format->GetSampleRate(); dst_rate = pcm_format2->GetSampleRate(); - m_needResampling = TRUE; + m_needResampling = true; if (src_rate < dst_rate) - m_expandSamples = TRUE; + m_expandSamples = true; else - m_expandSamples = FALSE; + m_expandSamples = false; m_pitch = (src_rate << FLOATBITS) / dst_rate; } #endif @@ -327,7 +328,7 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format) break; default: // TODO: Add something here: error, log, ... - return FALSE; + return false; } switch (pcm_format2->GetBPS()) { case 8: @@ -338,7 +339,7 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format) break; default: // TODO: Add something here: error, log, ... - return FALSE; + return false; } if (pcm_format2->Signed() != pcm_format->Signed()) @@ -379,11 +380,15 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format) // We try to minimize the need of dynamic memory allocation by preallocating a buffer. But // to be sure it will be efficient we minimize the best size. if (m_multiplier_in < m_multiplier_out) { - m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_out); - m_best_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_in); + m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * + m_multiplier_out); + m_best_size = (wxUint32)(m_sndio->GetBestSize() * + m_multiplier_in); } else { - m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_in); - m_best_size = (wxUint32)(m_sndio->GetBestSize() * m_multiplier_out); + m_prebuffer_size = (wxUint32)(m_sndio->GetBestSize() * + m_multiplier_in); + m_best_size = (wxUint32)(m_sndio->GetBestSize() * + m_multiplier_out); } m_prebuffer = new char[m_prebuffer_size]; @@ -392,9 +397,10 @@ bool wxSoundStreamPcm::SetSoundFormat(const wxSoundFormatBase& format) SetSoundFormatReturn = m_sndio->SetSoundFormat(*new_format); wxASSERT( SetSoundFormatReturn ); + wxUnusedVar( SetSoundFormatReturn ); m_sndformat = new_format; - return TRUE; + return true; } wxUint32 wxSoundStreamPcm::GetWriteSize(wxUint32 len) const