-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasicPluginFramework.qplug
More file actions
153 lines (140 loc) · 3.73 KB
/
Copy pathBasicPluginFramework.qplug
File metadata and controls
153 lines (140 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
-- Basic Framework Plugin
-- by QSC
-- October 2020
-- Information block for the plugin
PluginInfo = {
Name = "Base Plugin",
Version = "0.0",
BuildVersion = "0.0.0.0",
Id = "<guid>",
Author = "Your_Company",
Description = "A very basic plugin"
}
-- Define the color of the plugin object in the design
function GetColor(props)
return { 102, 102, 102 }
end
-- The name that will initially display when dragged into a design
function GetPrettyName(props)
return "My First Plugin, version " .. PluginInfo.Version
end
-- Optional function used if plugin has multiple pages
PageNames = { "Control", "Setup" } --List the pages within the plugin
function GetPages(props)
local pages = {}
for ix,name in ipairs(PageNames) do
table.insert(pages, {name = PageNames[ix]})
end
return pages
end
-- Optional function to define model if plugin supports more than one model
function GetModel(props)
local model = {}
if props.Model ~= nil and props.Model.Value ~= "" then
table.insert(model, { props.Model.Value } )
else
table.insert(model, { "Base Model" } )
end
return model
end
-- Define User configurable Properties of the plugin
function GetProperties()
local props = {}
table.insert(props, {
Name = "Debug Print",
Type = "enum",
Choices = {"None", "Tx/Rx", "Tx", "Rx", "Function Calls", "All"},
Value = "None"
})
return props
end
-- Optional function to define pins on the plugin that are not connected to a Control
function GetPins(props)
local pins = {}
table.insert(pins,{
Name = "Audio Output",
Direction = "output",
})
return pins
end
-- Optional function to update available properties when properties are altered by the user
function RectifyProperties(props)
if props.plugin_show_debug.Value == false then
props["Debug Print"].IsHidden = true
end
return props
end
-- Optional function to define components used within the plugin
function GetComponents(props)
local components = {}
table.insert(components,{
Name = "main_mixer",
Type = "mixer",
Properties =
{
["n_inputs"] = 8,
["n_outputs"] = 1,
}
})
return components
end
-- Optional function to define wiring of components used within the plugin
function GetWiring(props)
local wiring = {}
table.insert( wiring, { "Audio Output", "main_mixer Output 1" } )
return wiring
end
-- Defines the Controls used within the plugin
function GetControls(props)
local ctrls = {}
table.insert(ctrls, {
Name = "SendButton",
ControlType = "Button",
ButtonType = "Momentary",
Count = 1,
UserPin = true,
PinStyle = "Input",
Icon = "Power"
})
return ctrls
end
--Layout of controls and graphics for the plugin UI to display
function GetControlLayout(props)
local layout = {}
local graphics = {}
local CurrentPage = PageNames[props["page_index"].Value]
if CurrentPage == "Control" then
table.insert(graphics,{
Type = "GroupBox",
Text = "Control",
Fill = {200,200,200},
StrokeWidth = 1,
Position = {5,5},
Size = {200,100}
})
table.insert(graphics,{
Type = "Text",
Text = "Say Hello:",
Position = {10,42},
Size = {90,16},
FontSize = 14,
HTextAlign = "Right"
})
layout["SendButton"] = {
PrettyName = "Buttons~Send The Command",
Style = "Button",
Position = {105,42},
Size = {50,16},
Color = {0,0,0}
}
elseif CurrentPage == "Setup" then
-- TBD
end
return layout, graphics
end
--Start event based logic
if Controls then
Controls.SendButton.EventHandler = function()
print("Hello, World!")
end
end