30 lines
656 B
C
30 lines
656 B
C
|
#ifndef PRECISIONEVALUATOR_H
|
||
|
#define PRECISIONEVALUATOR_H
|
||
|
|
||
|
#include <SFML/System/Clock.hpp>
|
||
|
|
||
|
using microsec = sf::Int64;
|
||
|
|
||
|
template<typename GRADE>
|
||
|
class PrecisionEvaluator
|
||
|
{
|
||
|
public:
|
||
|
|
||
|
PrecisionEvaluator(microsec offset, microsec life_span_offset);
|
||
|
|
||
|
microsec offset() const noexcept;
|
||
|
bool isActive(microsec music_play_offset) const noexcept;
|
||
|
GRADE calculatePrecision(microsec odds) const;
|
||
|
|
||
|
static void resetPrecisionQualifier(microsec qualifier = 500000);
|
||
|
|
||
|
private:
|
||
|
microsec _offset;
|
||
|
microsec _start_handling_offset;
|
||
|
microsec _end_handling_offset;
|
||
|
|
||
|
static microsec _precision_qualifier;
|
||
|
};
|
||
|
|
||
|
#endif // PRECISIONEVALUATOR_H
|