From 3ea7dc0424cfe9a73fbe0e70f6b3c278c0f47132 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Wed, 2 Jan 2008 22:16:38 +0000 Subject: [PATCH] small changes (mostly for debugging under Windows) --- src/client.cpp | 2 +- src/main.cpp | 2 +- src/socket.cpp | 7 +++++-- windows/sound.cpp | 25 +++++++++++++++++++------ windows/sound.h | 2 +- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index efaaa913..8e2e3174 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -1,5 +1,5 @@ /******************************************************************************\ - * Copyright (c) 2004-2006 + * Copyright (c) 2004-2008 * * Author(s): * Volker Fischer diff --git a/src/main.cpp b/src/main.cpp index 09551c23..9c94dad9 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,5 +1,5 @@ /******************************************************************************\ - * Copyright (c) 2004-2006 + * Copyright (c) 2004-2008 * * Author(s): * Volker Fischer diff --git a/src/socket.cpp b/src/socket.cpp index 698b6728..3d6139c2 100755 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -1,5 +1,5 @@ /******************************************************************************\ - * Copyright (c) 2004-2006 + * Copyright (c) 2004-2008 * * Author(s): * Volker Fischer @@ -74,7 +74,10 @@ void CSocket::SendPacket ( const CVector& vecbySendBuf, if ( iVecSizeOut != 0 ) { - // send packet through network + // send packet through network (we have to convert the constant unsigned + // char vector in "const char*", for this we first convert the const + // unsigned char vector in a read/write unsigned char vector and then + // do the cast to const char*) SocketDevice.writeBlock ( (const char*) &( (CVector) vecbySendBuf )[0], iVecSizeOut, HostAddr.InetAddr, HostAddr.iPort ); diff --git a/windows/sound.cpp b/windows/sound.cpp index 6171c96f..784d57c5 100755 --- a/windows/sound.cpp +++ b/windows/sound.cpp @@ -95,6 +95,8 @@ bool CSound::Read ( CVector& psData ) } */ + +/* // copy data from sound card in output buffer for ( i = 0; i < iBufferSize; i++ ) { @@ -106,6 +108,7 @@ bool CSound::Read ( CVector& psData ) // in case more than one buffer was ready, reset event ResetEvent ( m_WaveInEvent ); +*/ return bError; } @@ -182,15 +185,16 @@ bool CSound::Write ( CVector& psData ) bChangParamOut = FALSE; } +/* // get number of "done"-buffers and position of one of them GetDoneBuffer ( iCntPrepBuf, iIndexDoneBuf ); // now check special cases (Buffer is full or empty) if ( iCntPrepBuf == 0 ) { - /* Blocking wave out routine. Needed for transmitter. Always - ensure that the buffer is completely filled to avoid buffer - underruns */ + // Blocking wave out routine. Needed for transmitter. Always + // ensure that the buffer is completely filled to avoid buffer + // underruns while ( iCntPrepBuf == 0 ) { WaitForSingleObject ( m_WaveOutEvent, INFINITE ); @@ -202,9 +206,9 @@ bool CSound::Write ( CVector& psData ) { if ( iCntPrepBuf == iCurNumSndBufOut ) { - /* ----------------------------------------------------------------- - Buffer is empty -> send as many cleared blocks to the sound- - interface until half of the buffer size is reached */ + // ----------------------------------------------------------------- + // Buffer is empty -> send as many cleared blocks to the sound- + // interface until half of the buffer size is reached // send half of the buffer size blocks to the sound-interface for ( j = 0; j < iCurNumSndBufOut / 2; j++ ) { @@ -228,6 +232,7 @@ bool CSound::Write ( CVector& psData ) bError = FALSE; } } +*/ /* // copy stereo data from input in soundcard buffer @@ -237,8 +242,16 @@ bool CSound::Write ( CVector& psData ) } */ +/* // now, send the current block AddOutBuffer ( iIndexDoneBuf ); +*/ + + +// TEST +Sleep(10); +return true; + return bError; } diff --git a/windows/sound.h b/windows/sound.h index 3a248ffa..f5e0b660 100755 --- a/windows/sound.h +++ b/windows/sound.h @@ -36,7 +36,7 @@ /* Definitions ****************************************************************/ // switch here between ASIO (Steinberg) or native Windows(TM) sound interface #undef USE_ASIO_SND_INTERFACE -//#define USE_ASIO_SND_INTERFACE +#define USE_ASIO_SND_INTERFACE #define NUM_IN_OUT_CHANNELS 2 /* Stereo recording (but we only