Move feedback stutter bug report to android folder

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Paul Lipscomb
2026-07-30 19:14:00 -05:00
parent d5dfb290c1
commit 6f66a5db64
566 changed files with 432 additions and 147 deletions
+4 -4
View File
@@ -3336,11 +3336,11 @@ def _route_hw_cc_bind(status, channel, cc_num, cc_val):
bound_browser.on_hw_trigger(cc_val)
return True
elif bound_transport:
print(f"[transport hw] CC{cc_num} val={cc_val} uid={bound_transport.uid}")
print(f"[transport hw] CC{cc_num} val={cc_val} -> uid={bound_transport.uid}")
midi_receiver.hw_cc_signal.emit(bound_transport.uid, cc_val)
return True
elif bound_fader:
print(f"[hw] CC{cc_num} val={cc_val} uid={bound_fader.uid}")
print(f"[hw] CC{cc_num} val={cc_val} -> uid={bound_fader.uid}")
midi_receiver.hw_cc_signal.emit(bound_fader.uid, cc_val)
return True
return False
@@ -3386,7 +3386,7 @@ def midi_message_route_hw_to_output_cc(fader_uid, value):
if fader.uid == fader_uid:
out_cc = fader.cc_spin.value()
out_ch = fader.ch_spin.value()
print(f"[convert] HW CC{fader.hw_cc} CH{fader.hw_channel} ({value}) CC{out_cc} CH{out_ch} ({value})")
print(f"[convert] HW CC{fader.hw_cc} CH{fader.hw_channel} ({value}) -> CC{out_cc} CH{out_ch} ({value})")
fader.fader.blockSignals(True)
fader.fader.setValue(value)
fader.fader.blockSignals(False)
@@ -3403,7 +3403,7 @@ def midi_message_route_hw_to_output_cc(fader_uid, value):
if toggle.uid == fader_uid:
out_cc = toggle.cc_spin.value()
out_ch = toggle.ch_spin.value()
print(f"[toggle convert] HW CC{toggle.hw_cc} CH{toggle.hw_channel} ({value}) CC{out_cc} CH{out_ch}")
print(f"[toggle convert] HW CC{toggle.hw_cc} CH{toggle.hw_channel} ({value}) -> CC{out_cc} CH{out_ch}")
toggle.cc_input_lbl.setText(toggle._cc_input_label(value))
if toggle.trigger_mode == "momentary":
send_cc(out_cc, 127, channel=out_ch)
+1 -1
View File
@@ -32,6 +32,6 @@ def send_osc_message(address, value=1.0):
try:
get_osc_client().send_message(address, float(value))
osc_receiver.osc_out_signal.emit(address, str(value))
print(f"[OSC] {address} {value}")
print(f"[OSC] -> {address} {value}")
except Exception as e:
print(f"[OSC send] Error: {e}")
+266 -31
View File
@@ -1,5 +1,5 @@
{
"__last_used__": "preset2",
"__last_used__": "preset1",
"presets": {
"preset1": {
"faders": [
@@ -8,12 +8,13 @@
"label": "fuckin a",
"cc": 1,
"ch": 1,
"value": 117,
"value": 40,
"color": "Red",
"pickup": false,
"last_sent": 117,
"last_sent": 40,
"hw_cc": null,
"hw_channel": null,
"touch_sense_mode": "off",
"zone": null,
"center_index": null,
"zone_index": null,
@@ -25,12 +26,13 @@
"label": "Fader 2",
"cc": 1,
"ch": 1,
"value": 107,
"value": 75,
"color": "Gray",
"pickup": false,
"last_sent": 107,
"last_sent": 75,
"hw_cc": null,
"hw_channel": null,
"touch_sense_mode": "off",
"zone": "right",
"center_index": 1,
"zone_index": -1,
@@ -42,12 +44,13 @@
"label": "Fader 3",
"cc": 1,
"ch": 1,
"value": 83,
"value": 77,
"color": "Orange",
"pickup": false,
"last_sent": 83,
"last_sent": 77,
"hw_cc": null,
"hw_channel": null,
"touch_sense_mode": "off",
"zone": "left",
"center_index": 2,
"zone_index": -1,
@@ -77,7 +80,7 @@
"label": "Toggle 2",
"cc": 20,
"ch": 1,
"state": false,
"state": true,
"color": "Blue",
"zone": "left",
"center_index": 1,
@@ -192,7 +195,7 @@
"show_hide": {
"fader": false,
"toggle": true,
"transport": true,
"transport": false,
"browser": true
},
"sections": {
@@ -201,6 +204,128 @@
"fader_row": true,
"toggle_row": true,
"transport_row": true
},
"tablet_layout": {
"7bf9e219-b7a6-4d8e-b317-da9eb18a8095": {
"x": 60,
"y": 80,
"w": 172,
"h": 1260,
"hidden": false
},
"b4159deb-758b-4711-838c-a6bfe6d59872": {
"x": 2480,
"y": 700,
"w": 131,
"h": 131,
"hidden": false
},
"a5a50618-fc4c-446e-868e-e4eafa6254e7": {
"x": 2280,
"y": 700,
"w": 131,
"h": 131,
"hidden": false
},
"e2e8eb84-c2c9-4060-a818-b087ebd5aabd": {
"x": 2680,
"y": 100,
"w": 131,
"h": 131,
"hidden": false
},
"c179bfea-deec-416a-b4aa-74e81b5cbe03": {
"x": 2080,
"y": 700,
"w": 131,
"h": 131,
"hidden": false
},
"2064f2ca-6d18-468b-bf45-9bcb1fa1247d": {
"x": 2700,
"y": 300,
"w": 131,
"h": 131,
"hidden": false
},
"bd0c9b6a-db81-411d-88b0-5ebae3c4e790": {
"x": 300,
"y": 80,
"w": 172,
"h": 1260,
"hidden": false
},
"73962e37-53b3-400f-a7e2-25ef7f1ea583": {
"x": 2680,
"y": 700,
"w": 131,
"h": 131,
"hidden": false
},
"2a1fcb50-b9f2-4c33-bce0-5bd5cadd9c46": {
"x": 2520,
"y": 500,
"w": 131,
"h": 131,
"hidden": false
},
"4208c3e3-c0b0-4c51-a426-be90568c904a": {
"x": 2400,
"y": 280,
"w": 131,
"h": 131,
"hidden": false
},
"7a029b92-9cc0-4534-8657-6abe24c592e0": {
"x": 2480,
"y": 20,
"w": 131,
"h": 131,
"hidden": false
},
"c98d2009-d186-489a-8883-ccbd612cb4af": {
"x": 540,
"y": 80,
"w": 172,
"h": 1260,
"hidden": false
},
"b3cf419a-5183-4272-bd6f-44f858afbec8": {
"x": 1880,
"y": 700,
"w": 131,
"h": 131,
"hidden": false
},
"__big_title__": {
"x": 774,
"y": 49,
"w": 340,
"h": 81,
"hidden": false,
"color": "#00E676"
},
"f1775380-3390-4fbb-bd8b-8c30ff18f72a": {
"x": 1960,
"y": 460,
"w": 131,
"h": 131,
"hidden": false
},
"9ee09db7-2cf5-4ae6-a154-b25bb262565c": {
"x": 2160,
"y": 360,
"w": 131,
"h": 131,
"hidden": false
},
"6b5bcaf7-1d01-4ccd-b23a-ebae8da57a7f": {
"x": 2080,
"y": 180,
"w": 131,
"h": 131,
"hidden": false
}
}
},
"preset2": {
@@ -264,12 +389,13 @@
"label": "trumpet whatever",
"cc": 1,
"ch": 1,
"value": 43,
"value": 58,
"color": "Orange",
"pickup": false,
"last_sent": 43,
"last_sent": 58,
"hw_cc": null,
"hw_channel": null,
"touch_sense_mode": "off",
"zone": "left",
"center_index": 0,
"zone_index": -1,
@@ -287,6 +413,7 @@
"last_sent": 48,
"hw_cc": null,
"hw_channel": null,
"touch_sense_mode": "off",
"zone": null,
"center_index": null,
"zone_index": null,
@@ -304,6 +431,7 @@
"last_sent": 48,
"hw_cc": null,
"hw_channel": null,
"touch_sense_mode": "off",
"zone": "right",
"center_index": 2,
"zone_index": -1,
@@ -352,7 +480,7 @@
"show_hide": {
"fader": false,
"toggle": true,
"transport": true,
"transport": false,
"browser": true
},
"sections": {
@@ -579,6 +707,113 @@
"fader_row": true,
"toggle_row": true,
"transport_row": true
},
"tablet_layout": {
"5aaecf41-3455-4fa2-bef1-ca02f5933a69": {
"x": 2080,
"y": 60,
"w": 172,
"h": 945,
"hidden": false
},
"e2e8eb84-c2c9-4060-a818-b087ebd5aabd": {
"x": 333,
"y": 735,
"w": 131,
"h": 131,
"hidden": false
},
"1783a98d-16c9-4a06-ae4d-0f6ab36d4421": {
"x": 1400,
"y": 80,
"w": 172,
"h": 945,
"hidden": false
},
"2a1fcb50-b9f2-4c33-bce0-5bd5cadd9c46": {
"x": 637,
"y": 735,
"w": 131,
"h": 131,
"hidden": false
},
"fee53fde-2f59-4800-8873-3d75ca619366": {
"x": 1160,
"y": 120,
"w": 172,
"h": 945,
"hidden": false
},
"ae9cd47a-96af-45a4-83e6-816916a65e0e": {
"x": 2520,
"y": 60,
"w": 172,
"h": 945,
"hidden": false
},
"2a55bdef-83aa-458f-a37d-e12a61e3e6a0": {
"x": 1640,
"y": 80,
"w": 172,
"h": 945,
"hidden": false
},
"4208c3e3-c0b0-4c51-a426-be90568c904a": {
"x": 789,
"y": 735,
"w": 131,
"h": 131,
"hidden": false
},
"7a029b92-9cc0-4534-8657-6abe24c592e0": {
"x": 28,
"y": 887,
"w": 131,
"h": 131,
"hidden": false
},
"e8e8cca8-3bad-49a5-8c91-d3a78d25a1eb": {
"x": 2300,
"y": 60,
"w": 172,
"h": 945,
"hidden": false
},
"46f17f40-1bb2-4527-b6c5-fd26e535beed": {
"x": 28,
"y": 735,
"w": 131,
"h": 131,
"hidden": false
},
"14ec66c2-6a0a-418e-9240-776cb13f6e2e": {
"x": 1860,
"y": 60,
"w": 172,
"h": 945,
"hidden": false
},
"__big_title__": {
"x": 820,
"y": 100,
"w": 216,
"h": 216,
"hidden": false
},
"9ee09db7-2cf5-4ae6-a154-b25bb262565c": {
"x": 180,
"y": 735,
"w": 131,
"h": 131,
"hidden": false
},
"6b5bcaf7-1d01-4ccd-b23a-ebae8da57a7f": {
"x": 485,
"y": 735,
"w": 131,
"h": 131,
"hidden": false
}
}
},
"new preset browser shit": {
@@ -1001,7 +1236,7 @@
{
"uid": "21f875c2-d49e-484f-b0cd-5a9a5f89b0f9",
"label": "OFF",
"state": true,
"state": false,
"color": "White",
"zone": null,
"center_index": null,
@@ -1019,7 +1254,7 @@
{
"uid": "180759b7-e68b-4b8a-aa11-ee19d2a87fa3",
"label": "TOUCH",
"state": false,
"state": true,
"color": "Yellow",
"zone": null,
"center_index": null,
@@ -1037,7 +1272,7 @@
{
"uid": "5d9b7b3a-2429-4dd1-bcf2-043a6db9135d",
"label": "LISTEN",
"state": false,
"state": true,
"color": "Green",
"zone": null,
"center_index": null,
@@ -1055,7 +1290,7 @@
{
"uid": "0916bf53-ac82-4fb2-9842-835aea39e7d5",
"label": "ARM",
"state": true,
"state": false,
"color": "Red",
"zone": null,
"center_index": null,
@@ -1127,12 +1362,12 @@
{
"uid": "47a463c5-83c9-4e93-ace7-a488e0a20647",
"label": "Play",
"state": true,
"state": false,
"color": "Green",
"zone": null,
"center_index": null,
"zone_index": null,
"trigger_mode": "momentary",
"trigger_mode": "toggle",
"osc_addr_in": "/track/mute",
"osc_addr_out": "t/1/play",
"hardware_enabled": true,
@@ -1183,7 +1418,7 @@
{
"uid": "f61354e9-96f7-4826-975b-faea732c487c",
"label": "track name",
"text": "piano",
"text": "Track 2",
"color": "Gray",
"osc_addr_in": "/3/trackname",
"custom_enabled": false,
@@ -1192,7 +1427,7 @@
{
"uid": "8e77be47-8d5a-4eda-906e-db978cd2207e",
"label": "track number",
"text": "6",
"text": "2",
"color": "Gray",
"osc_addr_in": "/3/track#",
"custom_enabled": false,
@@ -1201,7 +1436,7 @@
{
"uid": "c97ec8c9-1b97-48f4-9744-62f8a2faec28",
"label": "fader val",
"text": "-7.13dB",
"text": "-4.42dB",
"color": "Gray",
"osc_addr_in": "/3/trkvolval",
"custom_enabled": false,
@@ -1210,7 +1445,7 @@
{
"uid": "28956bcf-b147-4e5b-a8c9-ec07d7be70e3",
"label": "time",
"text": "15:29.000",
"text": "1:37.930",
"color": "Gray",
"osc_addr_in": "/1/time",
"custom_enabled": false,
@@ -1219,7 +1454,7 @@
{
"uid": "0916a793-6adf-43b9-a2ea-8fca7ddafc57",
"label": "bar | beat",
"text": "465.3.00",
"text": "24.2.93",
"color": "Gray",
"osc_addr_in": "/3/bar",
"custom_enabled": false,
@@ -1228,7 +1463,7 @@
{
"uid": "7085f9f7-31dd-4214-9e4d-84b9618850ae",
"label": "Send 1 Val",
"text": "-10.3dB",
"text": "0.00dB",
"color": "Gray",
"osc_addr_in": "/3/sendval1",
"custom_enabled": false,
@@ -1256,11 +1491,11 @@
"focus_faders": [
{
"uid": "18558185-7cd4-4c2a-995e-4524e69d99e1",
"label": "piano",
"value": 73,
"label": "Track 2",
"value": 63,
"color": "Green",
"pickup": false,
"last_sent": 73,
"last_sent": 72,
"osc_addr_in": "/3/volume",
"osc_addr_out": "/3/volume",
"osc_addr_name": "/3/trackname",
@@ -1279,10 +1514,10 @@
{
"uid": "279a2c81-6548-422e-bf6d-75119c81b9c3",
"label": "2MX",
"value": 65,
"value": 90,
"color": "Gray",
"pickup": false,
"last_sent": 65,
"last_sent": 62,
"osc_addr_in": "/3/sendlevel1",
"osc_addr_out": "/3/sendlevel1",
"osc_addr_name": "/track/name",
@@ -1301,10 +1536,10 @@
{
"uid": "8de2c4e9-2f05-4a71-a610-d712ee69d1a1",
"label": "Envelope Adjust",
"value": 45,
"value": 71,
"color": "Gray",
"pickup": false,
"last_sent": 45,
"last_sent": 71,
"osc_addr_in": "/track/volume",
"osc_addr_out": "/track/volume",
"osc_addr_name": "/track/name",
-1
View File
@@ -1 +0,0 @@
build/
-63
View File
@@ -1,63 +0,0 @@
#define REAPERAPI_MINIMAL
#define REAPERAPI_WANT_ShowConsoleMsg
#include "reaper_plugin.h"
#include "reaper_plugin_functions.h"
#include <cstdio>
static bool isOurAction;
static bool handled;
static int helloActionId = 0;
static const char *kHelloActionIdStr = "EXTENSION_REAPER_MACOS_HELLO";
static const char *kHelloActionName = "Hello Action List Display Name";
static bool HelloAction(KbdSectionInfo *sec, int command, int val, int val2, int relmode, HWND hwnd);
void RegisterHello(reaper_plugin_info_t *rec)
{
custom_action_register_t actionDescription = {
0,
kHelloActionIdStr,
kHelloActionName,
NULL,
};
helloActionId = rec->Register("custom_action", &actionDescription);
char buf[128];
snprintf(buf, sizeof(buf), "[extension-reaper-macos] helloActionId = %d\n", helloActionId);
ShowConsoleMsg(buf);
rec->Register("hookcommand2", (void *)HelloAction);
}
static void PerformHelloAction()
{
ShowConsoleMsg("[extension-reaper-macos] Hello action triggered\n");
}
static void RunHelloActionLogic(int command)
{
char buf[128];
snprintf(buf, sizeof(buf), "[extension-reaper-macos] HelloAction called: command=%d helloActionId=%d\n", command, helloActionId);
ShowConsoleMsg(buf);
isOurAction = (command == helloActionId);
if (isOurAction == true)
{
PerformHelloAction();
handled = true;
return;
}
ShowConsoleMsg("[extension-reaper-macos] ignored — not ours\n");
handled = false;
}
static bool HelloAction(KbdSectionInfo *sec, int command, int val, int val2, int relmode, HWND hwnd)
{
RunHelloActionLogic(command);
return handled;
}
+6
View File
@@ -0,0 +1,6 @@
build-mac/output/
build-win/output/
*.obj
*.exp
*.lib
*.pdb
+10 -10
View File
@@ -1,10 +1,10 @@
#!/bin/sh
# Builds extension-reaper-macos as a REAPER extension .dylib.
# Builds extension-reaper as a REAPER extension .dylib.
set -e
cd "$(dirname "$0")"
NAME="reaper_extension-reaper-macos.dylib"
OUT_DIR="build/macos"
NAME="reaper_extension-reaper.dylib"
OUT_DIR="output"
OUT="$OUT_DIR/$NAME"
mkdir -p "$OUT_DIR"
@@ -14,14 +14,14 @@ clang++ \
-fvisibility=hidden \
-dynamiclib \
-arch arm64 \
-Ivendor/reaper-sdk/sdk \
-Ivendor/reaper-sdk/WDL \
-Isrc \
-I../vendor/reaper-sdk/sdk \
-I../vendor/reaper-sdk/WDL \
-I../src \
-o "$OUT" \
src/main.cpp \
src/hello/hello.cpp \
src/tracking/tracking.cpp \
src/socket/socket.cpp
../src/main.cpp \
../src/hello/hello.cpp \
../src/tracking/tracking.cpp \
../src/socket/socket.cpp
echo "Built $OUT"
+50
View File
@@ -0,0 +1,50 @@
# Builds extension-reaper as a REAPER extension .dll.
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
$Name = "reaper_extension-reaper.dll"
$OutDir = "output"
New-Item -ItemType Directory -Force -Path $OutDir | Out-Null
# Locate the MSVC toolchain and import its dev environment, so this script
# runs from a plain PowerShell session instead of requiring a "Developer
# PowerShell for VS" shell.
$vswhere = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path $vswhere)) {
throw "vswhere.exe not found - install Visual Studio Build Tools (C++ workload) first."
}
$installPath = & $vswhere -latest -products "*" -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (-not $installPath) {
throw "No MSVC C++ toolchain found via vswhere - install Visual Studio Build Tools (C++ workload) first."
}
$vcvarsall = Join-Path $installPath "VC\Auxiliary\Build\vcvarsall.bat"
$envDump = cmd /c "`"$vcvarsall`" x64 && set"
foreach ($line in $envDump) {
if ($line -match "^([^=]+)=(.*)$") {
Set-Item -Path "Env:$($Matches[1])" -Value $Matches[2]
}
}
cl.exe `
/std:c++17 `
/EHsc `
/LD `
/I ..\vendor\reaper-sdk\sdk `
/I ..\vendor\reaper-sdk\WDL `
/I ..\src `
/Fo"$OutDir\" `
/Fe"$OutDir\$Name" `
..\src\main.cpp `
..\src\hello\hello.cpp `
..\src\tracking\tracking.cpp `
..\src\socket\socket.cpp `
/link ws2_32.lib
Write-Output "Built $OutDir\$Name"
$Dest = Join-Path $env:APPDATA "REAPER\UserPlugins\$Name"
Copy-Item -Path "$OutDir\$Name" -Destination $Dest -Force
Write-Output "Copied to $Dest (restart REAPER to reload)"
@@ -11,7 +11,7 @@ static bool isOurAction;
static bool handled;
static int helloActionId = 0;
static const char *kHelloActionIdStr = "EXTENSION_REAPER_MACOS_HELLO";
static const char *kHelloActionIdStr = "EXTENSION_REAPER_HELLO";
static const char *kHelloActionName = "Hello Action List Display Name";
static bool HelloAction(KbdSectionInfo *sec, int command, int val, int val2, int relmode, HWND hwnd);
@@ -30,7 +30,7 @@ void RegisterHello(reaper_plugin_info_t *rec)
helloActionId = rec->Register("custom_action", &actionDescription);
char buf[128];
snprintf(buf, sizeof(buf), "[extension-reaper-macos] helloActionId = %d\n", helloActionId);
snprintf(buf, sizeof(buf), "[extension-reaper] helloActionId = %d\n", helloActionId);
ShowConsoleMsg(buf);
rec->Register("hookcommand2", (void *)HelloAction);
@@ -46,7 +46,7 @@ static bool HelloAction(KbdSectionInfo *sec, int command, int val, int val2, int
static void HandleHelloAction(int command)
{
char buf[128];
snprintf(buf, sizeof(buf), "[extension-reaper-macos] HelloAction called: command=%d helloActionId=%d\n", command, helloActionId);
snprintf(buf, sizeof(buf), "[extension-reaper] HelloAction called: command=%d helloActionId=%d\n", command, helloActionId);
ShowConsoleMsg(buf);
isOurAction = (command == helloActionId);
@@ -58,13 +58,13 @@ static void HandleHelloAction(int command)
return;
}
ShowConsoleMsg("[extension-reaper-macos] ignored — not ours\n");
ShowConsoleMsg("[extension-reaper] ignored — not ours\n");
handled = false;
}
//step 4 perform action
static void RunHelloAction()
{
ShowConsoleMsg("[extension-reaper-macos] Hello action triggered\n");
ShowConsoleMsg("[extension-reaper] Hello action triggered\n");
}
@@ -3,8 +3,8 @@
// end. Kept around as a working reference, not load-bearing for the real
// feature.
#ifndef EXTENSION_REAPER_MACOS_HELLO_H
#define EXTENSION_REAPER_MACOS_HELLO_H
#ifndef EXTENSION_REAPER_HELLO_H
#define EXTENSION_REAPER_HELLO_H
#include "reaper_plugin.h"
@@ -1,4 +1,4 @@
// extension-reaper-macos — REAPER extension entry point.
// extension-reaper — REAPER extension entry point.
//
// This file's only job: establish REAPER_PLUGIN_ENTRYPOINT (the one
// function name REAPER looks for), do the required load/unload/version
@@ -62,7 +62,7 @@ extern "C" REAPER_PLUGIN_DLL_EXPORT int REAPER_PLUGIN_ENTRYPOINT(REAPER_PLUGIN_H
RegisterActions(rec);
// Prove we got this far — but NOT proof any individual module works.
ShowConsoleMsg("[extension-reaper-macos] loaded successfully\n");
ShowConsoleMsg("[extension-reaper] loaded successfully\n");
return kLoadedSuccessfully;
}
@@ -10,6 +10,24 @@
// baseline, via the same NudgeSelectedBaseline tracking.cpp's manual
// actions already use.
// Winsock2 must be included before windows.h (pulled in transitively by
// reaper_plugin.h below) — windows.h drags in the legacy winsock.h unless
// winsock2.h has already set its include guard, and the two can't coexist
// in one translation unit.
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
typedef SOCKET socket_t;
static const socket_t kInvalidSocket = INVALID_SOCKET;
#else
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <fcntl.h>
typedef int socket_t;
static const socket_t kInvalidSocket = -1;
#endif
// No REAPERAPI_IMPLEMENT here — main.cpp owns the real storage.
#define REAPERAPI_MINIMAL
#define REAPERAPI_WANT_ShowConsoleMsg
@@ -22,17 +40,13 @@
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <fcntl.h>
static const int kListenPort = 9124;
static int listen_fd = -1;
static socket_t listen_fd = kInvalidSocket;
static void OnSocketTimer()
{
if (listen_fd < 0)
if (listen_fd == kInvalidSocket)
return;
// Drain every pending packet each tick, instead of one recvfrom() per
@@ -44,7 +58,11 @@ static void OnSocketTimer()
// individually — just one REAPER API call instead of many.
double total_delta = 0.0;
char data[256];
#ifdef _WIN32
int n;
#else
ssize_t n;
#endif
while ((n = recvfrom(listen_fd, data, sizeof(data) - 1, 0, NULL, NULL)) > 0)
{
data[n] = '\0';
@@ -61,16 +79,30 @@ static void OnSocketTimer()
void RegisterSocket(reaper_plugin_info_t *rec)
{
listen_fd = socket(AF_INET, SOCK_DGRAM, 0);
if (listen_fd < 0)
#ifdef _WIN32
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
{
ShowConsoleMsg("[extension-reaper-macos] socket() failed\n");
ShowConsoleMsg("[extension-reaper] WSAStartup() failed\n");
return;
}
#endif
listen_fd = socket(AF_INET, SOCK_DGRAM, 0);
if (listen_fd == kInvalidSocket)
{
ShowConsoleMsg("[extension-reaper] socket() failed\n");
return;
}
// Non-blocking — recvfrom() returns immediately if nothing's arrived,
// instead of stalling REAPER's main thread waiting for data.
#ifdef _WIN32
u_long mode = 1;
ioctlsocket(listen_fd, FIONBIO, &mode);
#else
fcntl(listen_fd, F_SETFL, O_NONBLOCK);
#endif
sockaddr_in addr;
memset(&addr, 0, sizeof(addr));
@@ -80,14 +112,18 @@ void RegisterSocket(reaper_plugin_info_t *rec)
if (bind(listen_fd, (sockaddr *)&addr, sizeof(addr)) < 0)
{
ShowConsoleMsg("[extension-reaper-macos] socket bind() failed\n");
ShowConsoleMsg("[extension-reaper] socket bind() failed\n");
#ifdef _WIN32
closesocket(listen_fd);
#else
close(listen_fd);
listen_fd = -1;
#endif
listen_fd = kInvalidSocket;
return;
}
char buf[128];
snprintf(buf, sizeof(buf), "[extension-reaper-macos] socket listening on 127.0.0.1:%d\n", kListenPort);
snprintf(buf, sizeof(buf), "[extension-reaper] socket listening on 127.0.0.1:%d\n", kListenPort);
ShowConsoleMsg(buf);
rec->Register("timer", (void *)OnSocketTimer);
@@ -1,8 +1,8 @@
// A basic UDP socket listener for extension-reaper-macos — the eventual
// A basic UDP socket listener for extension-reaper — the eventual
// entry point for the desktop app to spray fader/control data at REAPER.
#ifndef EXTENSION_REAPER_MACOS_SOCKET_H
#define EXTENSION_REAPER_MACOS_SOCKET_H
#ifndef EXTENSION_REAPER_SOCKET_H
#define EXTENSION_REAPER_SOCKET_H
#include "reaper_plugin.h"
@@ -88,7 +88,7 @@ static void OnTimer()
last_printed_items = items;
char buf[128];
snprintf(buf, sizeof(buf), "[extension-reaper-macos] %zu item(s) selected\n", items.size());
snprintf(buf, sizeof(buf), "[extension-reaper] %zu item(s) selected\n", items.size());
ShowConsoleMsg(buf);
}
}
@@ -102,7 +102,7 @@ void NudgeSelectedBaseline(double delta)
std::vector<SelectedItem> items = FindAllSelectedItems();
if (items.empty())
{
ShowConsoleMsg("[extension-reaper-macos] nudge: nothing selected\n");
ShowConsoleMsg("[extension-reaper] nudge: nothing selected\n");
return;
}
@@ -138,16 +138,16 @@ void RegisterTracking(reaper_plugin_info_t *rec)
custom_action_register_t nudge_up_desc = {
0,
"EXTENSION_REAPER_MACOS_NUDGE_UP",
"extension-reaper-macos: Nudge baseline up",
"EXTENSION_REAPER_NUDGE_UP",
"extension-reaper: Nudge baseline up",
NULL,
};
nudge_up_id = rec->Register("custom_action", &nudge_up_desc);
custom_action_register_t nudge_down_desc = {
0,
"EXTENSION_REAPER_MACOS_NUDGE_DOWN",
"extension-reaper-macos: Nudge baseline down",
"EXTENSION_REAPER_NUDGE_DOWN",
"extension-reaper: Nudge baseline down",
NULL,
};
nudge_down_id = rec->Register("custom_action", &nudge_down_desc);
@@ -1,8 +1,8 @@
// Polls REAPER for the currently selected envelope + automation item, since
// REAPER has no "selection changed" notification to hook directly.
#ifndef EXTENSION_REAPER_MACOS_TRACKING_H
#define EXTENSION_REAPER_MACOS_TRACKING_H
#ifndef EXTENSION_REAPER_TRACKING_H
#define EXTENSION_REAPER_TRACKING_H
#include "reaper_plugin.h"

Some files were not shown because too many files have changed in this diff Show More