Renamed Time.cpp to Manager.cpp for clarity
This commit is contained in:
@@ -28,7 +28,7 @@ pkg_check_modules(AVUTIL REQUIRED libavutil)
|
||||
pkg_check_modules(SWSCALE REQUIRED libswscale)
|
||||
pkg_check_modules(SWRESAMPLE REQUIRED libswresample)
|
||||
|
||||
add_library(ChargeVideo SHARED "src/ChargeVideo.hpp" "src/Time.cpp"
|
||||
add_library(ChargeVideo SHARED "src/ChargeVideo.hpp" "src/Manager.cpp"
|
||||
"src/Video.cpp")
|
||||
|
||||
target_link_libraries(
|
||||
|
||||
@@ -38,7 +38,7 @@ using namespace Corrade;
|
||||
using namespace Magnum;
|
||||
using namespace Math::Literals;
|
||||
// ======================== CLASSES ========================
|
||||
class Time {
|
||||
class Manager {
|
||||
public:
|
||||
static void AdvanceTime();
|
||||
static float DeltaTime;
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
using namespace ChargeVideo;
|
||||
|
||||
// ================== Video Timing ==================
|
||||
float Time::DeltaTime = 0.0f;
|
||||
uint16_t Time::videoIDCounter = 0;
|
||||
// ================== Video Managing ==================
|
||||
float Manager::DeltaTime = 0.0f;
|
||||
uint16_t Manager::videoIDCounter = 0;
|
||||
|
||||
std::unordered_map<uint16_t, std::function<void()>> Time::videoPlayMethods;
|
||||
std::vector<uint16_t> Time::toUnhook;
|
||||
std::unordered_map<uint16_t, std::function<void()>> Manager::videoPlayMethods;
|
||||
std::vector<uint16_t> Manager::toUnhook;
|
||||
|
||||
Timeline Time::time{};
|
||||
Timeline Manager::time{};
|
||||
|
||||
void Time::AdvanceTime() {
|
||||
void Manager::AdvanceTime() {
|
||||
if (time.currentFrameTime() == 0.0f) {
|
||||
time.start();
|
||||
}
|
||||
@@ -30,9 +30,9 @@ void Time::AdvanceTime() {
|
||||
time.nextFrame();
|
||||
}
|
||||
|
||||
uint16_t Time::hookVideo(std::function<void()> videoPlay) {
|
||||
uint16_t Manager::hookVideo(std::function<void()> videoPlay) {
|
||||
videoPlayMethods.insert({++videoIDCounter, videoPlay});
|
||||
return videoIDCounter;
|
||||
}
|
||||
|
||||
void Time::unhookVideo(uint16_t ID) { toUnhook.push_back(ID); }
|
||||
void Manager::unhookVideo(uint16_t ID) { toUnhook.push_back(ID); }
|
||||
@@ -121,7 +121,7 @@ void Video::Play() {
|
||||
if (ID != 0) {
|
||||
return;
|
||||
}
|
||||
ID = Time::hookVideo(std::bind(&Video::continueVideo, this));
|
||||
ID = Manager::hookVideo(std::bind(&Video::continueVideo, this));
|
||||
if (audioStreamNum != -1) {
|
||||
Sound->Play();
|
||||
}
|
||||
@@ -133,7 +133,7 @@ void Video::Pause() {
|
||||
if (ID == 0) {
|
||||
return;
|
||||
}
|
||||
Time::unhookVideo(ID);
|
||||
Manager::unhookVideo(ID);
|
||||
if (audioStreamNum != -1) {
|
||||
Sound->Pause();
|
||||
}
|
||||
@@ -170,7 +170,7 @@ void Video::continueVideo() {
|
||||
clock =
|
||||
(double)Sound->GetPlayedSampleCount() / audioEngine->GetSampleRate();
|
||||
} else {
|
||||
clock += Time::DeltaTime;
|
||||
clock += Manager::DeltaTime;
|
||||
}
|
||||
|
||||
// Load frame
|
||||
|
||||
Reference in New Issue
Block a user