2026-03-13 22:10:10 +01:00
|
|
|
#pragma once
|
2026-03-25 21:57:10 +01:00
|
|
|
#include "include/lasr/auto-splitter.h"
|
|
|
|
|
#include "include/timer.h"
|
2026-03-13 23:51:29 +01:00
|
|
|
#include "lua.h"
|
|
|
|
|
|
2026-03-14 21:17:51 +01:00
|
|
|
extern ExternalLASRFunctionRegistry external_lasr_functions;
|
2026-03-13 22:10:10 +01:00
|
|
|
|
2026-03-14 21:53:01 +01:00
|
|
|
extern TimerHookRegistry start_hooks;
|
|
|
|
|
extern TimerHookRegistry stop_hooks;
|
|
|
|
|
extern TimerHookRegistry split_hooks;
|
|
|
|
|
extern TimerHookRegistry reset_hooks;
|
|
|
|
|
extern TimerHookRegistry cancel_hooks;
|
|
|
|
|
extern TimerHookRegistry skip_hooks;
|
|
|
|
|
extern TimerHookRegistry unsplit_hooks;
|
|
|
|
|
extern TimerHookRegistry pause_hooks;
|
|
|
|
|
extern TimerHookRegistry unpause_hooks;
|
|
|
|
|
|
2026-03-13 22:10:10 +01:00
|
|
|
/*! \enum event
|
|
|
|
|
*
|
|
|
|
|
* Describes the events you can register an event hook for.
|
|
|
|
|
*/
|
|
|
|
|
typedef enum HookableEvent {
|
|
|
|
|
START,
|
|
|
|
|
SPLIT,
|
|
|
|
|
STOP,
|
|
|
|
|
RESET,
|
|
|
|
|
CANCEL,
|
|
|
|
|
SKIP,
|
|
|
|
|
UNSPLIT,
|
|
|
|
|
PAUSE,
|
|
|
|
|
UNPAUSE,
|
|
|
|
|
} HookableEvent;
|
|
|
|
|
|
2026-03-13 23:51:29 +01:00
|
|
|
typedef int (*register_lua_func)(const char*, lua_CFunction);
|
2026-03-14 22:24:33 +01:00
|
|
|
typedef int (*register_event_func)(HookableEvent event, timer_hook_func fn);
|
2026-03-13 23:51:29 +01:00
|
|
|
|
|
|
|
|
typedef struct PlugAPI {
|
|
|
|
|
register_lua_func register_lua_function;
|
2026-03-14 22:24:33 +01:00
|
|
|
register_event_func register_event_hook;
|
2026-03-13 23:51:29 +01:00
|
|
|
} PlugAPI;
|
|
|
|
|
|
|
|
|
|
int register_lua_function(const char* name, lua_CFunction);
|
2026-03-13 22:10:10 +01:00
|
|
|
|
2026-03-14 21:53:01 +01:00
|
|
|
int register_event_hook(HookableEvent event, timer_hook_func fn);
|
2026-03-13 23:51:29 +01:00
|
|
|
|
|
|
|
|
void init_external_lasr_functions(void);
|