AudioInput *AudioMixer::createInputSerialized( QDataStream *stream, int before) { if(before < 0) { // Position is relative to the right before += m_inputs.count() + 1; } before = qBound(0, before, m_inputs.count()); AudioInput *input = new AudioInput(this, 0, m_profile->getAudioMode()); appLog(LOG_CAT) << "Unserializing audio input " << input->getIdString(false) << "..."; if(!input->unserialize(stream)) { // Failed to unserialize data appLog(LOG_CAT, Log::Warning) << "Failed to fully unserialize audio input data"; delete input; return NULL; } m_inputs.insert(before, input); appLog(LOG_CAT) << "Created audio input " << input->getIdString(); input->setInitialized(); calcMinInputDelay(); emit inputAdded(input, before); return input; }
void Stage::registerInput(AbstractSlot * input) { // Add input m_inputs.push_back(input); if (input->name() != "") { m_inputsMap.insert(std::make_pair(input->name(), input)); } cppassist::debug(2, "gloperate") << input->qualifiedName() << ": add input to stage"; // Emit signal inputAdded(input); }
//------------------------------------------------------------------ bool ImageOutput::addInput(ofxPatch* layer_){ if (input.size()<maxInputs) { for(int i=0; i<input.size(); i++) { if(input.at(i)->getId() == layer_->getId()){ ConsoleLog::getInstance()->pushError("Input already exists"); return false; } } input.push_back((ImageOutput*)layer_); if (input.size() == 1) { resetSizeBasedOnInput(input[0]); } inputAdded((ImageOutput*)layer_); } }
AudioInput *AudioMixer::createInput( quint64 sourceId, const QString &name, int before) { if(before < 0) { // Position is relative to the right before += m_inputs.count() + 1; } before = qBound(0, before, m_inputs.count()); AudioInput *input = new AudioInput(this, sourceId, m_profile->getAudioMode()); if(!name.isEmpty()) input->setName(name); m_inputs.insert(before, input); appLog(LOG_CAT) << "Created audio input " << input->getIdString(); input->setInitialized(); calcMinInputDelay(); emit inputAdded(input, before); return input; }