2020-06-20 07:46:41 +00:00
|
|
|
#pragma once
|
|
|
|
#include <functional>
|
2020-06-27 09:48:55 +00:00
|
|
|
#include "dobject.h"
|
2020-06-20 07:46:41 +00:00
|
|
|
|
2020-06-27 09:48:55 +00:00
|
|
|
|
|
|
|
class DScreenJob : public DObject
|
|
|
|
{
|
|
|
|
DECLARE_CLASS(DScreenJob, DObject)
|
|
|
|
//std::function<void(bool skipped)> completion;
|
|
|
|
|
|
|
|
public:
|
2020-06-27 22:32:28 +00:00
|
|
|
virtual int Frame(uint64_t clock, bool skiprequest) = 0;
|
2020-06-27 09:48:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
void RunScreenJob(DScreenJob *job, std::function<void(bool skipped)> completion, bool clearbefore = true);
|
2020-06-27 22:32:28 +00:00
|
|
|
void RunScreenJob(std::function<int(uint64_t, bool)> action, std::function<void(bool)> completion, bool clearbefore = true);
|
2020-06-27 09:48:55 +00:00
|
|
|
|
|
|
|
struct AnimSound
|
|
|
|
{
|
|
|
|
int framenum;
|
|
|
|
int soundnum;
|
|
|
|
};
|
|
|
|
|
2020-06-27 22:32:28 +00:00
|
|
|
void PlayVideo(const char *filename, const AnimSound *ans, const int *frameticks, std::function<void(bool)> completion);
|
2020-06-27 09:48:55 +00:00
|
|
|
|
|
|
|
// This one is not suitable for ANM and SMK unless a descriptor file format is implemented.
|
|
|
|
inline void PlayVideo(const char *filename, std::function<void(bool skipped)> completion)
|
|
|
|
{
|
2020-06-27 22:32:28 +00:00
|
|
|
PlayVideo(filename, nullptr, nullptr , completion);
|
2020-06-27 09:48:55 +00:00
|
|
|
}
|