当前位置: 首页 > news >正文

杭州做网站套餐门户网站的好处

杭州做网站套餐,门户网站的好处,外贸网站 自建,思源黑体可以做网站文章目录 OBS 日期时间.毫秒时间脚本:效果 OBS 日期时间.毫秒时间脚本: obs obslua source_name ""last_text "" format_string "" activated false-- 此函数用于获取精确的毫秒级时间戳&#…

文章目录

    • OBS 日期时间.毫秒时间脚本:
    • 效果

OBS 日期时间.毫秒时间脚本:

obs           = obslua
source_name   = ""last_text     = ""
format_string = ""
activated     = false-- 此函数用于获取精确的毫秒级时间戳,适用于 Linux 系统
local function getMillisTimestamp()local sec, usec = os.time(), os.clock()local millis = math.floor((sec + usec) * 1000)return millis
end-- Function to set the time text
function set_time_text()-- local text = os.date(format_string)-- local date_table = os.date("*t")-- local ms = string.format("%.3f", os.clock()) -- local hour, minute, second = date_table.hour, date_table.min, date_table.sec-- local year, month, day = date_table.year, date_table.month, date_table.day   -- local text = string.format("%s", ms)local date_table = os.date("*t")local hour, minute, second = date_table.hour, date_table.min, date_table.seclocal year, month, day = date_table.year, date_table.month, date_table.day-- 获取毫秒级时间戳local millisTimestamp = getMillisTimestamp()-- 提取毫秒部分local ms = millisTimestamp % 1000-- 格式化时间字符串local text = string.format("%04d-%02d-%02d %02d:%02d:%02d.%03d", year, month, day, hour, minute, second, ms)if text ~= last_text thenlocal source = obs.obs_get_source_by_name(source_name)if source ~= nil thenlocal settings = obs.obs_data_create()obs.obs_data_set_string(settings, "text", text)obs.obs_source_update(source, settings)obs.obs_data_release(settings)obs.obs_source_release(source)endendlast_text = text
endfunction timer_callback()set_time_text()
endfunction activate(activating)if activated == activating thenreturnendactivated = activatingif activating thenset_time_text()obs.timer_add(timer_callback, 1)elseobs.timer_remove(timer_callback)end
end-- Called when a source is activated/deactivated
function activate_signal(cd, activating)local source = obs.calldata_source(cd, "source")if source ~= nil thenlocal name = obs.obs_source_get_name(source)if (name == source_name) thenactivate(activating)endend
endfunction source_activated(cd)activate_signal(cd, true)
endfunction source_deactivated(cd)activate_signal(cd, false)
endfunction reset(pressed)if not pressed thenreturnendactivate(false)local source = obs.obs_get_source_by_name(source_name)if source ~= nil thenlocal active = obs.obs_source_active(source)obs.obs_source_release(source)activate(active)end
end------------------------------------------------------------ A function named script_properties defines the properties that the user
-- can change for the entire script module itself
function script_properties()local props = obs.obs_properties_create()local p = obs.obs_properties_add_list(props, "source", "Text Source", obs.OBS_COMBO_TYPE_EDITABLE, obs.OBS_COMBO_FORMAT_STRING)local sources = obs.obs_enum_sources()if sources ~= nil thenfor _, source in ipairs(sources) dosource_id = obs.obs_source_get_id(source)if source_id == "text_gdiplus" or source_id == "text_ft2_source" thenlocal name = obs.obs_source_get_name(source)obs.obs_property_list_add_string(p, name, name)endendendobs.source_list_release(sources)obs.obs_properties_add_text(props, "format_string", "Format String", obs.OBS_TEXT_DEFAULT)return props
end-- A function named script_description returns the description shown to
-- the user
function script_description()return "Sets a text source to act as a date/time text when the source is active.\n\nMade by Ragowit"
end-- A function named script_update will be called when settings are changed
function script_update(settings)activate(false)source_name = obs.obs_data_get_string(settings, "source")format_string = obs.obs_data_get_string(settings, "format_string")reset(true)
end-- A function named script_defaults will be called to set the default settings
function script_defaults(settings)obs.obs_data_set_default_string(settings, "format_string", "%Y-%m-%d %X")
end-- a function named script_load will be called on startup
function script_load(settings)-- Connect activation/deactivation signal callbacks---- NOTE: These particular script callbacks do not necessarily have to-- be disconnected, as callbacks will automatically destroy themselves-- if the script is unloaded.  So there's no real need to manually-- disconnect callbacks that are intended to last until the script is-- unloaded.local sh = obs.obs_get_signal_handler()obs.signal_handler_connect(sh, "source_activate", source_activated)obs.signal_handler_connect(sh, "source_deactivate", source_deactivated)
end

效果

在这里插入图片描述

http://www.dtcms.com/a/518122.html

相关文章:

  • 网站开发运营维护方案建议网站建设的一些名词
  • 珠海 网站建设和推广荆州网站建设兼职
  • 网站建设与网页设计...app和网站开发
  • 请人做装修设计上什么网站南京做网站需要多少钱
  • 微信公众号做微网站郑州外贸网站建设公司价格
  • 2014最新网站模板-网页模板免费下载-风格吧给手机开发网站
  • 网站评论设计台州市城市建设投资公司网站
  • 怎么知道网站的域名信阳百度推广公司
  • 推进门户网站建设大连建设工程信息网改名为什么
  • 如何提高用户和网站的互动性网站建设 上海
  • 奖励网站代码高密做网站哪家强价位
  • 泰州网站模板智慧校园平台
  • 静态网站 apache小程序制作代码编写
  • 手机网站禁止缩放网站应具有的功能模块
  • 蚌埠网站优化为客户网站做产品描述
  • 网站地图那么建设html做的网站怎么弄
  • 做网站app要注册哪类商标盐城做网站的公司地址
  • 北京网站平台建设公司网络维护合同模板
  • 网页设计制作网站教程网站开发的调研
  • 企业站seo点击软件创建免费网站需要什么条件
  • 制作网站公司哪里好中铁建设集团有限公司总部在哪
  • 河北网站建设哪里好国内it培训机构排名
  • 专业摄影网站小程序搭建是什么工作
  • 学做网站能赚多少钱wordpress云端采集
  • 网站建设跟加入会员哪个效果好根据网站集约化建设要求
  • 一起装修网官方网站内江做网站哪里便宜
  • 2017网站开发主流工具网站开发报价评估
  • 一、redis安装(单机)和使用
  • 怎样为企业设计网站建筑代理公司是干什么的
  • 做门户网站需要什么网站建设公司汕头的