Skip to content

Commit 40d6153

Browse files
committed
Cleanup template and debug stuff
1 parent 9d39655 commit 40d6153

7 files changed

Lines changed: 60 additions & 179 deletions

File tree

README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,23 @@ The plugin runs an HTTP server on `http://127.0.0.1:8765/` when loaded.
2222

2323
### Available Waveforms
2424

25-
| Waveform | Description |
26-
|----------|-------------|
27-
| `sharp_state_change` | Short, high-intensity pulse for discrete state transitions |
28-
| `damp_state_change` | Gradual intensity change for smooth state transitions |
29-
| `sharp_collision` | High-intensity impact simulation for collision events |
30-
| `damp_collision` | Medium-intensity impact with gradual decay |
31-
| `subtle_collision` | Low-intensity feedback for light contact events |
32-
| `happy_alert` | Positive feedback pattern for success states |
33-
| `angry_alert` | Attention-grabbing pattern for error conditions |
34-
| `completed` | Confirmation pattern for task completion |
35-
| `square` | Sharp-edged waveform with defined start/stop points |
36-
| `wave` | Smooth sinusoidal pattern with gradual transitions |
37-
| `firework` | Multi-burst pattern with varying intensities |
38-
| `mad` | High-frequency chaotic pattern |
39-
| `knock` | Repetitive impact pattern |
40-
| `jingle` | Musical-style pattern with multiple tones |
41-
| `ringing` | Continuous oscillating pattern |
42-
| `heartbeat` | Rhythmic double-pulse pattern |
25+
| Waveform | Category |
26+
|----------|----------|
27+
| `sharp_collision` | Precision enhancers |
28+
| `sharp_state_change` | Progress indicators |
29+
| `knock` | Incoming events |
30+
| `damp_collision` | Precision enhancers |
31+
| `mad` | Progress indicators |
32+
| `ringing` | Incoming events |
33+
| `subtle_collision` | Precision enhancers |
34+
| `completed` | Progress indicators |
35+
| `jingle` | Incoming events |
36+
| `damp_state_change` | Precision enhancers |
37+
| `firework` | Progress indicators |
38+
| `happy_alert` | Progress indicators |
39+
| `wave` | Progress indicators |
40+
| `angry_alert` | Progress indicators |
41+
| `square` | Progress indicators |
4342

4443
## Example Usage
4544

src/Actions/CounterAdjustment.cs

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/Actions/CounterCommand.cs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/HapticWebApplication.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,12 @@ namespace Loupedeck.HapticWebPlugin
22
{
33
using System;
44

5-
// This class can be used to connect the Loupedeck plugin to an application.
6-
75
public class HapticWebApplication : ClientApplication
86
{
9-
public HapticWebApplication()
10-
{
11-
}
12-
13-
// This method can be used to link the plugin to a Windows application.
147
protected override String GetProcessName() => "";
158

16-
// This method can be used to link the plugin to a macOS application.
179
protected override String GetBundleName() => "";
1810

19-
// This method can be used to check whether the application is installed or not.
2011
public override ClientApplicationStatus GetApplicationStatus() => ClientApplicationStatus.Unknown;
2112
}
2213
}

src/HapticWebPlugin.cs

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,23 @@ public class HapticWebPlugin : Plugin
1919
private CertificateManager _certificateManager;
2020
private HttpsServer _httpsServer;
2121

22-
private static readonly Dictionary<String, String> HapticWaveforms = new Dictionary<String, String>
22+
private static readonly List<String> HapticWaveforms = new List<String>
2323
{
24-
{ "sharp_state_change", "Short, high-intensity pulse for discrete state transitions" },
25-
{ "damp_state_change", "Gradual intensity change for smooth state transitions" },
26-
{ "sharp_collision", "High-intensity impact simulation for collision events" },
27-
{ "damp_collision", "Medium-intensity impact with gradual decay" },
28-
{ "subtle_collision", "Low-intensity feedback for light contact events" },
29-
{ "happy_alert", "Positive feedback pattern for success states" },
30-
{ "angry_alert", "Attention-grabbing pattern for error conditions" },
31-
{ "completed", "Confirmation pattern for task completion" },
32-
{ "square", "Sharp-edged waveform with defined start/stop points" },
33-
{ "wave", "Smooth sinusoidal pattern with gradual transitions" },
34-
{ "firework", "Multi-burst pattern with varying intensities" },
35-
{ "mad", "High-frequency chaotic pattern" },
36-
{ "knock", "Repetitive impact pattern" },
37-
{ "jingle", "Musical-style pattern with multiple tones" },
38-
{ "ringing", "Continuous oscillating pattern" },
39-
{ "heartbeat", "Rhythmic double-pulse pattern" }
24+
"sharp_collision",
25+
"sharp_state_change",
26+
"knock",
27+
"damp_collision",
28+
"mad",
29+
"ringing",
30+
"subtle_collision",
31+
"completed",
32+
"jingle",
33+
"damp_state_change",
34+
"firework",
35+
"happy_alert",
36+
"wave",
37+
"angry_alert",
38+
"square"
4039
};
4140

