mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-03-22 01:44:49 -05:00
The "core" macro conditions and actions have been extracted out to the "base" plugin. The library now mostly contains functionality which is required across all plugins and (e.g. definitions for macro segments). The goal is to reduce the complexity and cross-dependencies and group the source files in a better way. This should relsove the "library limit of 65535 objects exceeded" build issue occuring in some Windows build environments.
46 lines
1.0 KiB
C++
46 lines
1.0 KiB
C++
#pragma once
|
|
#include "variable-number.hpp"
|
|
#include "obs-data.h"
|
|
|
|
#include <chrono>
|
|
|
|
namespace advss {
|
|
|
|
class Duration {
|
|
public:
|
|
EXPORT Duration() = default;
|
|
EXPORT Duration(double initialValueInSeconds);
|
|
|
|
EXPORT void Save(obs_data_t *obj, const char *name = "duration") const;
|
|
EXPORT void Load(obs_data_t *obj, const char *name = "duration");
|
|
|
|
EXPORT bool DurationReached();
|
|
EXPORT bool IsReset() const;
|
|
EXPORT double Seconds() const;
|
|
EXPORT double Milliseconds() const;
|
|
EXPORT double TimeRemaining() const;
|
|
EXPORT void SetTimeRemaining(double);
|
|
EXPORT void Reset();
|
|
EXPORT std::string ToString() const;
|
|
|
|
enum class Unit {
|
|
SECONDS,
|
|
MINUTES,
|
|
HOURS,
|
|
};
|
|
EXPORT Unit GetUnit() const { return _unit; }
|
|
|
|
// TODO: Remove
|
|
// Only use this function if you intend to convert old settings formats
|
|
EXPORT void SetUnit(Unit u);
|
|
|
|
private:
|
|
NumberVariable<double> _value = 0.;
|
|
Unit _unit = Unit::SECONDS;
|
|
std::chrono::high_resolution_clock::time_point _startTime;
|
|
|
|
friend class DurationSelection;
|
|
};
|
|
|
|
} // namespace advss
|