1999-08-14 08:06:35 -04:00
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
// Name: sndoss.h
|
|
|
|
// Purpose:
|
|
|
|
// Date: 08/11/1999
|
|
|
|
// Author: Guilhem Lavaux <lavaux@easynet.fr> (C) 1999
|
|
|
|
// CVSID: $Id$
|
|
|
|
// --------------------------------------------------------------------------
|
|
|
|
#ifndef _WX_SNDOSS_H
|
|
|
|
#define _WX_SNDOSS_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface "sndoss.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <wx/string.h>
|
|
|
|
#include "sndbase.h"
|
|
|
|
#include "sndpcm.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// OSS output class
|
|
|
|
//
|
|
|
|
|
|
|
|
class wxSoundStreamOSS : public wxSoundStream {
|
|
|
|
public:
|
|
|
|
wxSoundStreamOSS(const wxString& dev_name = _T("/dev/dsp"));
|
|
|
|
~wxSoundStreamOSS();
|
|
|
|
|
1999-08-27 13:40:40 -04:00
|
|
|
wxSoundStream& Read(void *buffer, wxUint32 len);
|
|
|
|
wxSoundStream& Write(const void *buffer, wxUint32 len);
|
1999-08-14 08:06:35 -04:00
|
|
|
wxUint32 GetBestSize() const;
|
|
|
|
|
|
|
|
bool SetSoundFormat(const wxSoundFormatBase& format);
|
|
|
|
|
|
|
|
bool StartProduction(int evt);
|
|
|
|
bool StopProduction();
|
|
|
|
|
|
|
|
void SetDuplexMode(bool duplex) {}
|
1999-08-25 13:22:26 -04:00
|
|
|
bool QueueFilled() const;
|
1999-08-14 08:06:35 -04:00
|
|
|
|
|
|
|
// You should not call this.
|
|
|
|
void WakeUpEvt(int evt);
|
|
|
|
protected:
|
|
|
|
int m_fd;
|
|
|
|
wxUint32 m_bufsize;
|
|
|
|
int m_tag;
|
1999-08-25 13:22:26 -04:00
|
|
|
bool m_oss_stop, m_q_filled;
|
1999-08-14 08:06:35 -04:00
|
|
|
wxString m_devname;
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool SetupFormat(wxSoundFormatPcm *pcm);
|
|
|
|
void DetectBest(wxSoundFormatPcm *pcm);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|