4241
public override Boolean UsesApplicationApiOnly => true;
@@ -159,17 +158,11 @@ private Object HandleHealthCheck()
159158

160159
private Object HandleListWaveforms()
161160
{
162-
var waveformList = new List<Object>();
163-
foreach (var waveform in HapticWaveforms)
164-
{
165-
waveformList.Add(new { name = waveform.Key, description = waveform.Value });
166-
}
167-
168161
return new
169162
{
170163
success = true,
171164
count = HapticWaveforms.Count,
172-
waveforms = waveformList
165+
waveforms = HapticWaveforms
173166
};
174167
}
175168

@@ -180,13 +173,13 @@ private Object HandleTriggerHaptic(String waveform)
180173
return new { success = false, error = "Waveform name is required" };
181174
}
182175

183-
if (!HapticWaveforms.ContainsKey(waveform))
176+
if (!HapticWaveforms.Contains(waveform))
184177
{
185178
return new
186179
{
187180
success = false,
188181
error = $"Unknown waveform: {waveform}",
189-
availableWaveforms = new List<String>(HapticWaveforms.Keys)
182+
availableWaveforms = HapticWaveforms
190183
};
191184
}
192185

@@ -212,7 +205,7 @@ private void RegisterHapticEvents()
212205
{
213206
foreach (var waveform in HapticWaveforms)
214207
{
215-
this.PluginEvents.AddEvent(waveform.Key, waveform.Key, waveform.Value);
208+
this.PluginEvents.AddEvent(waveform, waveform, null);
216209
}
217210
PluginLog.Info($"Registered {HapticWaveforms.Count} haptic events");
218211
}
Lines changed: 23 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,45 @@
11
events:
2+
- name: sharp_collision
3+
displayName: Sharp Collision
4+
25
- name: sharp_state_change
36
displayName: Sharp State Change
4-
description: Short, high-intensity pulse for discrete state transitions
5-
6-
- name: damp_state_change
7-
displayName: Damp State Change
8-
description: Gradual intensity change for smooth state transitions
97

10-
- name: sharp_collision
11-
displayName: Sharp Collision
12-
description: High-intensity impact simulation for collision events
8+
- name: knock
9+
displayName: Knock
1310

1411
- name: damp_collision
1512
displayName: Damp Collision
16-
description: Medium-intensity impact with gradual decay
1713

18-
- name: subtle_collision
19-
displayName: Subtle Collision
20-
description: Low-intensity feedback for light contact events
14+
- name: mad
15+
displayName: Mad
2116

22-
- name: happy_alert
23-
displayName: Happy Alert
24-
description: Positive feedback pattern for success states
17+
- name: ringing
18+
displayName: Ringing
2519

26-
- name: angry_alert
27-
displayName: Angry Alert
28-
description: Attention-grabbing pattern for error conditions
20+
- name: subtle_collision
21+
displayName: Subtle Collision
2922

3023
- name: completed
3124
displayName: Completed
32-
description: Confirmation pattern for task completion
3325

34-
- name: square
35-
displayName: Square
36-
description: Sharp-edged waveform with defined start/stop points
26+
- name: jingle
27+
displayName: Jingle
3728

38-
- name: wave
39-
displayName: Wave
40-
description: Smooth sinusoidal pattern with gradual transitions
29+
- name: damp_state_change
30+
displayName: Damp State Change
4131

4232
- name: firework
4333
displayName: Firework
44-
description: Multi-burst pattern with varying intensities
4534

46-
- name: mad
47-
displayName: Mad
48-
description: High-frequency chaotic pattern
49-
50-
- name: knock
51-
displayName: Knock
52-
description: Repetitive impact pattern
35+
- name: happy_alert
36+
displayName: Happy Alert
5337

54-
- name: jingle
55-
displayName: Jingle
56-
description: Musical-style pattern with multiple tones
38+
- name: wave
39+
displayName: Wave
5740

58-
- name: ringing
59-
displayName: Ringing
60-
description: Continuous oscillating pattern
41+
- name: angry_alert
42+
displayName: Angry Alert
6143

62-
- name: heartbeat
63-
displayName: Heartbeat
64-
description: Rhythmic double-pulse pattern
44+
- name: square
45+
displayName: Square

src/package/events/extra/eventMapping.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,3 @@ haptics:
4343

4444
ringing:
4545
DEFAULT: ringing
46-
47-
heartbeat:
48-
DEFAULT: heartbeat

0 commit comments

Comments
 (0)