0
1
mirror of https://github.com/radio95-rnt/rds95.git synced 2026-02-26 20:33:53 +01:00
This commit is contained in:
2025-12-24 23:16:10 +01:00
parent c085cb52c5
commit a3fd1a5462
3 changed files with 7 additions and 0 deletions

View File

@@ -24,6 +24,10 @@ function on_init() end
---It should be defined by the user in the script.
---@return nil
function on_start() end
---This function is called every time when the state resets, register your odas here
---It should be defined by the user in the script.
---@return nil
function on_state() end
---This function is called every second
---It should be defined by the user in the script.
---@return nil

View File

@@ -12,6 +12,7 @@ int lua_set_rds_program_defaults(lua_State *localL) {
unload_refs[0] = 0;
set_rds_defaults(mod->enc, mod->enc->program);
lua_call_function("on_init");
lua_call_function("on_state");
return 0;
}
@@ -25,6 +26,7 @@ int lua_reset_rds(lua_State *localL) {
encoder_loadFromFile(mod->enc);
for(int i = 0; i < PROGRAMS; i++) reset_rds_state(mod->enc, i);
Modulator_loadFromFile(&mod->params);
lua_call_function("on_state");
return 0;
}

View File

@@ -414,5 +414,6 @@ void init_rds_encoder(RDSEncoder* enc) {
}
for(int i = 0; i < PROGRAMS; i++) reset_rds_state(enc, i);
lua_call_function("on_start");
lua_call_function("on_state");
encoder_saveToFile(enc);
}