Stream Deck 插件模板使用教程
1. 项目的目录结构及介绍
Stream Deck 插件模板的目录结构如下:
streamdeck-plugin-template/
├── LICENSE
├── README.md
├── manifest.json
├── src/
│ └── com.elgato.template.sdPlugin/
│ ├── app.js
│ ├── icon.png
│ ├── index.html
│ └── property_inspector.html
└── src/mydomain.plugin-name/libs/
└── streamdeck-javascript-sdk/
目录结构介绍
LICENSE
: 项目的许可证文件。README.md
: 项目的说明文档。manifest.json
: 插件的配置文件,包含插件的基本信息和版本号等。src/
: 源代码目录。com.elgato.template.sdPlugin/
: 插件的主要代码目录。app.js
: 插件的主逻辑文件。icon.png
: 插件的图标文件。index.html
: 插件的主界面文件。property_inspector.html
: 插件的属性检查器界面文件。
src/mydomain.plugin-name/libs/
: 插件依赖的库目录。streamdeck-javascript-sdk/
: Stream Deck 的 JavaScript SDK。
2. 项目的启动文件介绍
app.js
app.js
是插件的主逻辑文件,负责处理插件的主要功能和事件。以下是 app.js
的主要功能:
- 初始化插件。
- 处理来自 Stream Deck 的事件。
- 与属性检查器进行通信。
index.html
index.html
是插件的主界面文件,负责显示插件的用户界面。以下是 index.html
的主要功能:
- 加载插件的界面元素。
- 与
app.js
进行通信,处理用户交互。
property_inspector.html
property_inspector.html
是插件的属性检查器界面文件,负责显示插件的配置选项。以下是 property_inspector.html
的主要功能:
- 加载属性检查器的界面元素。
- 与
app.js
进行通信,处理用户配置。
3. 项目的配置文件介绍
manifest.json
manifest.json
是插件的配置文件,包含插件的基本信息和版本号等。以下是 manifest.json
的主要内容:
{
"Author": "Elgato Systems",
"Description": "Stream Deck Plugin Template",
"Name": "Stream Deck Plugin Template",
"Icon": "icon.png",
"URL": "https://github.com/elgatosf/streamdeck-plugin-template",
"Version": "1.0",
"CodePath": "app.js",
"PropertyInspectorPath": "property_inspector.html",
"SDKVersion": 2,
"Software": {
"MinimumVersion": "6.0"
}
}
配置文件介绍
Author
: 插件的作者。Description
: 插件的描述。Name
: 插件的名称。Icon
: 插件的图标文件路径。URL
: 插件的 GitHub 仓库地址。Version
: 插件的版本号。CodePath
: 插件的主逻辑文件路径。PropertyInspectorPath
: 插件的属性检查器文件路径。SDKVersion
: 使用的 Stream Deck SDK 版本。Software
: 插件所需的 Stream Deck 软件最低版本。
以上是 Stream Deck 插件模板的基本使用教程,希望对你有所帮助。