mirror of
https://github.com/radio95-rnt/rds95.git
synced 2026-02-26 20:33:53 +01:00
on_state
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user