Пример #1
0
bool HttpClient::downloadString(String url, HttpClientCompletedCallback onCompleted)
{
	if (isProcessing()) return false;
	URL uri = URL(url);

	return startDownload(uri, eHCM_String, onCompleted);
}
Пример #2
0
void DemoJuceFilter::processBlock (AudioSampleBuffer& buffer,
                                   MidiBuffer& midiMessages)
{
	if (!isProcessing())
		return;

	for (int channel = 0; channel < getNumInputChannels(); ++channel)
	{
		float *p = buffer.getSampleData (channel);
		int size = buffer.getNumSamples() / buffer.getNumChannels();

		for (int x=0; x<size; x++)
		{
			currentSample = *(p+x);

			/* conversion */

			*(p+x) = currentConvertedSample = process (*(p+x));

			if (x == 2 && channel == 0 && bufferCycle == 0 && editor)
			{
				sendChangeMessage (0);
			}
		}
	}

	bufferCycle++;

	if (bufferCycle == 20)
		bufferCycle = 0;
}
Пример #3
0
float DemoJuceFilter::process(float sample)
{
	if (!isProcessing())
	{
		return (sample);
	}

	myFloat.setValue(sample);

	for (int x=0; x<32; x++)
	{
		if (xorBits[x] && xorProcessing)
		{
			myFloat.xorbit (x, xorWith);
		}
		if (andBits[x] && andProcessing)
		{
			myFloat.andbit (x, andWith);
		}
		if (setBits[x] && setProcessing)
		{
			myFloat.setbit (x);
		}
		if (clearBits[x] && clearProcessing)
		{
			myFloat.clearbit (x);
		}

	}

	return (myFloat.getValue());
}
Пример #4
0
bool TcpClient::connect(IPAddress addr, uint16_t port, boolean useSsl /* = false */, uint32_t sslOptions /* = 0 */)
{
	if (isProcessing()) return false;

	state = eTCS_Connecting;
	return TcpConnection::connect(addr, port, useSsl, sslOptions);
}
Пример #5
0
bool TcpClient::connect(String server, int port, boolean useSsl /* = false */, uint32_t sslOptions /* = 0 */)
{
	if (isProcessing()) return false;

	state = eTCS_Connecting;
	return TcpConnection::connect(server.c_str(), port, useSsl, sslOptions);
}
Пример #6
0
bool HttpClient::downloadFile(String url, String saveFileName, HttpClientCompletedCallback onCompleted /* = NULL */)
{
	if (isProcessing()) return false;
	URL uri = URL(url);

	String file;
	if (saveFileName.length() == 0)
	{
		file = uri.Path;
		int p = file.lastIndexOf('/');
		if (p != -1)
			file = file.substring(p + 1);
	}
	else
		file = saveFileName;

	saveFile = fileOpen(file.c_str(), eFO_CreateNewAlways | eFO_WriteOnly);
	debugf("Download file: %s %d", file.c_str(), saveFile);

	return startDownload(uri, eHCM_File, onCompleted);
}
Пример #7
0
void CNode::processData(QString gate_name, const CConstDataPointer &data)
{
    // Can we process this message now or should we keep it in a queue for later
    // ... processing?
    if(isProcessing()) {
        qDebug() << "The node"
                 << m_config.getName()
                 << "is queuing the data type"
                 << data->getType();
        // Store the name of the gate and the data it is sending in the queue.
        QPair<QString, CConstDataPointer> gate_and_data;
        gate_and_data.first = gate_name;
        gate_and_data.second = data;
        m_processing_queue.enqueue(gate_and_data);
    }
    else {
        // Set the node as processing something.
        setProcessing(true);
        // Setup and start the task in another thread.
        startGateTask(gate_name, data);
    }
}