Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hydrumkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ale
hydrumkit
Commits
1cfee8c1
Commit
1cfee8c1
authored
6 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Export LV2 plugin latency over a control port
parent
fca90104
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugin/hydrumkit.ttl
+11
-0
11 additions, 0 deletions
plugin/hydrumkit.ttl
plugin/plugin.c
+9
-0
9 additions, 0 deletions
plugin/plugin.c
with
20 additions
and
0 deletions
plugin/hydrumkit.ttl
+
11
−
0
View file @
1cfee8c1
...
...
@@ -5,6 +5,7 @@
@prefix
rdfs:
<http://www.w3.org/2000/01/rdf-schema#>
.
@prefix
state:
<http://lv2plug.in/ns/ext/state#>
.
@prefix
ui:
<http://lv2plug.in/ns/extensions/ui#>
.
@prefix
units:
<http://lv2plug.in/ns/extensions/units#>
.
@prefix
urid:
<http://lv2plug.in/ns/ext/urid#>
.
@prefix
work:
<http://lv2plug.in/ns/ext/worker#>
.
@prefix
param:
<http://lv2plug.in/ns/ext/parameters#>
.
...
...
@@ -70,6 +71,16 @@
pg:
group
<http://lv2.incal.net/plugins/hydrumkit/out>
;
pg:
role
pg:
rightChannel
]
]
,
[
a
lv2:
OutputPort
,
lv2:
ControlPort
;
lv2:
index
4
;
lv2:
symbol
"latency"
;
lv2:
name
"latency"
;
lv2:
minimum
0
;
lv2:
maximum
192000
;
lv2:
portProperty
lv2:
reportsLatency,
lv2:
integer
;
units:
unit
units:
frame
;
];
state:
state
[
<http://lv2.incal.net/plugins/hydrumkit#drumkit>
<none>
...
...
This diff is collapsed.
Click to expand it.
plugin/plugin.c
+
9
−
0
View file @
1cfee8c1
...
...
@@ -28,6 +28,7 @@
#define SAMPLER_NOTIFY 1
#define SAMPLER_OUT_L 2
#define SAMPLER_OUT_R 3
#define SAMPLER_LATENCY 4
#define NUM_VOICES 64
...
...
@@ -40,6 +41,7 @@ struct sampler_plugin {
LV2_Atom_Sequence
*
notify_port
;
float
*
output_port_l
;
float
*
output_port_r
;
float
*
output_latency
;
LV2_Atom_Forge_Frame
notify_frame
;
LV2_Atom_Forge
forge
;
...
...
@@ -138,6 +140,9 @@ static void connect_port(LV2_Handle instance, uint32_t port, void *data) {
case
SAMPLER_OUT_R
:
plugin
->
output_port_r
=
(
float
*
)
data
;
break
;
case
SAMPLER_LATENCY
:
plugin
->
output_latency
=
(
float
*
)
data
;
break
;
default:
break
;
}
...
...
@@ -266,6 +271,10 @@ static void run(LV2_Handle instance, uint32_t sample_count) {
}
render
(
plugin
,
plugin
->
frame_offset
,
sample_count
);
if
(
plugin
->
output_latency
)
{
*
(
plugin
->
output_latency
)
=
(
float
)
sampler_get_latency
(
plugin
->
sampler
);
}
}
static
LV2_State_Status
save
(
LV2_Handle
instance
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment