X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e8482f24cfc00645607f8526fde38d39e0dcaa63..31ad423e4fb556ec225a63b161154d3bf3445c1b:/contrib/src/mmedia/sndoss.cpp diff --git a/contrib/src/mmedia/sndoss.cpp b/contrib/src/mmedia/sndoss.cpp index 48b35e8017..4070ca0fdc 100644 --- a/contrib/src/mmedia/sndoss.cpp +++ b/contrib/src/mmedia/sndoss.cpp @@ -24,7 +24,7 @@ #endif // -------------------------------------------------------------------------- -// wxWindows headers +// wxWidgets headers // -------------------------------------------------------------------------- #include "wx/defs.h" #include "wx/string.h" @@ -40,7 +40,7 @@ wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name) m_fd = open(dev_name.mb_str(), O_WRONLY); if (m_fd == -1) { // OSS not found - m_oss_ok = FALSE; + m_oss_ok = false; m_snderror = wxSOUND_INVDEV; return; } @@ -59,9 +59,9 @@ wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name) // Close OSS close(m_fd); - m_oss_ok = TRUE; - m_oss_stop = TRUE; - m_q_filled = TRUE; + m_oss_ok = true; + m_oss_stop = true; + m_q_filled = true; } wxSoundStreamOSS::~wxSoundStreamOSS() @@ -86,7 +86,7 @@ wxSoundStream& wxSoundStreamOSS::Read(void *buffer, wxUint32 len) } m_lastcount = (wxUint32)ret = read(m_fd, buffer, len); - m_q_filled = TRUE; + m_q_filled = true; if (ret < 0) m_snderror = wxSOUND_IOERROR; @@ -107,7 +107,7 @@ wxSoundStream& wxSoundStreamOSS::Write(const void *buffer, wxUint32 len) } ret = write(m_fd, buffer, len); - m_q_filled = TRUE; + m_q_filled = true; if (ret < 0) { m_lastcount = 0; @@ -127,12 +127,12 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format) if (format.GetType() != wxSOUND_PCM) { m_snderror = wxSOUND_INVFRMT; - return FALSE; + return false; } if (!m_oss_ok) { m_snderror = wxSOUND_INVDEV; - return FALSE; + return false; } if (m_sndformat) @@ -141,7 +141,7 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format) m_sndformat = format.Clone(); if (!m_sndformat) { m_snderror = wxSOUND_MEMERROR; - return FALSE; + return false; } pcm_format = (wxSoundFormatPcm *)m_sndformat; @@ -150,7 +150,7 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format) m_fd = open(m_devname.mb_str(), O_WRONLY); if (m_fd == -1) { m_snderror = wxSOUND_INVDEV; - return FALSE; + return false; } } @@ -176,10 +176,10 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format) m_snderror = wxSOUND_NOERROR; if (*pcm_format != format) { m_snderror = wxSOUND_NOEXACT; - return FALSE; + return false; } - return TRUE; + return true; } bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format) @@ -217,34 +217,34 @@ bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format) switch (tmp) { case AFMT_U8: pcm_format->SetBPS(8); - pcm_format->Signed(FALSE); + pcm_format->Signed(false); break; case AFMT_S8: pcm_format->SetBPS(8); - pcm_format->Signed(TRUE); + pcm_format->Signed(true); break; case AFMT_U16_LE: pcm_format->SetBPS(16); - pcm_format->Signed(FALSE); + pcm_format->Signed(false); pcm_format->SetOrder(wxLITTLE_ENDIAN); break; case AFMT_U16_BE: pcm_format->SetBPS(16); - pcm_format->Signed(FALSE); + pcm_format->Signed(false); pcm_format->SetOrder(wxBIG_ENDIAN); break; case AFMT_S16_LE: pcm_format->SetBPS(16); - pcm_format->Signed(TRUE); + pcm_format->Signed(true); pcm_format->SetOrder(wxLITTLE_ENDIAN); break; case AFMT_S16_BE: pcm_format->SetBPS(16); - pcm_format->Signed(TRUE); + pcm_format->Signed(true); pcm_format->SetOrder(wxBIG_ENDIAN); break; } - return TRUE; + return true; } #ifdef __WXGTK__ @@ -268,7 +268,7 @@ static void _wxSound_OSS_CBack(gpointer data, int source, void wxSoundStreamOSS::WakeUpEvt(int evt) { - m_q_filled = FALSE; + m_q_filled = false; OnSoundEvent(evt); } @@ -282,7 +282,7 @@ bool wxSoundStreamOSS::StartProduction(int evt) old_frmt = m_sndformat->Clone(); if (!old_frmt) { m_snderror = wxSOUND_MEMERROR; - return FALSE; + return false; } if (evt == wxSOUND_OUTPUT) @@ -292,7 +292,7 @@ bool wxSoundStreamOSS::StartProduction(int evt) if (m_fd == -1) { m_snderror = wxSOUND_INVDEV; - return FALSE; + return false; } SetSoundFormat(*old_frmt); @@ -314,25 +314,25 @@ bool wxSoundStreamOSS::StartProduction(int evt) ioctl(m_fd, SNDCTL_DSP_SETTRIGGER, &trig); - m_oss_stop = FALSE; - m_q_filled = FALSE; + m_oss_stop = false; + m_q_filled = false; - return TRUE; + return true; } bool wxSoundStreamOSS::StopProduction() { if (m_oss_stop) - return FALSE; + return false; #ifdef __WXGTK__ gdk_input_remove(m_tag); #endif close(m_fd); - m_oss_stop = TRUE; - m_q_filled = TRUE; - return TRUE; + m_oss_stop = true; + m_q_filled = true; + return true; } bool wxSoundStreamOSS::QueueFilled() const @@ -375,12 +375,12 @@ void wxSoundStreamOSS::DetectBest(wxSoundFormatPcm *pcm) // It supports signed samples if (pcm->Signed() && ((fmt_mask & (AFMT_S16_LE | AFMT_S16_BE | AFMT_S8)) != 0)) - best_pcm.Signed(TRUE); + best_pcm.Signed(true); // It supports unsigned samples if (!pcm->Signed() && ((fmt_mask & (AFMT_U16_LE | AFMT_U16_BE | AFMT_U8)) != 0)) - best_pcm.Signed(FALSE); + best_pcm.Signed(false); // Finally recopy the new format *pcm = best_pcm;