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); } }
// 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(); } }
// 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(); } }
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); }
void MainWindow::on_actionGray_Scale_triggered() { // set toGray function as the callback image processor function setProcessor(toGray); process(); }
AudioProcessorPlayerWithMidiOutput::~AudioProcessorPlayerWithMidiOutput() { setProcessor (nullptr); }