Files
NightShot/include/gif_recorder.hpp
T
2026-07-31 17:03:49 +03:00

42 lines
822 B
C++

#pragma once
#include "config.hpp"
#include <windows.h>
#include <string>
namespace gif_recorder {
struct Options {
int fps = 30;
int quality = 8;
// 0 means manual stop. hardLimitSeconds is always enforced.
int durationSeconds = 0;
int hardLimitSeconds = 30;
bool captureCursor = true;
};
struct StartRequest {
RECT screenRect{};
Options options{};
HWND notificationTarget = nullptr;
};
struct Result {
bool success = false;
std::wstring path;
std::wstring message;
int frameCount = 0;
int elapsedMilliseconds = 0;
};
[[nodiscard]] bool start(const StartRequest& request);
void stop();
[[nodiscard]] bool active();
// Called by the main window after consuming WM_NIGHTSHOT_GIF_FINISHED.
void releaseFinished();
void shutdown();
} // namespace gif_recorder