if (!OpenDevice(wxSOUND_OUTPUT)) {
m_snderror = wxSOUND_NOERROR; //next call to OpenDevice won't do this
if (!OpenDevice(wxSOUND_OUTPUT)) {
m_snderror = wxSOUND_NOERROR; //next call to OpenDevice won't do this
// NB: class name must be kept in sync with wxCanvasClassName in
// src/msw/app.cpp!
m_internal->m_sndWin = ::CreateWindow(wxT("wxWindowClass"), NULL, 0,
// NB: class name must be kept in sync with wxCanvasClassName in
// src/msw/app.cpp!
m_internal->m_sndWin = ::CreateWindow(wxT("wxWindowClass"), NULL, 0,
- 0, 0, 0, 0, NULL, (HMENU) NULL,
+ 0, 0, 0, 0, NULL, (HMENU) NULL,
waveOutClose(m_internal->m_devout);
}
if (m_internal->m_input_enabled) {
FreeHeaders(wxSOUND_INPUT);
waveOutClose(m_internal->m_devout);
}
if (m_internal->m_input_enabled) {
FreeHeaders(wxSOUND_INPUT);
// AllocHeaders() allocates WXSOUND_MAX_QUEUE (= 128) blocks for an operation
// queue. It uses AllocHeader() for each element.
//
// AllocHeaders() allocates WXSOUND_MAX_QUEUE (= 128) blocks for an operation
// queue. It uses AllocHeader() for each element.
//
// -------------------------------------------------------------------------
bool wxSoundStreamWin::AllocHeaders(int mode)
{
// -------------------------------------------------------------------------
bool wxSoundStreamWin::AllocHeaders(int mode)
{
// Else, we wait for its termination
while (info->m_playing || info->m_recording)
wxYield();
// Else, we wait for its termination
while (info->m_playing || info->m_recording)
wxYield();
result = waveInAddBuffer(m_internal->m_devin,
info->m_header, sizeof(WAVEHDR));
if (result == MMSYSERR_NOERROR)
result = waveInAddBuffer(m_internal->m_devin,
info->m_header, sizeof(WAVEHDR));
if (result == MMSYSERR_NOERROR)
} else if (info->m_mode == wxSOUND_OUTPUT) {
result = waveOutWrite(m_internal->m_devout,
info->m_header, sizeof(WAVEHDR));
if (result == MMSYSERR_NOERROR)
} else if (info->m_mode == wxSOUND_OUTPUT) {
result = waveOutWrite(m_internal->m_devout,
info->m_header, sizeof(WAVEHDR));
if (result == MMSYSERR_NOERROR)
// -------------------------------------------------------------------------
void wxSoundStreamWin::ClearHeader(wxSoundInfoHeader *info)
{
// -------------------------------------------------------------------------
void wxSoundStreamWin::ClearHeader(wxSoundInfoHeader *info)
{
// fragment finished. It reinitializes the parameters of the fragment and
// sends an event to the clients.
// -------------------------------------------------------------------------
// fragment finished. It reinitializes the parameters of the fragment and
// sends an event to the clients.
// -------------------------------------------------------------------------
}
}
// -------------------------------------------------------------------------
// SetSoundFormat()
// -------------------------------------------------------------------------
}
}
// -------------------------------------------------------------------------
// SetSoundFormat()
// -------------------------------------------------------------------------
if ((m_internal->m_output_enabled && (evt & wxSOUND_OUTPUT)) ||
(m_internal->m_input_enabled && (evt & wxSOUND_INPUT)))
CloseDevice();
if (!OpenDevice(evt))
if ((m_internal->m_output_enabled && (evt & wxSOUND_OUTPUT)) ||
(m_internal->m_input_enabled && (evt & wxSOUND_INPUT)))
CloseDevice();
if (!OpenDevice(evt))
// Send a dummy event to start.
if (evt & wxSOUND_OUTPUT)
OnSoundEvent(wxSOUND_OUTPUT);
// Send a dummy event to start.
if (evt & wxSOUND_OUTPUT)
OnSoundEvent(wxSOUND_OUTPUT);