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
f9c88ca6
Commit
f9c88ca6
authored
6 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Disable bad ui state code
Just listen for the knob input ports in the UI plugin too.
parent
7e50ba3f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
plugin/hydrumkit.ttl
+2
-3
2 additions, 3 deletions
plugin/hydrumkit.ttl
plugin/plugin.c
+2
-0
2 additions, 0 deletions
plugin/plugin.c
plugin/ui.c
+33
-11
33 additions, 11 deletions
plugin/ui.c
with
37 additions
and
14 deletions
plugin/hydrumkit.ttl
+
2
−
3
View file @
f9c88ca6
...
...
@@ -117,10 +117,9 @@
lv2:
index
8
;
lv2:
symbol
"hu_latency_regain"
;
lv2:
name
"Humanizer Latency Regain"
;
lv2:
default
0
.0
;
lv2:
default
1
.0
;
lv2:
minimum
0.0
;
lv2:
maximum
100.0
;
units:
unit
units:
ms
;
lv2:
maximum
1.0
;
]
,
[
a
lv2:
InputPort
,
lv2:
ControlPort
;
...
...
This diff is collapsed.
Click to expand it.
plugin/plugin.c
+
2
−
0
View file @
f9c88ca6
...
...
@@ -278,6 +278,7 @@ static void run(LV2_Handle instance, uint32_t sample_count) {
if
(
plugin
->
send_settings_to_ui
)
{
plugin
->
send_settings_to_ui
=
0
;
#if 0
// Forge container object of type 'ui_state'
LV2_Atom_Forge_Frame frame;
lv2_atom_forge_frame_time(&plugin->forge, 0);
...
...
@@ -295,6 +296,7 @@ static void run(LV2_Handle instance, uint32_t sample_count) {
lv2_atom_forge_key(&plugin->forge, plugin->uris.ui_hu_velocity_stddev);
lv2_atom_forge_float(&plugin->forge, plugin->hsettings.velocity_stddev);
lv2_atom_forge_pop(&plugin->forge, &frame);
#endif
}
// Incrementally process control events and render audio data.
...
...
This diff is collapsed.
Click to expand it.
plugin/ui.c
+
33
−
11
View file @
f9c88ca6
...
...
@@ -111,17 +111,17 @@ static void on_load_dialog_response(GtkDialog *widget, gint response, void *hand
};
}
#define WRITECONTROLVALUE(
va
r, port) \
val = ui->humanize_enabled ?
ui-> va
r : 0; \
#define WRITECONTROLVALUE(
exp
r, port) \
val = ui->humanize_enabled ?
exp
r : 0; \
ui->write(ui->controller, port, sizeof(float), 0, (const void *)&val)
static
void
write_control_values
(
struct
plugin_ui
*
ui
)
{
float
val
;
WRITECONTROLVALUE
(
humanize_latency_max_value
,
PORT_HUMANIZE_LATENCY_MAX
);
WRITECONTROLVALUE
(
humanize_latency_stddev_value
,
PORT_HUMANIZE_LATENCY_STDDEV
);
WRITECONTROLVALUE
(
humanize_latency_laid_back_value
,
PORT_HUMANIZE_LATENCY_LAID_BACK
);
WRITECONTROLVALUE
(
humanize_latency_regain_value
,
PORT_HUMANIZE_LATENCY_REGAIN
);
WRITECONTROLVALUE
(
humanize_velocity_stddev_value
,
PORT_HUMANIZE_VELOCITY_STDDEV
);
WRITECONTROLVALUE
(
ui
->
humanize_latency_max_value
*
400
.
0
,
PORT_HUMANIZE_LATENCY_MAX
);
WRITECONTROLVALUE
(
ui
->
humanize_latency_stddev_value
*
100
.
0
,
PORT_HUMANIZE_LATENCY_STDDEV
);
WRITECONTROLVALUE
(
ui
->
humanize_latency_laid_back_value
*
100
.
0
,
PORT_HUMANIZE_LATENCY_LAID_BACK
);
WRITECONTROLVALUE
(
ui
->
humanize_latency_regain_value
,
PORT_HUMANIZE_LATENCY_REGAIN
);
WRITECONTROLVALUE
(
ui
->
humanize_velocity_stddev_value
,
PORT_HUMANIZE_VELOCITY_STDDEV
);
}
static
void
on_humanize_button_click
(
GtkButton
*
widget
,
void
*
handle
)
{
...
...
@@ -283,6 +283,7 @@ static void cleanup(LV2UI_Handle handle) {
}
static
int
recv_ui_state
(
struct
plugin_ui
*
ui
,
const
LV2_Atom_Object
*
obj
)
{
#if 0
const LV2_Atom *hu_latency_max_val = NULL;
const LV2_Atom *hu_latency_stddev_val = NULL;
const LV2_Atom *hu_latency_laidback_val = NULL;
...
...
@@ -307,9 +308,9 @@ static int recv_ui_state(struct plugin_ui *ui, const LV2_Atom_Object *obj) {
}
// Get the values we need from the body of the property value atoms.
ui
->
humanize_latency_max_value
=
((
const
LV2_Atom_Float
*
)
hu_latency_max_val
)
->
body
;
ui
->
humanize_latency_stddev_value
=
((
const
LV2_Atom_Float
*
)
hu_latency_stddev_val
)
->
body
;
ui
->
humanize_latency_laid_back_value
=
((
const
LV2_Atom_Float
*
)
hu_latency_laidback_val
)
->
body
;
ui->humanize_latency_max_value =
400 *
((const LV2_Atom_Float *)hu_latency_max_val)->body;
ui->humanize_latency_stddev_value =
100 *
((const LV2_Atom_Float *)hu_latency_stddev_val)->body;
ui->humanize_latency_laid_back_value =
100 *
((const LV2_Atom_Float *)hu_latency_laidback_val)->body;
ui->humanize_latency_regain_value = ((const LV2_Atom_Float *)hu_latency_regain_val)->body;
ui->humanize_velocity_stddev_value = ((const LV2_Atom_Float *)hu_velocity_stddev_val)->body;
...
...
@@ -326,6 +327,7 @@ static int recv_ui_state(struct plugin_ui *ui, const LV2_Atom_Object *obj) {
gtk_widget_queue_draw(ui->humanize_latency_laid_back_knob);
gtk_widget_queue_draw(ui->humanize_latency_regain_knob);
gtk_widget_queue_draw(ui->humanize_velocity_stddev_knob);
#endif
return
1
;
}
...
...
@@ -351,7 +353,7 @@ static void port_event(LV2UI_Handle handle, uint32_t port_index,
const
void
*
buffer
)
{
struct
plugin_ui
*
ui
=
(
struct
plugin_ui
*
)
handle
;
if
(
format
==
ui
->
uris
.
atom_eventTransfer
)
{
if
(
format
==
ui
->
uris
.
atom_eventTransfer
&&
port_index
==
PORT_NOTIFY
)
{
const
LV2_Atom
*
atom
=
(
const
LV2_Atom
*
)
buffer
;
if
(
lv2_atom_forge_is_object_type
(
&
ui
->
forge
,
atom
->
type
))
{
const
LV2_Atom_Object
*
obj
=
(
const
LV2_Atom_Object
*
)
atom
;
...
...
@@ -376,6 +378,26 @@ static void port_event(LV2UI_Handle handle, uint32_t port_index,
}
else
{
lv2_log_error
(
&
ui
->
logger
,
"Unknown message type
\n
"
);
}
}
else
if
(
port_index
==
PORT_HUMANIZE_LATENCY_MAX
)
{
float
val
=
*
(
float
*
)
buffer
;
ui
->
humanize_latency_max_value
=
val
/
400
.
0
;
gtk_widget_queue_draw
(
ui
->
humanize_latency_max_knob
);
}
else
if
(
port_index
==
PORT_HUMANIZE_LATENCY_STDDEV
)
{
float
val
=
*
(
float
*
)
buffer
;
ui
->
humanize_latency_stddev_value
=
val
/
100
.
0
;
gtk_widget_queue_draw
(
ui
->
humanize_latency_stddev_knob
);
}
else
if
(
port_index
==
PORT_HUMANIZE_LATENCY_LAID_BACK
)
{
float
val
=
*
(
float
*
)
buffer
;
ui
->
humanize_latency_laid_back_value
=
val
/
100
.
0
;
gtk_widget_queue_draw
(
ui
->
humanize_latency_laid_back_knob
);
}
else
if
(
port_index
==
PORT_HUMANIZE_LATENCY_REGAIN
)
{
float
val
=
*
(
float
*
)
buffer
;
ui
->
humanize_latency_max_value
=
val
;
gtk_widget_queue_draw
(
ui
->
humanize_latency_max_knob
);
}
else
if
(
port_index
==
PORT_HUMANIZE_VELOCITY_STDDEV
)
{
float
val
=
*
(
float
*
)
buffer
;
ui
->
humanize_velocity_stddev_value
=
val
;
gtk_widget_queue_draw
(
ui
->
humanize_velocity_stddev_knob
);
}
else
{
lv2_log_warning
(
&
ui
->
logger
,
"Unknown port event format
\n
"
);
}
...
...
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