Exemple #1
0
void ofApp::setup(){
    
    setupTcpServer();
    setupArrays();
    setupSound();
    setupChannels();
    
    for (int i = 0; i < channels.size(); i++) {
        channel *channel = channels[i];
        
        movingFrameBoard *mfb = new movingFrameBoard(&channel->mFbo);
        movingFrameBoards.push_back(mfb);
        
        chessBoard1 *cb1 = new chessBoard1(&channel->mFbo);
        chessBoard1s.push_back(cb1);
        
        testBoard *tb = new testBoard(&channel->mFbo);
        testBoards.push_back(tb);
        
        oneColorBoard *ocb = new oneColorBoard(&channel->mFbo);
        oneColorBoards.push_back(ocb);
        
        chessBoard2 *cb2 = new chessBoard2(&channel->mFbo);
        chessBoard2s.push_back(cb2);
    }
    
    
}
Exemple #2
0
audioSink::audioSink	(int16_t latency,
                         QComboBox *s,
                         RingBuffer<int16_t> *b): audioBase (b) {
    int32_t	i;
    this	-> latency	= latency;
    this	-> streamSelector	= s;

    this	-> CardRate	= 48000;
    this	-> latency	= latency;
    _O_Buffer		= new RingBuffer<float>(2 * 32768);
    portAudio		= false;
    writerRunning		= false;
    if (Pa_Initialize () != paNoError) {
        fprintf (stderr, "Initializing Pa for output failed\n");
        return;
    }

    portAudio	= true;
    qDebug ("Hostapis: %d\n", Pa_GetHostApiCount ());

    for (i = 0; i < Pa_GetHostApiCount (); i ++)
        qDebug ("Api %d is %s\n", i, Pa_GetHostApiInfo (i) -> name);

    numofDevices	= Pa_GetDeviceCount ();
    outTable	= new int16_t [numofDevices + 1];
    for (i = 0; i < numofDevices; i ++)
        outTable [i] = -1;
    ostream		= NULL;
    setupChannels (streamSelector);
    connect (streamSelector, SIGNAL (activated (int)),
             this,  SLOT (set_streamSelector (int)));
    streamSelector	-> show ();
    selectDefaultDevice ();

}
Exemple #3
0
void ofApp::setup(){
    
    ofSetDataPathRoot("../Resources/data/");
    
    setupTcp();
    setupSound();
    setupChannels();
    setupBoards();
    
}
Exemple #4
0
CoreServer::Result CoreServer::initialize()
{
    Result r;

    // Only core0 needs to start other coreservers
    if (m_info.coreId != 0)
        return setupChannels();

    if ((r = loadKernel()) != Success)
        return r;

    if ((r = discover()) != Success)
        return r;

    if ((r = setupChannels()) != Success)
        return r;

    return bootAll();
}
Exemple #5
0
void StPCMBuffer::resize(const size_t theSizeMin,
                         const bool   theToReduce) {
    if(mySizeBytes >= theSizeMin
    && !theToReduce) {
        return; // do not reduce buffer
    }

    mySizeBytes = theSizeMin;
    stMemZero(myPlanes, sizeof(myPlanes));
    stMemFreeAligned(myBuffer);
    myBuffer = stMemAllocAligned<uint8_t*>(mySizeBytes, 16);
    stMemZero(myBuffer, mySizeBytes);
    setupChannels(myChMap, myPlanesNb);
}
Exemple #6
0
/*
 *	The class is the sink for the data generated
 *	Note that for DAB, we always take 48000 as outputrate
 *	The only parameter is the combobox for selection (which
 *	we fill first)
 */
	audioSink::audioSink	(QComboBox *s) {
int32_t	i;

	this	-> streamSelector	= s;

	_O_Buffer		= new RingBuffer<float>(16 * 32768);
	portAudio		= false;
	writerRunning		= false;

	if (Pa_Initialize () != paNoError) {
	   fprintf (stderr, "Initializing Pa for output failed\n");
	   return;
	}

	portAudio	= true;
	qDebug ("Hostapis: %d\n", Pa_GetHostApiCount ());

	for (i = 0; i < Pa_GetHostApiCount (); i ++)
	   qDebug ("Api %d is %s\n", i, Pa_GetHostApiInfo (i) -> name);

	numofDevices	= Pa_GetDeviceCount ();
	
	outTable	= new int16_t [numofDevices + 1];
	for (i = 0; i < numofDevices; i ++)
	   outTable [i] = -1;
	ostream		= NULL;
	setupChannels (streamSelector);
	connect (streamSelector, SIGNAL (activated (int)),
	         this,  SLOT (set_streamSelector (int)));
	streamSelector	-> show ();
	ostream		= NULL;
	dumpFile	= NULL;
//
//	data may enter with different samplerates, all data
//	is mapped onto a rate of 48000
	f_16000		= new LowPassFIR (5, 16000, 48000);
	f_24000		= new LowPassFIR (5, 24000, 48000);
	f_32000		= new LowPassFIR (5, 32000, 96000);
}