* Fixes (AIF works on Linux)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1265 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Guilhem Lavaux
1998-12-26 15:36:45 +00:00
parent d05237ea7b
commit 2a040d3f07
8 changed files with 47 additions and 12 deletions

View File

@@ -620,9 +620,10 @@ void wxStringList::Sort()
{ {
size_t N = GetCount(); size_t N = GetCount();
char **array = new char *[N]; char **array = new char *[N];
wxStringListNode *node;
size_t i = 0; size_t i = 0;
for ( wxStringListNode *node = GetFirst(); node; node = node->GetNext() ) for ( node = GetFirst(); node; node = node->GetNext() )
{ {
array[i++] = node->GetData(); array[i++] = node->GetData();
} }

View File

@@ -136,6 +136,7 @@ void wxStreamBuffer::SetBufferIO(size_t bufsize)
void wxStreamBuffer::ResetBuffer() void wxStreamBuffer::ResetBuffer()
{ {
m_stream->m_lasterror = wxStream_NOERROR;
if (m_mode == read) if (m_mode == read)
m_buffer_pos = m_buffer_end; m_buffer_pos = m_buffer_end;
else else
@@ -285,6 +286,7 @@ size_t wxStreamBuffer::Read(void *buffer, size_t size)
// Buffering disabled // Buffering disabled
// ------------------ // ------------------
m_stream->m_lasterror = wxStream_NOERROR;
m_stream->m_lastcount = GetWBack((char *)buffer, size); m_stream->m_lastcount = GetWBack((char *)buffer, size);
size -= m_stream->m_lastcount; size -= m_stream->m_lastcount;
if (size == 0) if (size == 0)
@@ -345,6 +347,7 @@ size_t wxStreamBuffer::Write(const void *buffer, size_t size)
// Buffering disabled // Buffering disabled
// ------------------ // ------------------
m_stream->m_lasterror = wxStream_NOERROR;
if (!m_buffer_size) if (!m_buffer_size)
return (m_stream->m_lastcount = m_stream->OnSysWrite(buffer, size)); return (m_stream->m_lastcount = m_stream->OnSysWrite(buffer, size));

View File

@@ -17,9 +17,9 @@ ADPCM_SRC=\
g711.cpp g721.cpp g723_24.cpp g723_40.cpp g72x.cpp g711.cpp g721.cpp g723_24.cpp g723_40.cpp g72x.cpp
MMEDIA_SRC=\ MMEDIA_SRC=\
mmdata.cpp mmfile.cpp mmsolve.cpp sndsnd.cpp sndfrmt.cpp sndpcm.o \ mmdata.cpp mmfile.cpp mmsolve.cpp sndsnd.cpp sndfrmt.cpp sndpcm.cpp \
snduss.cpp sndfile.cpp sndwav.cpp mmriff.cpp vidbase.cpp vidxanm.cpp \ snduss.cpp sndfile.cpp sndwav.cpp mmriff.cpp vidbase.cpp vidxanm.cpp \
cdbase.cpp cdunix.cpp cdbase.cpp cdunix.cpp sndaiff.cpp sndmulaw.cpp sndau.cpp
LIB_SRC= $(ADPCM_SRC:%.cpp=adpcm/%.cpp) $(MMEDIA_SRC) LIB_SRC= $(ADPCM_SRC:%.cpp=adpcm/%.cpp) $(MMEDIA_SRC)

View File

@@ -1,3 +1,12 @@
////////////////////////////////////////////////////////////////////////////////
// Name: sndfrmt.cpp
// Purpose: wxMMedia
// Author: Guilhem Lavaux
// Created: 1998
// Updated: December 1998
// Copyright: (C) 1997, 1998, Guilhem Lavaux
// License: wxWindows license
////////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "sndfrmt.h" #pragma implementation "sndfrmt.h"
#endif #endif
@@ -81,6 +90,7 @@ wxSoundCodec *wxSoundDataFormat::GetCodec()
m_codchange = FALSE; m_codchange = FALSE;
m_codec = wxSoundCodec::Get(m_codno); m_codec = wxSoundCodec::Get(m_codno);
CodecChange();
return m_codec; return m_codec;
} }

View File

@@ -1,3 +1,12 @@
////////////////////////////////////////////////////////////////////////////////
// Name: sndfrmt.h
// Purpose: wxMMedia
// Author: Guilhem Lavaux
// Created: 1998
// Updated: December 1998
// Copyright: (C) 1997, 1998, Guilhem Lavaux
// License: wxWindows license
////////////////////////////////////////////////////////////////////////////////
#ifndef __SNDFRMT_H__ #ifndef __SNDFRMT_H__
#define __SNDFRMT_H__ #define __SNDFRMT_H__

View File

@@ -1,3 +1,12 @@
////////////////////////////////////////////////////////////////////////////////
// Name: sndmulaw.cpp
// Purpose: wxMMedia
// Author: Guilhem Lavaux
// Created: 1997
// Updated: December 1998
// Copyright: (C) 1997, 1998, Guilhem Lavaux
// License: wxWindows license
////////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation "sndmulaw.h" #pragma implementation "sndmulaw.h"
#endif #endif

View File

@@ -101,8 +101,6 @@ void wxSndBuffer::HardUnlock()
void wxSndBuffer::ChangeCodec(int no) void wxSndBuffer::ChangeCodec(int no)
{ {
wxDELETE(m_sndcodec);
m_sndformat.SetCodecNo(no); m_sndformat.SetCodecNo(no);
m_sndcodec = m_sndformat.GetCodec(); m_sndcodec = m_sndformat.GetCodec();
m_sndcodec->SetIOBuffer(this); m_sndcodec->SetIOBuffer(this);

View File

@@ -106,8 +106,6 @@ bool wxUssSound::DoInput(wxSndBuffer *buf)
wxSoundCodec *codec = buf->GetCurrentCodec(); wxSoundCodec *codec = buf->GetCurrentCodec();
m_sndbuf->ResetBuffer(); m_sndbuf->ResetBuffer();
codec->SetInStream(m_sndbuf);
codec->InitIO(m_ussformat);
bufsize = codec->Available(); bufsize = codec->Available();
if (bufsize > m_max_bufsize) if (bufsize > m_max_bufsize)
@@ -152,11 +150,18 @@ bool wxUssSound::InitBuffer(wxSndBuffer *buf)
} }
codec = buf->GetCurrentCodec(); codec = buf->GetCurrentCodec();
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->SetOutStream(m_sndbuf);
codec->InitIO(m_ussformat); codec->InitIO(m_ussformat);
// TODO: We need more tests here. codec->InitMode(wxSoundCodec::DECODING);
codec->InitMode((m_mode == wxSND_OUTPUT) ? wxSoundCodec::DECODING : wxSoundCodec::ENCODING); break;
}
return TRUE; return TRUE;
} }