Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
motion_bridge.h
Go to the documentation of this file.
1// motion_bridge.h — C ABI for the Android JNI motion bridge.
2//
3// Declares the `pulp_motion_*` C entry points implemented in
4// `core/view/platform/android/jni_motion.cpp`. The Kotlin facade in
5// `com.pulp.motion.PulpMotionNative` reaches these via `external fun`
6// (through the matching `Java_com_pulp_motion_PulpMotionNative_*` JNI
7// shims). The C symbols are also reachable directly from C/C++ tests
8// (`test/test_motion_android_bridge.cpp`) so we can exercise the
9// bridge logic without an NDK build.
10//
11// The signatures intentionally mirror `apple/Sources/PulpSwift/PulpBridge.h`
12// — same shapes, same order, no timestamp argument. See the file-level
13// comment in `jni_motion.cpp` for the deadlock-safety rationale on
14// register/detach.
15
16#pragma once
17
18#include <stdbool.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
27
31void pulp_motion_publish_value(const char* view,
32 const char* metric,
33 double value,
34 double epsilon,
35 int precision);
36
40void pulp_motion_publish_components(const char* view,
41 const char* metric,
42 const char* const* keys,
43 const double* values,
44 int count,
45 double epsilon,
46 int precision);
47
50 const char* id,
51 const char* file,
52 int line);
53
56
60int pulp_motion_register_geometry_trace(const char* view_name, int fps);
61
67 const char* metric_name,
68 double minX,
69 double minY,
70 double width,
71 double height);
72
75void pulp_motion_detach_trace(int trace_id);
76
77#ifdef __cplusplus
78}
79#endif
void pulp_motion_clear_ambient_provenance(void)
Clear the ambient provenance slot.
void pulp_motion_detach_trace(int trace_id)
Detach a trace previously registered via pulp_motion_register_geometry_trace.
bool pulp_motion_tracing_enabled(void)
True when motion::Coordinator::tracing_enabled() is true.
int pulp_motion_register_geometry_trace(const char *view_name, int fps)
Register a geometry trace for view_name.
void pulp_motion_publish_components(const char *view, const char *metric, const char *const *keys, const double *values, int count, double epsilon, int precision)
Multi-component publish (mirrors motion::publish_components).
void pulp_motion_publish_value(const char *view, const char *metric, double value, double epsilon, int precision)
Single-scalar publish (mirrors motion::publish_value).
void pulp_motion_update_geometry(int trace_id, const char *metric_name, double minX, double minY, double width, double height)
Push a new geometry frame for a previously registered trace.
void pulp_motion_set_ambient_provenance(const char *kind, const char *id, const char *file, int line)
Set the process-wide ambient provenance envelope.