1// -------------------------------------------------------------------------- 2// Name: sndoss.h 3// Purpose: 4// Date: 08/11/1999 5// Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999 6// CVSID: $Id: sndoss.h 35650 2005-09-23 12:56:45Z MR $ 7// License: wxWindows license 8// -------------------------------------------------------------------------- 9#ifndef _WX_SNDOSS_H 10#define _WX_SNDOSS_H 11 12#include "wx/defs.h" 13#include "wx/string.h" 14#include "wx/mmedia/defs.h" 15#include "wx/mmedia/sndbase.h" 16#include "wx/mmedia/sndpcm.h" 17 18// 19// OSS output class 20// 21 22class WXDLLIMPEXP_MMEDIA wxSoundStreamOSS : public wxSoundStream { 23 public: 24 wxSoundStreamOSS(const wxString& dev_name = wxT("/dev/dsp")); 25 ~wxSoundStreamOSS(); 26 27 wxSoundStream& Read(void *buffer, wxUint32 len); 28 wxSoundStream& Write(const void *buffer, wxUint32 len); 29 wxUint32 GetBestSize() const; 30 31 bool SetSoundFormat(const wxSoundFormatBase& format); 32 33 bool StartProduction(int evt); 34 bool StopProduction(); 35 36 bool QueueFilled() const; 37 38 // You should not call this. 39 void WakeUpEvt(int evt); 40 protected: 41 // OSS device 42 int m_fd; 43 wxUint32 m_bufsize; 44 int m_tag; 45 bool m_oss_stop, m_oss_ok, m_q_filled; 46 wxString m_devname; 47 48 private: 49 bool SetupFormat(wxSoundFormatPcm *pcm); 50 void DetectBest(wxSoundFormatPcm *pcm); 51}; 52 53#endif 54