mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-26 19:40:46 -05:00
add first draft of thread priority
This commit is contained in:
@@ -400,6 +400,10 @@ SceneSwitcher::SceneSwitcher(QWidget *parent)
|
||||
new QListWidgetItem(text, ui->priorityList);
|
||||
item->setData(Qt::UserRole, text);
|
||||
}
|
||||
|
||||
for (std::string p : switcher->threadPrioritiesNamesOrderdByPrio) {
|
||||
ui->threadPriority->addItem(p.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
/********************************************************************************
|
||||
@@ -1382,7 +1386,6 @@ static void SaveSceneSwitcher(obs_data_t *save_data, bool saving, void *)
|
||||
********************************************************************************/
|
||||
void SwitcherData::Thread()
|
||||
{
|
||||
|
||||
//to avoid scene duplication when rapidly switching scene collection
|
||||
this_thread::sleep_for(chrono::seconds(2));
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include <mutex>
|
||||
#include <fstream>
|
||||
#include <QDateTime>
|
||||
#include <QThread>
|
||||
#include "utility.hpp"
|
||||
|
||||
#define DEFAULT_INTERVAL 300
|
||||
@@ -308,6 +309,18 @@ struct SwitcherData {
|
||||
DEFAULT_PRIORITY_3, DEFAULT_PRIORITY_4, DEFAULT_PRIORITY_5,
|
||||
DEFAULT_PRIORITY_6, DEFAULT_PRIORITY_7};
|
||||
|
||||
std::vector<std::string> threadPrioritiesNamesOrderdByPrio{
|
||||
"Lowest", "Low", "Normal", "High", "Highest", "Time critical",
|
||||
};
|
||||
std::map<std::string, int> threadPriorities = {
|
||||
{"Lowest", QThread::LowestPriority},
|
||||
{"Low", QThread::LowPriority},
|
||||
{"Normal", QThread::NormalPriority},
|
||||
{"High", QThread::HighPriority},
|
||||
{"Highest", QThread::HighestPriority},
|
||||
{"Time critical", QThread::TimeCriticalPriority},
|
||||
};
|
||||
|
||||
void Thread();
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
Reference in New Issue
Block a user