Code: Select all
if key==33554531 then -- shift-c
addTimeToClipboard("Person A (","):")
end
if key==33554550 then -- shift-v
addTimeToClipboard("Person B (","):")
end
Code: Select all
local dlg = nil
local txtinput = nil
function descriptor()
return {
title = "copy timestamp 0.1",
version = "0.1",
author = "chub",
url = '',
shortdesc = "GetTimestamp intf";
description = "GetTimestamp intf",
capabilities = {"menu", "input-listener" }
}
end
function getFormattedTime(micros)
local millis = math.floor(micros / 1000)
local seconds = math.floor((millis / 1000) % 60)
local minutes = math.floor((millis / 60000) % 60)
local hours = math.floor((millis / 3600000) % 24)
millis = math.floor(millis % 1000)
return string.format("%02d:%02d:%02d.%03d", hours, minutes, seconds, millis)
end
function update_timestamp()
vlc.msg.dbg("UpdateTimestamp")
local t = vlc.var.get(vlc.object.input(), "time")
txtinput:set_text(getFormattedTime(t))
end
function interface_main()
dlg:add_button("get timestamp", update_timestamp)
txtinput = dlg:add_text_input("")
end
function activate()
trigger_menu(0)
end
function trigger_menu(id)
if dlg then
dlg:delete()
end
dlg = vlc.dialog("my dialog")
interface_main()
end
function deactivate()
vlc.msg.dbg("Bye bye!")
if dlg then
dlg:hide()
end
end
function close()
vlc.deactivate()
end
Code: Select all
return string.format("%02d:%02d:%02d.%03d", hours, minutes, seconds, millis)
Code: Select all
return string.format("[%02d:%02d:%02d]", hours, minutes, seconds)
Return to “General VLC media player Troubleshooting”
Users browsing this forum: No registered users and 16 guests