Mercurial > hg > piper-vamp-js
changeset 114:c14520102b46
Update native-code example for Piper
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Thu, 13 Oct 2016 14:37:15 +0100 |
parents | 00221fb5b9d2 |
children | 6db821ba39ab |
files | Makefile.example.linux piper.map quick-test.cpp vampipe.map |
diffstat | 4 files changed, 12 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile.example.linux Tue Oct 11 14:37:12 2016 +0100 +++ b/Makefile.example.linux Thu Oct 13 14:37:15 2016 +0100 @@ -1,8 +1,9 @@ -ADAPTER_HEADERS := VamPipeAdapter.h VamPipePluginLibrary.h -ADAPTER_SOURCES := VamPipePluginLibrary.cpp +ADAPTER_HEADERS := PiperAdapter.h PiperPluginLibrary.h +ADAPTER_SOURCES := PiperPluginLibrary.cpp SDK_DIR := ../vamp-plugin-sdk +PIPERCPP_DIR := ../piper-cpp PLUGIN_SOURCES := \ $(SDK_DIR)/examples/ZeroCrossing.cpp \ @@ -13,7 +14,7 @@ $(SDK_DIR)/examples/PowerSpectrum.cpp OTHER_SOURCES := \ - ../json/json11/json11.cpp + $(PIPERCPP_DIR)/json11/json11.cpp SDK_LIBS := \ $(SDK_DIR)/libvamp-hostsdk.a \ @@ -23,14 +24,14 @@ EXAMPLE := example$(EXAMPLE_EXT) EXAMPLE_SOURCE := example.cpp EXAMPLE_SOURCES := $(EXAMPLE_SOURCE) $(ADAPTER_SOURCES) $(PLUGIN_SOURCES) $(OTHER_SOURCES) -EXAMPLE_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,-soname=example.so -Wl,-z,defs -Wl,--version-script=vampipe.map +EXAMPLE_LDFLAGS := -shared -Wl,-Bsymbolic -Wl,-soname=example.so -Wl,-z,defs -Wl,--version-script=piper.map TEST := quick-test TEST_SOURCE := quick-test.cpp TEST_LDFLAGS := -ldl CXXFLAGS := -std=c++11 -fPIC -Wall -Wextra -g -INCPATH := -I$(SDK_DIR) -I.. -I../json +INCPATH := -I$(SDK_DIR) -I$(PIPERCPP_DIR) $(INCPATH) all: $(EXAMPLE) $(TEST) ./$(TEST)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/piper.map Thu Oct 13 14:37:15 2016 +0100 @@ -0,0 +1,4 @@ +{ + global: piperRequestJson; piperProcessRaw; piperFreeJson; + local: *; +};
--- a/quick-test.cpp Tue Oct 11 14:37:12 2016 +0100 +++ b/quick-test.cpp Thu Oct 13 14:37:15 2016 +0100 @@ -15,7 +15,7 @@ } typedef const char *(*RequestFn)(const char *); - RequestFn reqFn = (RequestFn)dlsym(lib, "vampipeRequestJson"); + RequestFn reqFn = (RequestFn)dlsym(lib, "piperRequestJson"); if (!reqFn) { cerr << "failed to find request function in " + example + ": " << dlerror() << endl; @@ -23,7 +23,7 @@ } typedef void (*FreeFn)(const char *); - FreeFn freeFn = (FreeFn)dlsym(lib, "vampipeFreeJson"); + FreeFn freeFn = (FreeFn)dlsym(lib, "piperFreeJson"); if (!freeFn) { cerr << "failed to find free function in " + example + ": " << dlerror() << endl;