void AudioProcessorPlayer::audioDeviceAboutToStart (AudioIODevice* const device)
{
    const double newSampleRate = device->getCurrentSampleRate();
    const int newBlockSize     = device->getCurrentBufferSizeSamples();
    const int numChansIn       = device->getActiveInputChannels().countNumberOfSetBits();
    const int numChansOut      = device->getActiveOutputChannels().countNumberOfSetBits();

    const ScopedLock sl (lock);

    sampleRate = newSampleRate;
    blockSize  = newBlockSize;
    numInputChans  = numChansIn;
    numOutputChans = numChansOut;

    messageCollector.reset (sampleRate);
    channels.calloc ((size_t) jmax (numChansIn, numChansOut) + 2);

    if (processor != nullptr)
    {
        if (isPrepared)
            processor->releaseResources();

        AudioProcessor* const oldProcessor = processor;
        setProcessor (nullptr);
        setProcessor (oldProcessor);
    }
}
예제 #2
0
// salt-and-pepper transform
void MainWindow::on_actionSalt_Pepper_Noise_triggered()
{
    if (!saltProcessor)
        saltProcessor = new SaltProcessor();

    // set salt-and-pepper processor as the current frame processor
    setProcessor(saltProcessor);

    if (!saltDialog) {
        saltDialog = new SaltDialog(this, saltProcessor);

        connect(saltDialog, SIGNAL(preview()),
                this, SLOT(preview())
                );

        connect(saltDialog, SIGNAL(reset()),
                this, SLOT(reset())
                );
    }

    saltDialog->show();
    saltDialog->raise();
    saltDialog->activateWindow();

    if (saltDialog->exec() == QDialog::Accepted) {
        process();
    } else {
        reset();
    }
}
예제 #3
0
// morphology transform
void MainWindow::on_actionMorpho_triggered()
{
    if (!morphoProcessor)
        morphoProcessor = new MorphoProcessor();

    // set morphology processor as the current frame processor
    setProcessor(morphoProcessor);

    if (!morphoDialog) {
        morphoDialog = new MorphoDialog(this, morphoProcessor);

        connect(morphoDialog, SIGNAL(preview()),
                this, SLOT(preview())
                );

        connect(morphoDialog, SIGNAL(reset()),
                this, SLOT(reset())
                );
    }

    morphoDialog->show();
    morphoDialog->raise();
    morphoDialog->activateWindow();

    if (morphoDialog->exec() == QDialog::Accepted) {
        process();
    } else {
        reset();
    }
}
예제 #4
0
파일: a_all.cpp 프로젝트: BigEd/Cores
	void Assembler::a_cpu()
	{
		String name;
		int ii;

		ibuf->skipSpacesLF();
		for (ii = 0; IsIdentChar(ibuf->peekCh()); ii++)
			name += (char)ibuf->nextCh();
		name += '\0';
		setProcessor(name);
	}
void AudioProcessorPlayer::audioDeviceAboutToStart (AudioIODevice* device)
{
    const ScopedLock sl (lock);

    sampleRate = device->getCurrentSampleRate();
    blockSize = device->getCurrentBufferSizeSamples();
    numInputChans = device->getActiveInputChannels().countNumberOfSetBits();
    numOutputChans = device->getActiveOutputChannels().countNumberOfSetBits();

    messageCollector.reset (sampleRate);
    zeromem (channels, sizeof (channels));

    if (processor != nullptr)
    {
        if (isPrepared)
            processor->releaseResources();

        AudioProcessor* const oldProcessor = processor;
        setProcessor (nullptr);
        setProcessor (oldProcessor);
    }
}
AudioProcessorPlayer::~AudioProcessorPlayer()
{
    setProcessor (nullptr);
}
AudioProcessorPlayer::~AudioProcessorPlayer()
{
    setProcessor (0);
}
예제 #8
0
void MainWindow::on_actionGray_Scale_triggered()
{
    // set toGray function as the callback image processor function
    setProcessor(toGray);
    process();
}
AudioProcessorPlayerWithMidiOutput::~AudioProcessorPlayerWithMidiOutput()
{
    setProcessor (nullptr);
}