Shuffle Viz fix

This commit is contained in:
cora32 2015-08-08 01:52:26 +03:00
parent 36f908a204
commit d39de296e7
2 changed files with 52 additions and 0 deletions

32
ColoredIndexBarDrawer.cpp Normal file
View File

@ -0,0 +1,32 @@
#include "ColoredIndexBarDrawer.h"
int cIndex = 0;
void ColoredIndexBarDrawer::doEmitionDrawPointerPB2(int pointer)
{
emit pbTh2->drawPointerPB2(pointer);
};
void ColoredIndexBarDrawer::run()
{
globalScanFlag = true;
int oldPointer = 0;
msleep(1000);
while (globalScanFlag)
{
msleep(200);
int sz = stt->getColoredIndexes().size();
if (sz > 0) {
int pointer = 100 * cIndex / sz;
if (pointer < oldPointer) {
oldPointer = 0;
}
if (pointer > oldPointer) {
doEmitionDrawPointerPB2(pointer);
oldPointer = pointer;
}
}
msleep(1000);
}
};

20
ColoredIndexBarDrawer.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef CIPBD_H
#define CIPBD_H
#pragma once
#include "STh.h"
#include "externData.h"
class ColoredIndexBarDrawer : public QThread
{
Q_OBJECT
public: signals : void drawPointerPB2(int);
public:
static void doEmitionDrawPointerPB2(int pointer);
protected:
void run();
};
extern ColoredIndexBarDrawer *pbTh2;
#endif // CIPBD_H