small changes (mostly for debugging under Windows)
This commit is contained in:
parent
84d69211c5
commit
3ea7dc0424
5 changed files with 27 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************\
|
/******************************************************************************\
|
||||||
* Copyright (c) 2004-2006
|
* Copyright (c) 2004-2008
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Volker Fischer
|
* Volker Fischer
|
||||||
|
@ -74,7 +74,10 @@ void CSocket::SendPacket ( const CVector<unsigned char>& vecbySendBuf,
|
||||||
|
|
||||||
if ( iVecSizeOut != 0 )
|
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 (
|
SocketDevice.writeBlock (
|
||||||
(const char*) &( (CVector<unsigned char>) vecbySendBuf )[0],
|
(const char*) &( (CVector<unsigned char>) vecbySendBuf )[0],
|
||||||
iVecSizeOut, HostAddr.InetAddr, HostAddr.iPort );
|
iVecSizeOut, HostAddr.InetAddr, HostAddr.iPort );
|
||||||
|
|
|
@ -95,6 +95,8 @@ bool CSound::Read ( CVector<short>& psData )
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// copy data from sound card in output buffer
|
// copy data from sound card in output buffer
|
||||||
for ( i = 0; i < iBufferSize; i++ )
|
for ( i = 0; i < iBufferSize; i++ )
|
||||||
{
|
{
|
||||||
|
@ -106,6 +108,7 @@ bool CSound::Read ( CVector<short>& psData )
|
||||||
|
|
||||||
// in case more than one buffer was ready, reset event
|
// in case more than one buffer was ready, reset event
|
||||||
ResetEvent ( m_WaveInEvent );
|
ResetEvent ( m_WaveInEvent );
|
||||||
|
*/
|
||||||
|
|
||||||
return bError;
|
return bError;
|
||||||
}
|
}
|
||||||
|
@ -182,15 +185,16 @@ bool CSound::Write ( CVector<short>& psData )
|
||||||
bChangParamOut = FALSE;
|
bChangParamOut = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// get number of "done"-buffers and position of one of them
|
// get number of "done"-buffers and position of one of them
|
||||||
GetDoneBuffer ( iCntPrepBuf, iIndexDoneBuf );
|
GetDoneBuffer ( iCntPrepBuf, iIndexDoneBuf );
|
||||||
|
|
||||||
// now check special cases (Buffer is full or empty)
|
// now check special cases (Buffer is full or empty)
|
||||||
if ( iCntPrepBuf == 0 )
|
if ( iCntPrepBuf == 0 )
|
||||||
{
|
{
|
||||||
/* Blocking wave out routine. Needed for transmitter. Always
|
// Blocking wave out routine. Needed for transmitter. Always
|
||||||
ensure that the buffer is completely filled to avoid buffer
|
// ensure that the buffer is completely filled to avoid buffer
|
||||||
underruns */
|
// underruns
|
||||||
while ( iCntPrepBuf == 0 )
|
while ( iCntPrepBuf == 0 )
|
||||||
{
|
{
|
||||||
WaitForSingleObject ( m_WaveOutEvent, INFINITE );
|
WaitForSingleObject ( m_WaveOutEvent, INFINITE );
|
||||||
|
@ -202,9 +206,9 @@ bool CSound::Write ( CVector<short>& psData )
|
||||||
{
|
{
|
||||||
if ( iCntPrepBuf == iCurNumSndBufOut )
|
if ( iCntPrepBuf == iCurNumSndBufOut )
|
||||||
{
|
{
|
||||||
/* -----------------------------------------------------------------
|
// -----------------------------------------------------------------
|
||||||
Buffer is empty -> send as many cleared blocks to the sound-
|
// Buffer is empty -> send as many cleared blocks to the sound-
|
||||||
interface until half of the buffer size is reached */
|
// interface until half of the buffer size is reached
|
||||||
// send half of the buffer size blocks to the sound-interface
|
// send half of the buffer size blocks to the sound-interface
|
||||||
for ( j = 0; j < iCurNumSndBufOut / 2; j++ )
|
for ( j = 0; j < iCurNumSndBufOut / 2; j++ )
|
||||||
{
|
{
|
||||||
|
@ -228,6 +232,7 @@ bool CSound::Write ( CVector<short>& psData )
|
||||||
bError = FALSE;
|
bError = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// copy stereo data from input in soundcard buffer
|
// copy stereo data from input in soundcard buffer
|
||||||
|
@ -237,8 +242,16 @@ bool CSound::Write ( CVector<short>& psData )
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
// now, send the current block
|
// now, send the current block
|
||||||
AddOutBuffer ( iIndexDoneBuf );
|
AddOutBuffer ( iIndexDoneBuf );
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// TEST
|
||||||
|
Sleep(10);
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
return bError;
|
return bError;
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
/* Definitions ****************************************************************/
|
/* Definitions ****************************************************************/
|
||||||
// switch here between ASIO (Steinberg) or native Windows(TM) sound interface
|
// switch here between ASIO (Steinberg) or native Windows(TM) sound interface
|
||||||
#undef USE_ASIO_SND_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
|
#define NUM_IN_OUT_CHANNELS 2 /* Stereo recording (but we only
|
||||||
|
|
Loading…
Add table
Reference in a new issue