23#include "streameventqueue_p.h"
24#include "phononnamespace_p.h"
33StreamEventQueue::StreamEventQueue()
34 : m_dropWriteCommands(0),
39StreamEventQueue::~StreamEventQueue()
43void StreamEventQueue::setBackendCommandHandler(LockFreeQueueBase::DataReadyHandler *h)
45 m_forBackend.setDataReadyHandler(h);
48void StreamEventQueue::setFrontendCommandHandler(LockFreeQueueBase::DataReadyHandler *h)
50 m_forFrontend.setDataReadyHandler(h);
57void StreamEventQueue::sendToBackend(CommandType command,
const QVariant &data)
59 m_forBackend.enqueue(Command(command, data));
62bool StreamEventQueue::nextCommandForFrontend(Command *command)
65 return m_forFrontend.dequeue(command);
72void StreamEventQueue::sendToFrontend(CommandType command,
const QVariant &data)
77 ++m_dropWriteCommands;
81 m_dropWriteCommands = 0;
86 m_forFrontend.enqueue(Command(command, data));
89bool StreamEventQueue::nextCommandForBackend(Command *command)
92 bool valid = m_forBackend.dequeue(command);
95 if (command->command == ConnectDone) {
99 }
else if (m_dropWriteCommands) {
100 switch (command->command) {
107 --m_dropWriteCommands;
110 pFatal(
"received a ConnectDone, but there was no Connect request");
118 valid = m_forBackend.dequeue(command);
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:01:16 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.