summaryrefslogtreecommitdiffstatshomepage
path: root/plugins/timecode/init.lua
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-04-07 06:20:40 +1000
committer Vas Crabb <vas@vastheman.com>2023-04-07 06:20:40 +1000
commitb67b969bf0911d71396c77e42d85ddfe80de6f20 (patch)
tree8d964eac6e0c4c849dc2b9b0b3742154c6c943d4 /plugins/timecode/init.lua
parentc4282fecede9032be78028e8fde737d44bf2b7c6 (diff)
-Improved some Lua APIs:
* Moved several machine lifecycle callbacks to the notifier/subscriber model. The old callback registration model is still available for them for now, but prints a deprecation warning. * Added pre-save/post-load notifications. * Use a single allocated timer rather than one anonymous timer per waiter. Waiters no longer prevent saved states from being loaded. * Clean up outstanding waiters on stop or state load rather than just leaking them. * Started documenting parts of the emulator interface object that should be relatively stable. -imagedev/avivideo.cpp: Fixed an object leak on unload. Also changed some other media image devices to use smart pointers.
Diffstat (limited to 'plugins/timecode/init.lua')
-rw-r--r--plugins/timecode/init.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/timecode/init.lua b/plugins/timecode/init.lua
index 93435ef2870..1de94c034ba 100644
--- a/plugins/timecode/init.lua
+++ b/plugins/timecode/init.lua
@@ -10,6 +10,8 @@ local exports = {
local timecode = exports
+local frame_subscription, stop_subscription
+
function timecode.startplugin()
local file -- the timecode log file
local write -- whether to record a timecode on the next emulated frame
@@ -338,10 +340,10 @@ function timecode.startplugin()
end
- emu.register_frame(process_frame)
+ frame_subscription = emu.add_machine_frame_notifier(process_frame)
emu.register_frame_done(process_frame_done)
emu.register_prestart(start)
- emu.register_stop(stop)
+ stop_subscription = emu.add_machine_stop_notifier(stop)
emu.register_menu(menu_callback, menu_populate, _p('plugin-timecode', 'Timecode Recorder'))
end