void AudioOutput::addFrameToBuffer(ClientUser *user, const QByteArray &qbaPacket, unsigned int iSeq, MessageHandler::UDPMessageType type) { if (iChannels == 0) return; qrwlOutputs.lockForRead(); AudioOutputSpeech *aop = qobject_cast<AudioOutputSpeech *>(qmOutputs.value(user)); if (! aop || (aop->umtType != type)) { qrwlOutputs.unlock(); if (aop) removeBuffer(aop); while ((iMixerFreq == 0) && isAlive()) { QThread::yieldCurrentThread(); } if (! iMixerFreq) return; qrwlOutputs.lockForWrite(); aop = new AudioOutputSpeech(user, iMixerFreq, type); qmOutputs.replace(user, aop); } aop->addFrameToBuffer(qbaPacket, iSeq); qrwlOutputs.unlock(); }
void NickListWidget::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) { Q_ASSERT(model()); if(!parent.isValid()) { // ok this means that whole networks are about to be removed // we can't determine which buffers are affect, so we hope that all nets are removed // this is the most common case (for example disconnecting from the core or terminating the clint) NickView *nickView; QHash<BufferId, NickView *>::iterator iter = nickViews.begin(); while(iter != nickViews.end()) { nickView = *iter; iter = nickViews.erase(iter); ui.stackedWidget->removeWidget(nickView); QAbstractItemModel *model = nickView->model(); nickView->setModel(0); if(QSortFilterProxyModel *filter = qobject_cast<QSortFilterProxyModel *>(model)) filter->setSourceModel(0); model->deleteLater(); nickView->deleteLater(); } } else { // check if there are explicitly buffers removed for(int i = start; i <= end; i++) { QVariant variant = parent.child(i,0).data(NetworkModel::BufferIdRole); if(!variant.isValid()) continue; BufferId bufferId = qVariantValue<BufferId>(variant); removeBuffer(bufferId); } } }
void DepthBufferList::saveBuffer(uint32_t _address) { if (!config.frameBufferEmulation.enable) return; FrameBuffer * pFrameBuffer = frameBufferList().findBuffer(_address); if (pFrameBuffer != NULL) pFrameBuffer->m_isDepthBuffer = true; if (m_pCurrent == NULL || m_pCurrent->m_address != _address) m_pCurrent = findBuffer(_address); if (m_pCurrent != NULL && pFrameBuffer != NULL && m_pCurrent->m_width != pFrameBuffer->m_width) { removeBuffer(_address); m_pCurrent = NULL; } if (m_pCurrent == NULL) { m_list.emplace_front(); DepthBuffer & buffer = m_list.front(); buffer.m_address = _address; buffer.m_width = pFrameBuffer != NULL ? pFrameBuffer->m_width : VI.width; buffer.initDepthBufferTexture(pFrameBuffer); m_pCurrent = &buffer; } frameBufferList().attachDepthBuffer(); #ifdef DEBUG DebugMsg( DEBUG_HIGH | DEBUG_HANDLED, "DepthBuffer_SetBuffer( 0x%08X ); color buffer is 0x%08X\n", address, ( pFrameBuffer != NULL && pFrameBuffer->m_FBO > 0) ? pFrameBuffer->m_startAddress : 0 ); #endif }
void AudioOutput::removeBuffer(const ClientUser *user) { removeBuffer(qmOutputs.value(user)); }
void AudioOutput::wipe() { foreach(AudioOutputUser *aop, qmOutputs) removeBuffer(aop); }
EMark::~EMark() { if (Buffer) removeBuffer(Buffer); delete Name; delete FileName; }