summaryrefslogtreecommitdiff
path: root/libs/plugins
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-09-08 19:30:16 +0200
committerRobin Gareus <robin@gareus.org>2017-09-08 23:35:00 +0200
commitb7227415ad70a2fd35344f783dcbdc9104d23c36 (patch)
tree934128c343b57c1130a8c091198dfa11b0987f2f /libs/plugins
parentba7bbd1d51ff97af0572bfccfa9ffb3fd2a1cdbd (diff)
a-fluidsynth mark session as modified if .sf2 changes
Diffstat (limited to 'libs/plugins')
-rw-r--r--libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc
index e80875006d..0a7b501c04 100644
--- a/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc
+++ b/libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc
@@ -125,6 +125,7 @@ typedef struct {
LV2_URID patch_Set;
LV2_URID patch_property;
LV2_URID patch_value;
+ LV2_URID state_Changed;
LV2_URID afs_sf2file;
/* lv2 extensions */
@@ -384,6 +385,7 @@ instantiate (const LV2_Descriptor* descriptor,
self->patch_Set = map->map (map->handle, LV2_PATCH__Set);
self->patch_property = map->map (map->handle, LV2_PATCH__property);
self->patch_value = map->map (map->handle, LV2_PATCH__value);
+ self->state_Changed = map->map (map->handle, "http://lv2plug.in/ns/ext/state#StateChanged");
self->afs_sf2file = map->map (map->handle, AFS_URN ":sf2file");
return (LV2_Handle)self;
@@ -555,7 +557,6 @@ run (LV2_Handle instance, uint32_t n_samples)
}
#endif
}
-
fluid_synth_handle_midi_event (self->synth, self->fmidi_event);
}
}
@@ -569,7 +570,16 @@ run (LV2_Handle instance, uint32_t n_samples)
/* inform the GUI */
if (self->inform_ui) {
self->inform_ui = false;
+
+ /* emit stateChanged */
+ LV2_Atom_Forge_Frame frame;
+ lv2_atom_forge_frame_time(&self->forge, 0);
+ x_forge_object(&self->forge, &frame, 1, self->state_Changed);
+ lv2_atom_forge_pop(&self->forge, &frame);
+
+ /* send .sf2 filename */
inform_ui (self);
+
#ifdef LV2_EXTENDED
self->midnam->update (self->midnam->handle);
#endif