rhubarb-lip-sync/src/ProgressBar.h

26 lines
413 B
C
Raw Normal View History

2016-01-08 09:53:35 +00:00
#pragma once
#include <string>
#include <atomic>
#include <future>
class ProgressBar {
public:
ProgressBar();
~ProgressBar();
void reportProgress(double value);
private:
void updateLoop();
void updateText(const std::string& text);
std::future<void> updateLoopFuture;
std::atomic<double> currentProgress { 0 };
std::atomic<bool> done { false };
std::string currentText;
int animationIndex = 0;
};