Start of ptap UI

master
Peter Nelson 2013-02-01 17:39:02 +00:00
parent c8fcc8e778
commit 4d16160270
2 changed files with 54 additions and 11 deletions

View File

@ -2,30 +2,24 @@ CFLAGS := -Wall -O3 -g -D_GNU_SOURCE
LDFLAGS := -lm
CFLAGS += `pkg-config lv2core --cflags`
LDFLAGS += `pkg-config lv2ore --libs`
LDFLAGS += `pkg-config lv2core --libs`
PTAPSRC := ptap.c
PTAPSRC += ptapui.c
PTAPOBJ := $(PTAPSRC:.c=.o)
PTAPO := ptap.so
DUCKERSRC := ducker.c
DUCKEROBJ := $(DUCKERSRC:.c=.o)
DUCKERO := ducker.so
all: $(PTAPO) $(DUCKERO)
all: $(PTAPO)
clean:
rm $(PTAPOBJ) $(PTAPO) $(DUCKEROBJ) $(DUCKERO)
rm $(PTAPOBJ) $(PTAPO)
depend:
makedepend $(PTAPSRC) $(DUCKERSRC)
makedepend $(PTAPSRC)
$(PTAPO): $(PTAPOBJ)
$(CC) -shared -fPIC -Wl,-soname,$(PTAPO) $(PTAPOBJ) -o $@
$(DUCKERO): $(DUCKEROBJ)
$(CC) -shared -fPIC -Wl,-soname,$(DUCKERO) $(DUCKEROBJ) -o $@
.c.o:
$(CC) -c -fPIC $(CFLAGS) $< -o $@

49
ptap/ptapui.c 100644
View File

@ -0,0 +1,49 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <lv2.h>
#include <lv2/lv2plug.in/ns/extensions/ui/ui.h>
static LV2UI_Handle ptapui_instantiate(
const LV2UI_Descriptor *descriptor,
const char *plugin_uri,
const char *bundle_path,
LV2UI_Write_Function write_function,
LV2UI_Controller controller,
LV2UI_Widget *widget,
const LV2_Feature *const *host_features)
{
return NULL;
}
static void ptapui_cleanup(LV2UI_Handle ui)
{
}
static void ptapui_port_event(
LV2UI_Handle ui,
uint32_t port_index,
uint32_t buffer_size,
uint32_t format,
const void *buffer)
{
}
static const LV2UI_Descriptor s_lv2uidescriptor =
{
.URI = "http://fuzzle.org/~petern/ptapui/1",
.instantiate = &ptapui_instantiate,
.cleanup = &ptapui_cleanup,
.port_event = &ptapui_port_event,
.extension_data = NULL,
};
const LV2UI_Descriptor *lv2ui_descriptor(uint32_t index)
{
if (index == 0) {
return &s_lv2uidescriptor;
}
return NULL;
}