CubicSDR/src/DemodulatorThreadQueue.h
Charles J. Cliffe 7e174ab1dd All threads now using transaction objects and queue
Additional cleanup, remove outdated IQBufferThread experiment
2014-11-17 19:37:53 -05:00

29 lines
837 B
C++

#pragma once
#include <map>
#include "DemodulatorThreadTask.h"
#include "wx/event.h"
class DemodulatorThreadQueue {
public:
enum DEMOD_PRIORITY {
DEMOD_PRIORITY_HIGHEST, DEMOD_PRIORITY_HIGHER, DEMOD_PRIORITY_NORMAL, DEMOD_PRIORITY_BELOW_NORMAL, DEMOD_PRIORITY_LOW, DEMOD_PRIORITY_IDLE
};
DemodulatorThreadQueue(wxEvtHandler* pParent);
void addTask(const DemodulatorThreadTask& task, const DEMOD_PRIORITY& priority = DEMOD_PRIORITY_NORMAL);
void sendAudioData(const DemodulatorThreadTask::DEMOD_THREAD_COMMAND& cmd, DemodulatorThreadAudioData *data);
DemodulatorThreadTask pop();
size_t stackSize();
wxEvtHandler* getHandler();
private:
wxEvtHandler* m_pParent;
std::multimap<DEMOD_PRIORITY, DemodulatorThreadTask> m_Tasks;
wxMutex m_MutexQueue;
wxSemaphore m_QueueCount;
};