m_sleep_cond.Signal();
m_sleep_mtx.Unlock();
}
- Join();
+ while (IsAlive())
+ Yield();
}
if (m_fd != -1)
wxSoundCodec *codec = buf->GetCurrentCodec();
m_sndbuf->ResetBuffer();
- codec->SetInStream(m_sndbuf);
- codec->InitIO(m_ussformat);
bufsize = codec->Available();
if (bufsize > m_max_bufsize)
}
codec = buf->GetCurrentCodec();
- codec->SetOutStream(m_sndbuf);
- codec->InitIO(m_ussformat);
- // TODO: We need more tests here.
- codec->InitMode((m_mode == wxSND_OUTPUT) ? wxSoundCodec::DECODING : wxSoundCodec::ENCODING);
-
+ switch (m_mode) {
+ case wxSND_INPUT:
+ codec->SetInStream(m_sndbuf);
+ codec->InitIO(m_ussformat);
+ codec->InitMode(wxSoundCodec::ENCODING);
+ break;
+ case wxSND_OUTPUT:
+ codec->SetOutStream(m_sndbuf);
+ codec->InitIO(m_ussformat);
+ codec->InitMode(wxSoundCodec::DECODING);
+ break;
+ case wxSND_DUPLEX:
+ case wxSND_OTHER_IO:
+ break;
+ }
return TRUE;
}
}
buf->HardUnlock();
continue;
+
sound_clean_buffer:
buf->GetCurrentCodec()->ExitMode();
delete node;