diff options
-rw-r--r-- | src/jack.c | 7 | ||||
-rw-r--r-- | src/jalv.c | 30 | ||||
-rw-r--r-- | src/jalv_internal.h | 4 | ||||
-rw-r--r-- | wscript | 5 |
4 files changed, 20 insertions, 26 deletions
@@ -107,13 +107,12 @@ jack_process_cb(jack_nframes_t nframes, void* data) } if (jalv->opts.dump) { - char* str = sratom_to_turtle( - jalv->sratom, &jalv->unmap, "time:", NULL, NULL, - lv2_pos->type, lv2_pos->size, LV2_ATOM_BODY(lv2_pos)); + char* str = sratom_to_string( + jalv->sratom, jalv->env, lv2_pos, SRATOM_PRETTY_NUMBERS); jalv_ansi_start(stdout, 36); printf("\n## Position ##\n%s\n", str); jalv_ansi_reset(stdout); - free(str); + sratom_free(str); } } @@ -482,13 +482,12 @@ jalv_ui_write(void* const jalv_handle, if (jalv->opts.dump && protocol == jalv->urids.atom_eventTransfer) { const LV2_Atom* atom = (const LV2_Atom*)buffer; - char* str = sratom_to_turtle( - jalv->sratom, &jalv->unmap, "jalv:", NULL, NULL, - atom->type, atom->size, LV2_ATOM_BODY_CONST(atom)); + char* str = sratom_to_string( + jalv->sratom, jalv->env, atom, SRATOM_PRETTY_NUMBERS); jalv_ansi_start(stdout, 36); printf("\n## UI => Plugin (%u bytes) ##\n%s\n", atom->size, str); jalv_ansi_reset(stdout); - free(str); + sratom_free(str); } char buf[sizeof(ControlChange) + buffer_size]; @@ -658,9 +657,8 @@ jalv_update(Jalv* jalv) if (jalv->opts.dump && ev.protocol == jalv->urids.atom_eventTransfer) { /* Dump event in Turtle to the console */ LV2_Atom* atom = (LV2_Atom*)buf; - char* str = sratom_to_turtle( - jalv->ui_sratom, &jalv->unmap, "jalv:", NULL, NULL, - atom->type, atom->size, LV2_ATOM_BODY(atom)); + char* str = sratom_to_string( + jalv->ui_sratom, jalv->env, atom, SRATOM_PRETTY_NUMBERS); jalv_ansi_start(stdout, 35); printf("\n## Plugin => UI (%u bytes) ##\n%s\n", atom->size, str); jalv_ansi_reset(stdout); @@ -772,17 +770,13 @@ jalv_open(Jalv* const jalv, int* argc, char*** argv) lv2_atom_forge_init(&jalv->forge, &jalv->map); jalv->env = serd_env_new(NULL); - serd_env_set_prefix_from_strings( - jalv->env, (const uint8_t*)"patch", (const uint8_t*)LV2_PATCH_PREFIX); - serd_env_set_prefix_from_strings( - jalv->env, (const uint8_t*)"time", (const uint8_t*)LV2_TIME_PREFIX); - serd_env_set_prefix_from_strings( - jalv->env, (const uint8_t*)"xsd", (const uint8_t*)NS_XSD); - - jalv->sratom = sratom_new(&jalv->map); - jalv->ui_sratom = sratom_new(&jalv->map); - sratom_set_env(jalv->sratom, jalv->env); - sratom_set_env(jalv->ui_sratom, jalv->env); + serd_env_set_prefix_from_strings(jalv->env, "patch", LV2_PATCH_PREFIX); + serd_env_set_prefix_from_strings(jalv->env, "time", LV2_TIME_PREFIX); + serd_env_set_prefix_from_strings(jalv->env, "xsd", NS_XSD); + + SerdWorld* serd_world = serd_world_new(); // FIXME + jalv->sratom = sratom_streamer_new(serd_world, &jalv->map, &jalv->unmap); + jalv->ui_sratom = sratom_streamer_new(serd_world, &jalv->map, &jalv->unmap); jalv->urids.atom_Float = symap_map(jalv->symap, LV2_ATOM__Float); jalv->urids.atom_Int = symap_map(jalv->symap, LV2_ATOM__Int); diff --git a/src/jalv_internal.h b/src/jalv_internal.h index 4d25109..827ac7e 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -291,8 +291,8 @@ struct Jalv { LV2_URID_Map map; ///< URI => Int map LV2_URID_Unmap unmap; ///< Int => URI map SerdEnv* env; ///< Environment for RDF printing - Sratom* sratom; ///< Atom serialiser - Sratom* ui_sratom; ///< Atom serialiser for UI thread + SratomStreamer* sratom; ///< Atom serialiser + SratomStreamer* ui_sratom; ///< Atom serialiser for UI thread Symap* symap; ///< URI map ZixSem symap_lock; ///< Lock for URI map JalvBackend* backend; ///< Audio system backend @@ -44,9 +44,10 @@ def configure(conf): conf.check_pkg('lv2 >= 1.16.0', uselib_store='LV2') conf.check_pkg('lilv-0 >= 0.24.0', uselib_store='LILV') - conf.check_pkg('serd-0 >= 0.24.0', uselib_store='SERD') + conf.check_pkg('serd-1 >= 1.0.0', uselib_store='SERD') conf.check_pkg('sord-0 >= 0.14.0', uselib_store='SORD') - conf.check_pkg('sratom-0 >= 0.6.0', uselib_store='SRATOM') + conf.check_pkg('sratom-1 >= 1.0.0', uselib_store='SRATOM') + if Options.options.portaudio: conf.check_pkg('portaudio-2.0 >= 2.0.0', uselib_store='PORTAUDIO', mandatory=False) |