Skip to content

Commit 294b188

Browse files
committed
WIP
1 parent 79726c9 commit 294b188

File tree

10 files changed

+795
-156
lines changed

10 files changed

+795
-156
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"devDependencies": {
2929
"@companion-module/tools": "^2.1.1",
3030
"@types/node": "^22.10.2",
31+
"@types/ws": "^8.18.1",
3132
"eslint": "^9.17.0",
3233
"husky": "^9.1.7",
3334
"lint-staged": "^15.2.11",

src/config.ts

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ export interface WingConfig {
2222
/** When enabled, the module will request values for all variables on startup */
2323
prefetchVariablesOnStartup?: boolean
2424

25+
useCcSurfaces?: boolean
26+
showCcTutorial?: boolean
27+
useCcUserPages?: boolean
28+
ccUserPagesToCreate?: number[]
29+
useCcGpio?: boolean
30+
useCcUser?: boolean
31+
useCcDaw?: boolean
32+
2533
// Advanced Option
2634
requestTimeout?: number
2735
panicOnLostRequest?: boolean
@@ -129,6 +137,131 @@ export function GetConfigFields(_self: InstanceBaseExt<WingConfig>): SomeCompani
129137
default: true,
130138
},
131139
spacer,
140+
{
141+
type: 'checkbox',
142+
id: 'useCcSurfaces',
143+
label: 'Enable Virtual Control Surfaces',
144+
tooltip:
145+
'Master toggle for Virtual Control surface support. This is an advanced feature - see tutorial below for setup details.',
146+
width: 12,
147+
default: false,
148+
},
149+
{
150+
type: 'static-text',
151+
id: 'cc-surfaces-info',
152+
width: 12,
153+
label: 'Advanced Feature',
154+
value:
155+
'Creates virtual Satellite surfaces that respond to Custom Control button presses on your Wing console. ' +
156+
"This allows you to trigger Companion actions directly from the console's CC buttons. ",
157+
isVisibleExpression: `$(options:useCcSurfaces) == true`,
158+
},
159+
{
160+
type: 'checkbox',
161+
id: 'showCcTutorial',
162+
label: 'Show Tutorial',
163+
tooltip: 'Display detailed setup instructions for Custom Control Surfaces.',
164+
width: 12,
165+
default: false,
166+
isVisibleExpression: `$(options:useCcSurfaces) == true`,
167+
},
168+
{
169+
type: 'static-text',
170+
id: 'cc-tutorial',
171+
width: 12,
172+
label: 'Setup Tutorial',
173+
value:
174+
'<h3>How It Works</h3>' +
175+
'<p>When you press a Custom Control button on your Wing console, the corresponding button press is sent to Companion, where you can program any action you want.</p>' +
176+
'<h3>Configuration Steps</h3>' +
177+
'<ol>' +
178+
'<li><strong>Enable Custom Control Surfaces</strong> - Check the master toggle above</li>' +
179+
'<li><strong>Select Surface Types</strong> - Choose which surface types you want to create:' +
180+
'<ul>' +
181+
'<li><strong>User Pages (CC)</strong> - Creates surfaces for User Pages (U1-U16) with encoders and buttons. You can select specific pages to create (1-16).</li>' +
182+
'<li><strong>GPIO Buttons</strong> - Creates a surface for GPIO buttons</li>' +
183+
'<li><strong>User Buttons</strong> - Creates a surface for User buttons (8 buttons)</li>' +
184+
'<li><strong>DAW Buttons</strong> - Creates surfaces for DAW buttons (4 sets of 8 buttons)</li>' +
185+
'</ul>' +
186+
'</li>' +
187+
"<li><strong>Configure in Companion</strong> - After enabling, the surfaces will appear in Companion's <strong>Surfaces</strong> tab where you can assign them to pages</li>" +
188+
'</ol>' +
189+
'<h3>Recommended Page Mapping</h3>' +
190+
'<p>It is advisable to dedicate one Companion page per Wing User Page surface. This provides a clear one-to-one relationship between your console and Companion.</p>' +
191+
'<p><strong>In the Surfaces section:</strong></p>' +
192+
'<ul>' +
193+
'<li>Assign each surface to a page number with a matching last digit. Deactivate "Use last page at startup" and select the desired page number for "Startup Page" and "Current Page"</li>' +
194+
'<li>For example:' +
195+
'<ul>' +
196+
'<li><code>WING_CC_01</code> → Page 71</li>' +
197+
'<li><code>WING_CC_02</code> → Page 72</li>' +
198+
'<li><code>WING_CC_03</code> → Page 73</li>' +
199+
'<li>And so on...</li>' +
200+
'</ul>' +
201+
'</li>' +
202+
'</ul>' +
203+
'<p>This numbering scheme makes it easy to identify which Companion page corresponds to which User Page on your Wing console.</p>' +
204+
'<p><strong>In the Buttons section:</strong></p>' +
205+
'<ul>' +
206+
'<li>Configure the actual button actions for each page (e.g. 71) in the "Buttons" section of Companion</li>' +
207+
'</ul>' +
208+
'<h3>Requirements</h3>' +
209+
'<ul>' +
210+
'<li><strong>Important:</strong> On the Wing console, each Custom Control button must have a MIDI command assigned for it to send OSC event updates to Companion. The same MIDI command can be used for all buttons.</li>' +
211+
'</ul>',
212+
isVisibleExpression: `$(options:useCcSurfaces) == true && $(options:showCcTutorial) == true`,
213+
},
214+
{
215+
type: 'checkbox',
216+
id: 'useCcUserPages',
217+
label: 'Enable User Pages (CC)',
218+
tooltip: 'Create surfaces for User Pages (U1-U16) with encoders and buttons.',
219+
width: 6,
220+
default: false,
221+
isVisibleExpression: `$(options:useCcSurfaces) == true`,
222+
},
223+
{
224+
type: 'multidropdown',
225+
id: 'ccUserPagesToCreate',
226+
label: 'User Pages to Create',
227+
tooltip: 'Select which User Pages (1-16) to create as virtual surfaces.',
228+
width: 12,
229+
choices: Array.from({ length: 16 }, (_, i) => ({
230+
id: i + 1,
231+
label: `CC Page ${i + 1}`,
232+
})),
233+
default: [16],
234+
minSelection: 0,
235+
isVisibleExpression: `$(options:useCcSurfaces) == true && $(options:useCcUserPages) == true`,
236+
},
237+
{
238+
type: 'checkbox',
239+
id: 'useCcGpio',
240+
label: 'Enable GPIO Buttons',
241+
tooltip: 'Create a virtual surface for GPIO buttons.',
242+
width: 6,
243+
default: false,
244+
isVisibleExpression: `$(options:useCcSurfaces) == true`,
245+
},
246+
{
247+
type: 'checkbox',
248+
id: 'useCcUser',
249+
label: 'Enable User Buttons',
250+
tooltip: 'Create a virtual surface for User buttons (8 buttons).',
251+
width: 6,
252+
default: false,
253+
isVisibleExpression: `$(options:useCcSurfaces) == true`,
254+
},
255+
{
256+
type: 'checkbox',
257+
id: 'useCcDaw',
258+
label: 'Enable DAW Buttons',
259+
tooltip: 'Create virtual surfaces for DAW buttons (4 sets of 8 buttons).',
260+
width: 6,
261+
default: false,
262+
isVisibleExpression: `$(options:useCcSurfaces) == true`,
263+
},
264+
spacer,
132265
{
133266
type: 'checkbox',
134267
id: 'show-advanced-options',

0 commit comments

Comments
 (0)