git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -60,30 +60,30 @@ wxSoundStreamESD::wxSoundStreamESD(const wxString& hostname)
|
|||||||
return;
|
return;
|
||||||
#else
|
#else
|
||||||
wxSoundFormatPcm pcm_default;
|
wxSoundFormatPcm pcm_default;
|
||||||
|
|
||||||
// First, we make some basic test: is there ESD on this computer ?
|
// First, we make some basic test: is there ESD on this computer ?
|
||||||
m_esd_ok = false;
|
m_esd_ok = false;
|
||||||
|
|
||||||
if (hostname.IsNull())
|
if (hostname.IsNull())
|
||||||
m_fd_output = esd_play_stream(ESD_PLAY | ESD_STREAM, 22050,
|
m_fd_output = esd_play_stream(ESD_PLAY | ESD_STREAM, 22050,
|
||||||
hostname.mb_str(), MY_ESD_NAME);
|
hostname.mb_str(), MY_ESD_NAME);
|
||||||
else
|
else
|
||||||
m_fd_output = esd_play_stream(ESD_PLAY | ESD_STREAM, 22050,
|
m_fd_output = esd_play_stream(ESD_PLAY | ESD_STREAM, 22050,
|
||||||
NULL, MY_ESD_NAME);
|
NULL, MY_ESD_NAME);
|
||||||
if (m_fd_output == -1) {
|
if (m_fd_output == -1) {
|
||||||
// Answer: no. We return with an error.
|
// Answer: no. We return with an error.
|
||||||
m_snderror = wxSOUND_INVDEV;
|
m_snderror = wxSOUND_INVDEV;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Close this unuseful stream.
|
// Close this unuseful stream.
|
||||||
esd_close(m_fd_output);
|
esd_close(m_fd_output);
|
||||||
|
|
||||||
m_hostname = hostname;
|
m_hostname = hostname;
|
||||||
|
|
||||||
// Set the default audio format
|
// Set the default audio format
|
||||||
SetSoundFormat(pcm_default);
|
SetSoundFormat(pcm_default);
|
||||||
|
|
||||||
// Initialize some variable
|
// Initialize some variable
|
||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
m_esd_stop = true;
|
m_esd_stop = true;
|
||||||
@@ -113,19 +113,20 @@ wxSoundStream& wxSoundStreamESD::Read(void *buffer, wxUint32 len)
|
|||||||
return *this;
|
return *this;
|
||||||
#else
|
#else
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (m_esd_stop) {
|
if (m_esd_stop) {
|
||||||
m_snderror = wxSOUND_NOTSTARTED;
|
m_snderror = wxSOUND_NOTSTARTED;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastcount = (wxUint32)ret = read(m_fd_input, buffer, len);
|
ret = read(m_fd_input, buffer, len);
|
||||||
|
m_lastcount = (wxUint32)ret;
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
m_snderror = wxSOUND_IOERROR;
|
m_snderror = wxSOUND_IOERROR;
|
||||||
else
|
else
|
||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
#endif // defined HAVE_ESD_H
|
#endif // defined HAVE_ESD_H
|
||||||
}
|
}
|
||||||
@@ -146,16 +147,17 @@ wxSoundStream& wxSoundStreamESD::Write(const void *buffer, wxUint32 len)
|
|||||||
m_snderror = wxSOUND_NOTSTARTED;
|
m_snderror = wxSOUND_NOTSTARTED;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastcount = (wxUint32)ret = write(m_fd_output, buffer, len);
|
ret = write(m_fd_output, buffer, len);
|
||||||
|
m_lastcount = (wxUint32)ret;
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
m_snderror = wxSOUND_IOERROR;
|
m_snderror = wxSOUND_IOERROR;
|
||||||
else
|
else
|
||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
|
|
||||||
m_q_filled = true;
|
m_q_filled = true;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
#endif // defined HAVE_ESD_H
|
#endif // defined HAVE_ESD_H
|
||||||
}
|
}
|
||||||
@@ -171,7 +173,7 @@ bool wxSoundStreamESD::SetSoundFormat(const wxSoundFormatBase& format)
|
|||||||
return false;
|
return false;
|
||||||
#else
|
#else
|
||||||
wxSoundFormatPcm *pcm_format;
|
wxSoundFormatPcm *pcm_format;
|
||||||
|
|
||||||
if (format.GetType() != wxSOUND_PCM) {
|
if (format.GetType() != wxSOUND_PCM) {
|
||||||
m_snderror = wxSOUND_INVFRMT;
|
m_snderror = wxSOUND_INVFRMT;
|
||||||
return false;
|
return false;
|
||||||
@@ -181,20 +183,20 @@ bool wxSoundStreamESD::SetSoundFormat(const wxSoundFormatBase& format)
|
|||||||
m_snderror = wxSOUND_INVDEV;
|
m_snderror = wxSOUND_INVDEV;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_sndformat)
|
if (m_sndformat)
|
||||||
delete m_sndformat;
|
delete m_sndformat;
|
||||||
|
|
||||||
m_sndformat = format.Clone();
|
m_sndformat = format.Clone();
|
||||||
if (!m_sndformat) {
|
if (!m_sndformat) {
|
||||||
m_snderror = wxSOUND_MEMERROR;
|
m_snderror = wxSOUND_MEMERROR;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
pcm_format = (wxSoundFormatPcm *)m_sndformat;
|
pcm_format = (wxSoundFormatPcm *)m_sndformat;
|
||||||
|
|
||||||
// Detect the best format
|
// Detect the best format
|
||||||
DetectBest(pcm_format);
|
DetectBest(pcm_format);
|
||||||
|
|
||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
if (*pcm_format != format) {
|
if (*pcm_format != format) {
|
||||||
m_snderror = wxSOUND_NOEXACT;
|
m_snderror = wxSOUND_NOEXACT;
|
||||||
@@ -213,7 +215,7 @@ static void _wxSound_OSS_CBack(gpointer data, int source,
|
|||||||
GdkInputCondition condition)
|
GdkInputCondition condition)
|
||||||
{
|
{
|
||||||
wxSoundStreamESD *esd = (wxSoundStreamESD *)data;
|
wxSoundStreamESD *esd = (wxSoundStreamESD *)data;
|
||||||
|
|
||||||
switch (condition) {
|
switch (condition) {
|
||||||
case GDK_INPUT_READ:
|
case GDK_INPUT_READ:
|
||||||
esd->WakeUpEvt(wxSOUND_INPUT);
|
esd->WakeUpEvt(wxSOUND_INPUT);
|
||||||
@@ -254,27 +256,27 @@ bool wxSoundStreamESD::StartProduction(int evt)
|
|||||||
m_snderror = wxSOUND_INVDEV;
|
m_snderror = wxSOUND_INVDEV;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_esd_stop)
|
if (!m_esd_stop)
|
||||||
StopProduction();
|
StopProduction();
|
||||||
|
|
||||||
pcm = (wxSoundFormatPcm *)m_sndformat;
|
pcm = (wxSoundFormatPcm *)m_sndformat;
|
||||||
|
|
||||||
flag |= (pcm->GetBPS() == 16) ? ESD_BITS16 : ESD_BITS8;
|
flag |= (pcm->GetBPS() == 16) ? ESD_BITS16 : ESD_BITS8;
|
||||||
flag |= (pcm->GetChannels() == 2) ? ESD_STEREO : ESD_MONO;
|
flag |= (pcm->GetChannels() == 2) ? ESD_STEREO : ESD_MONO;
|
||||||
|
|
||||||
if ((evt & wxSOUND_OUTPUT) != 0) {
|
if ((evt & wxSOUND_OUTPUT) != 0) {
|
||||||
flag |= ESD_PLAY | ESD_STREAM;
|
flag |= ESD_PLAY | ESD_STREAM;
|
||||||
m_fd_output = esd_play_stream(flag, pcm->GetSampleRate(), NULL,
|
m_fd_output = esd_play_stream(flag, pcm->GetSampleRate(), NULL,
|
||||||
MY_ESD_NAME);
|
MY_ESD_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((evt & wxSOUND_INPUT) != 0) {
|
if ((evt & wxSOUND_INPUT) != 0) {
|
||||||
flag |= ESD_RECORD | ESD_STREAM;
|
flag |= ESD_RECORD | ESD_STREAM;
|
||||||
m_fd_input = esd_record_stream(flag, pcm->GetSampleRate(), NULL,
|
m_fd_input = esd_record_stream(flag, pcm->GetSampleRate(), NULL,
|
||||||
MY_ESD_NAME);
|
MY_ESD_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
if ((evt & wxSOUND_OUTPUT) != 0) {
|
if ((evt & wxSOUND_OUTPUT) != 0) {
|
||||||
m_tag_output = gdk_input_add(m_fd_output, GDK_INPUT_WRITE,
|
m_tag_output = gdk_input_add(m_fd_output, GDK_INPUT_WRITE,
|
||||||
@@ -285,10 +287,10 @@ bool wxSoundStreamESD::StartProduction(int evt)
|
|||||||
_wxSound_OSS_CBack, (gpointer)this);
|
_wxSound_OSS_CBack, (gpointer)this);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_esd_stop = false;
|
m_esd_stop = false;
|
||||||
m_q_filled = false;
|
m_q_filled = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
#endif // defined HAVE_ESD_H
|
#endif // defined HAVE_ESD_H
|
||||||
}
|
}
|
||||||
@@ -304,7 +306,7 @@ bool wxSoundStreamESD::StopProduction()
|
|||||||
#else
|
#else
|
||||||
if (m_esd_stop)
|
if (m_esd_stop)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (m_fd_input != -1) {
|
if (m_fd_input != -1) {
|
||||||
esd_close(m_fd_input);
|
esd_close(m_fd_input);
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
@@ -317,7 +319,7 @@ bool wxSoundStreamESD::StopProduction()
|
|||||||
gdk_input_remove(m_tag_output);
|
gdk_input_remove(m_tag_output);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
m_fd_input = -1;
|
m_fd_input = -1;
|
||||||
m_fd_output= -1;
|
m_fd_output= -1;
|
||||||
m_esd_stop = true;
|
m_esd_stop = true;
|
||||||
@@ -339,10 +341,10 @@ void wxSoundStreamESD::DetectBest(wxSoundFormatPcm *pcm)
|
|||||||
|
|
||||||
// We change neither the number of channels nor the sample rate
|
// We change neither the number of channels nor the sample rate
|
||||||
// because ESD is clever.
|
// because ESD is clever.
|
||||||
|
|
||||||
best_pcm.SetSampleRate(pcm->GetSampleRate());
|
best_pcm.SetSampleRate(pcm->GetSampleRate());
|
||||||
best_pcm.SetChannels(pcm->GetChannels());
|
best_pcm.SetChannels(pcm->GetChannels());
|
||||||
|
|
||||||
// It supports 16 bits
|
// It supports 16 bits
|
||||||
if (pcm->GetBPS() >= 16)
|
if (pcm->GetBPS() >= 16)
|
||||||
best_pcm.SetBPS(16);
|
best_pcm.SetBPS(16);
|
||||||
@@ -351,7 +353,7 @@ void wxSoundStreamESD::DetectBest(wxSoundFormatPcm *pcm)
|
|||||||
|
|
||||||
best_pcm.SetOrder(wxLITTLE_ENDIAN);
|
best_pcm.SetOrder(wxLITTLE_ENDIAN);
|
||||||
best_pcm.Signed(true);
|
best_pcm.Signed(true);
|
||||||
|
|
||||||
// Finally recopy the new format
|
// Finally recopy the new format
|
||||||
*pcm = best_pcm;
|
*pcm = best_pcm;
|
||||||
#endif // defined HAVE_ESD_H
|
#endif // defined HAVE_ESD_H
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name)
|
wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name)
|
||||||
{
|
{
|
||||||
wxSoundFormatPcm pcm_default;
|
wxSoundFormatPcm pcm_default;
|
||||||
|
|
||||||
// Open the OSS device
|
// Open the OSS device
|
||||||
m_fd = open(dev_name.mb_str(), O_WRONLY);
|
m_fd = open(dev_name.mb_str(), O_WRONLY);
|
||||||
if (m_fd == -1) {
|
if (m_fd == -1) {
|
||||||
@@ -53,12 +53,12 @@ wxSoundStreamOSS::wxSoundStreamOSS(const wxString& dev_name)
|
|||||||
|
|
||||||
// Get the default best size for OSS
|
// Get the default best size for OSS
|
||||||
ioctl(m_fd, SNDCTL_DSP_GETBLKSIZE, &m_bufsize);
|
ioctl(m_fd, SNDCTL_DSP_GETBLKSIZE, &m_bufsize);
|
||||||
|
|
||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
|
|
||||||
// Close OSS
|
// Close OSS
|
||||||
close(m_fd);
|
close(m_fd);
|
||||||
|
|
||||||
m_oss_ok = true;
|
m_oss_ok = true;
|
||||||
m_oss_stop = true;
|
m_oss_stop = true;
|
||||||
m_q_filled = true;
|
m_q_filled = true;
|
||||||
@@ -84,15 +84,16 @@ wxSoundStream& wxSoundStreamOSS::Read(void *buffer, wxUint32 len)
|
|||||||
m_lastcount = 0;
|
m_lastcount = 0;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lastcount = (wxUint32)ret = read(m_fd, buffer, len);
|
ret = read(m_fd, buffer, len);
|
||||||
|
m_lastcount = (wxUint32)ret;
|
||||||
m_q_filled = true;
|
m_q_filled = true;
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
m_snderror = wxSOUND_IOERROR;
|
m_snderror = wxSOUND_IOERROR;
|
||||||
else
|
else
|
||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,7 +109,7 @@ wxSoundStream& wxSoundStreamOSS::Write(const void *buffer, wxUint32 len)
|
|||||||
|
|
||||||
ret = write(m_fd, buffer, len);
|
ret = write(m_fd, buffer, len);
|
||||||
m_q_filled = true;
|
m_q_filled = true;
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
m_lastcount = 0;
|
m_lastcount = 0;
|
||||||
m_snderror = wxSOUND_IOERROR;
|
m_snderror = wxSOUND_IOERROR;
|
||||||
@@ -116,7 +117,7 @@ wxSoundStream& wxSoundStreamOSS::Write(const void *buffer, wxUint32 len)
|
|||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
m_lastcount = (wxUint32)ret;
|
m_lastcount = (wxUint32)ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,20 +125,20 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
|||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
wxSoundFormatPcm *pcm_format;
|
wxSoundFormatPcm *pcm_format;
|
||||||
|
|
||||||
if (format.GetType() != wxSOUND_PCM) {
|
if (format.GetType() != wxSOUND_PCM) {
|
||||||
m_snderror = wxSOUND_INVFRMT;
|
m_snderror = wxSOUND_INVFRMT;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_oss_ok) {
|
if (!m_oss_ok) {
|
||||||
m_snderror = wxSOUND_INVDEV;
|
m_snderror = wxSOUND_INVDEV;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_sndformat)
|
if (m_sndformat)
|
||||||
delete m_sndformat;
|
delete m_sndformat;
|
||||||
|
|
||||||
m_sndformat = format.Clone();
|
m_sndformat = format.Clone();
|
||||||
if (!m_sndformat) {
|
if (!m_sndformat) {
|
||||||
m_snderror = wxSOUND_MEMERROR;
|
m_snderror = wxSOUND_MEMERROR;
|
||||||
@@ -153,18 +154,18 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the sample rate field.
|
// Set the sample rate field.
|
||||||
tmp = pcm_format->GetSampleRate();
|
tmp = pcm_format->GetSampleRate();
|
||||||
ioctl(m_fd, SNDCTL_DSP_SPEED, &tmp);
|
ioctl(m_fd, SNDCTL_DSP_SPEED, &tmp);
|
||||||
|
|
||||||
pcm_format->SetSampleRate(tmp);
|
pcm_format->SetSampleRate(tmp);
|
||||||
|
|
||||||
// Detect the best format
|
// Detect the best format
|
||||||
DetectBest(pcm_format);
|
DetectBest(pcm_format);
|
||||||
// Try to apply it
|
// Try to apply it
|
||||||
SetupFormat(pcm_format);
|
SetupFormat(pcm_format);
|
||||||
|
|
||||||
tmp = pcm_format->GetChannels();
|
tmp = pcm_format->GetChannels();
|
||||||
ioctl(m_fd, SNDCTL_DSP_CHANNELS, &tmp);
|
ioctl(m_fd, SNDCTL_DSP_CHANNELS, &tmp);
|
||||||
pcm_format->SetChannels(tmp);
|
pcm_format->SetChannels(tmp);
|
||||||
@@ -172,7 +173,7 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
|||||||
// Close the OSS device
|
// Close the OSS device
|
||||||
if (m_oss_stop)
|
if (m_oss_stop)
|
||||||
close(m_fd);
|
close(m_fd);
|
||||||
|
|
||||||
m_snderror = wxSOUND_NOERROR;
|
m_snderror = wxSOUND_NOERROR;
|
||||||
if (*pcm_format != format) {
|
if (*pcm_format != format) {
|
||||||
m_snderror = wxSOUND_NOEXACT;
|
m_snderror = wxSOUND_NOEXACT;
|
||||||
@@ -185,7 +186,7 @@ bool wxSoundStreamOSS::SetSoundFormat(const wxSoundFormatBase& format)
|
|||||||
bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format)
|
bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format)
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
|
|
||||||
switch(pcm_format->GetBPS()) {
|
switch(pcm_format->GetBPS()) {
|
||||||
case 8:
|
case 8:
|
||||||
if (pcm_format->Signed())
|
if (pcm_format->Signed())
|
||||||
@@ -210,9 +211,9 @@ bool wxSoundStreamOSS::SetupFormat(wxSoundFormatPcm *pcm_format)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ioctl(m_fd, SNDCTL_DSP_SETFMT, &tmp);
|
ioctl(m_fd, SNDCTL_DSP_SETFMT, &tmp);
|
||||||
|
|
||||||
// Demangling.
|
// Demangling.
|
||||||
switch (tmp) {
|
switch (tmp) {
|
||||||
case AFMT_U8:
|
case AFMT_U8:
|
||||||
@@ -252,7 +253,7 @@ static void _wxSound_OSS_CBack(gpointer data, int source,
|
|||||||
GdkInputCondition condition)
|
GdkInputCondition condition)
|
||||||
{
|
{
|
||||||
wxSoundStreamOSS *oss = (wxSoundStreamOSS *)data;
|
wxSoundStreamOSS *oss = (wxSoundStreamOSS *)data;
|
||||||
|
|
||||||
switch (condition) {
|
switch (condition) {
|
||||||
case GDK_INPUT_READ:
|
case GDK_INPUT_READ:
|
||||||
oss->WakeUpEvt(wxSOUND_INPUT);
|
oss->WakeUpEvt(wxSOUND_INPUT);
|
||||||
@@ -275,31 +276,31 @@ void wxSoundStreamOSS::WakeUpEvt(int evt)
|
|||||||
bool wxSoundStreamOSS::StartProduction(int evt)
|
bool wxSoundStreamOSS::StartProduction(int evt)
|
||||||
{
|
{
|
||||||
wxSoundFormatBase *old_frmt;
|
wxSoundFormatBase *old_frmt;
|
||||||
|
|
||||||
if (!m_oss_stop)
|
if (!m_oss_stop)
|
||||||
StopProduction();
|
StopProduction();
|
||||||
|
|
||||||
old_frmt = m_sndformat->Clone();
|
old_frmt = m_sndformat->Clone();
|
||||||
if (!old_frmt) {
|
if (!old_frmt) {
|
||||||
m_snderror = wxSOUND_MEMERROR;
|
m_snderror = wxSOUND_MEMERROR;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (evt == wxSOUND_OUTPUT)
|
if (evt == wxSOUND_OUTPUT)
|
||||||
m_fd = open(m_devname.mb_str(), O_WRONLY);
|
m_fd = open(m_devname.mb_str(), O_WRONLY);
|
||||||
else if (evt == wxSOUND_INPUT)
|
else if (evt == wxSOUND_INPUT)
|
||||||
m_fd = open(m_devname.mb_str(), O_RDONLY);
|
m_fd = open(m_devname.mb_str(), O_RDONLY);
|
||||||
|
|
||||||
if (m_fd == -1) {
|
if (m_fd == -1) {
|
||||||
m_snderror = wxSOUND_INVDEV;
|
m_snderror = wxSOUND_INVDEV;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SetSoundFormat(*old_frmt);
|
SetSoundFormat(*old_frmt);
|
||||||
delete old_frmt;
|
delete old_frmt;
|
||||||
|
|
||||||
int trig;
|
int trig;
|
||||||
|
|
||||||
if (evt == wxSOUND_OUTPUT) {
|
if (evt == wxSOUND_OUTPUT) {
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
m_tag = gdk_input_add(m_fd, GDK_INPUT_WRITE, _wxSound_OSS_CBack, (gpointer)this);
|
m_tag = gdk_input_add(m_fd, GDK_INPUT_WRITE, _wxSound_OSS_CBack, (gpointer)this);
|
||||||
|
Reference in New Issue
Block a user