Merging from vista net & messaging test

parent 5e71a29e
......@@ -40,8 +40,8 @@ class VistaConnectionIP;
//! Network audio messages
/*
* Messages consist of a message part and an answer part, each read or written
* separately. Messages have a two-int-header (SIZE, MSGTYPE), and
* answers have a two-int header (SIZE; ANSWERTYPE)
* separately. Messages have a three-int-header (SIZE, MSGTYPE, ID), and
* answers have a three-int header (SIZE, ANSWERTYPE, ID)
*/
class ITA_DATA_SOURCES_API CITANetAudioMessage
{
......@@ -101,9 +101,9 @@ private:
int m_nMessageType;
int m_nMessageId;
int m_nAnswerType;
VistaByteBufferSerializer m_oOutgoing;
VistaByteBufferDeSerializer m_oIncoming;
std::vector< VistaType::byte > m_vecIncomingBuffer;
VistaByteBufferSerializer m_oOutgoing; //!< Serialization buffer for messages
VistaByteBufferDeSerializer m_oIncoming; //!< Deserialization buffer for messages
std::vector< VistaType::byte > m_vecIncomingBuffer; // Net IO buffer
VistaConnectionIP* m_pConnection;
};
......
This diff is collapsed.
......@@ -7,18 +7,40 @@
#include <ITAException.h>
#include <ITAFileDatasource.h>
#include <ITAStreamProbe.h>
#include <ITAStreamPatchbay.h>
using namespace std;
//static string g_sServerName = "137.226.61.163";
static string g_sServerName = "localhost";
static int g_iServerPort = 12480;
static double g_dSampleRate = 44100;
static int g_iBufferSize = 1024;
static int g_iChannels = 20;
int main( int , char** )
{
CITANetAudioStream oNetAudioStream( 1, g_dSampleRate, g_iBufferSize, 100 * g_iBufferSize );
ITAStreamProbe oProbe( &oNetAudioStream, "out_gutentag.wav" );
CITANetAudioStream oNetAudioStream( g_iChannels, g_dSampleRate, g_iBufferSize, 100 * g_iBufferSize );
ITAStreamPatchbay oPatchbay( g_dSampleRate, g_iBufferSize );
oPatchbay.AddInput( &oNetAudioStream );
ITADatasource* pOutput;
oPatchbay.AddOutput( 1 );
/*
for ( int i = 0; i < oNetAudioStream.GetNumberOfChannels( ); i++ )
{
if ( i % 2 == 0 )
oPatchbay.ConnectChannels( 0, i, 0, 0 );
else
oPatchbay.ConnectChannels( 0, i, 0, 1 );
*/
oPatchbay.ConnectChannels( 0, 0, 0, 0, 1.0f );
pOutput = oPatchbay.GetOutputDatasource( 0 );
oPatchbay.SetOutputMuted( 0, true );
ITAStreamProbe oProbe( pOutput, "output.wav" );
ITAStreamMultiplier1N oMultiplier( &oProbe, 2 );
ITAPortaudioInterface ITAPA( g_dSampleRate, g_iBufferSize );
......@@ -59,7 +81,5 @@ int main( int , char** )
ITAPA.Close();
ITAPA.Finalize();
return 0;
}
......@@ -4,6 +4,7 @@
#include <ITANetAudioStreamingServer.h>
#include <ITANetAudioServer.h>
#include <ITAStreamFunctionGenerator.h>
#include <ITAStreamMultiplier1N.h>
#include <ITAFileDatasource.h>
using namespace std;
......@@ -12,13 +13,15 @@ static string g_sServerName = "localhost";
static int g_iServerPort = 12480;
static double g_dSampleRate = 44100;
static int g_iBlockLength = 1024;
static int g_iChannels = 20;
int main( int , char** )
{
ITAStreamFunctionGenerator oGenerator( 2, g_dSampleRate, g_iBlockLength, ITAStreamFunctionGenerator::SINE, 456.78f, 0.81f, true );
ITAFileDatasource oDatei("gershwin-mono.wav", g_iBlockLength);
//ITAStreamFunctionGenerator oGenerator( 2, g_dSampleRate, g_iBlockLength, ITAStreamFunctionGenerator::SINE, 456.78f, 0.81f, true );
ITAFileDatasource oFile("gershwin-mono.wav", g_iBlockLength);
ITAStreamMultiplier1N oMuliplier( &oFile, g_iChannels );
CITANetAudioStreamingServer oStreamingServer;
oStreamingServer.SetInputStream(&oDatei);
oStreamingServer.SetInputStream( &oMuliplier );
cout << "Starting server and waiting for connections on '" << g_sServerName << "' on port " << g_iServerPort << endl;
oStreamingServer.Start( g_sServerName, g_iServerPort );
......
......@@ -36,6 +36,7 @@ public:
VistaTimeUtils::Sleep( 100 ); // Sync couts
size_t nGetReceiveBufferSize = pSocket->GetReceiveBufferSize();
cout << "[ Server ] " << nGetReceiveBufferSize << " receive buffer size" << endl;
long nIncomingBytes = pSocket->WaitForIncomingData( 0 );
cout << "Server incoming bytes: " << nIncomingBytes << " bytes" << endl;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment