Add FTGL dependency and text all the things

This commit is contained in:
2013-02-04 07:31:26 +00:00
parent 35a44308d9
commit 2841c71f7f
12 changed files with 6496 additions and 6 deletions

View File

@@ -12,8 +12,8 @@ PTAPUISRC := ptapui.cpp
PTAPUIOBJ := $(PTAPUISRC:.cpp=.o) ../pui/*.o
PTAPUIO := ptapui.so
$(PTAPUIOBJ): CFLAGS += `pkg-config lv2core pugl-0 --cflags`
$(PTAPUIO): LDFLAGS += `pkg-config lv2core pugl-0 --libs`
$(PTAPUIOBJ): CFLAGS += `pkg-config lv2core ftgl pugl-0 --cflags`
$(PTAPUIO): LDFLAGS += `pkg-config lv2core ftgl pugl-0 --libs`
CPP := g++

View File

@@ -51,6 +51,8 @@ struct PTapUI : PUi {
void PTapUI::InitWidgets()
{
char tmp[128];
scale = 1.0f;
widget = new Container();
@@ -62,7 +64,15 @@ void PTapUI::InitWidgets()
int padding = 4;
int c_w = (widget->w - padding * 3) * 0.5f;
int c_h = (widget->h - padding * 5) * 0.25f;
int c_h = (widget->h - 25 - padding * 5) * 0.25f;
Container *t = new Container();
t->colour = Colour(0, 0, 0, .5f);
t->x = 0;
t->y = 0;
t->w = widget->w;
t->h = 25;
this->widget->children.push_back(t);
int slide_w = 25;
int slide_h = c_h - 25;
@@ -71,7 +81,7 @@ void PTapUI::InitWidgets()
Container *c = new Container();
if (i < TAPS) c->frame = Colour(0, 0, 0, .15f);
c->x = (i & 1) * (c_w + padding) + padding;
c->y = (i >> 1) * (c_h + padding) + padding;
c->y = (i >> 1) * (c_h + padding) + padding + 25;
c->w = c_w;
c->h = c_h;
/*
@@ -112,8 +122,16 @@ void PTapUI::InitWidgets()
c4->h = slide_h;
c->children.push_back(c4);
if (i < TAPS) {
snprintf(tmp, sizeof tmp, "Tap %d", i + 1);
} else {
strncpy(tmp, i == TAPS ? "Left Out" : "Right Out", sizeof tmp);
}
for (int j = 0; j < TAPS; j++) {
Slider *slider = new VSlider();
strncpy(slider->group, tmp, sizeof slider->group);
snprintf(slider->label, sizeof slider->label, "Tap %d", j + 1);
slider->big = false;
if (i == j) {
slider->colour = Colour(.5f, .7f, 1, 1);
@@ -133,6 +151,8 @@ void PTapUI::InitWidgets()
for (int j = 0; j < 2; j++) {
Slider *slider = new VSlider();
strncpy(slider->group, tmp, sizeof slider->group);
strncpy(slider->label, j == 0 ? "Left" : "Right", sizeof slider->label);
slider->big = false;
slider->x = c3->x + j * slide_w;//(j & 1) * slide_w;
slider->y = c3->y;// + (j >> 1) * slide_h;
@@ -147,6 +167,8 @@ void PTapUI::InitWidgets()
for (int j = 0; j < 1; j++) {
Slider *slider = new VSlider();
strncpy(slider->group, tmp, sizeof slider->group);
strncpy(slider->label, "Gain", sizeof slider->label);
slider->big = i >= TAPS;
slider->colour = Colour(1, .2f, .2f, 1);
slider->x = c4->x + j * slide_w;//(j & 1) * slide_w;
@@ -169,6 +191,8 @@ void PTapUI::InitWidgets()
c->children.push_back(c5);
Knob *k = new Knob();
strncpy(k->group, tmp, sizeof k->group);
strncpy(k->label, "Delay", sizeof k->label);
k->x = c5->x;
k->y = c5->y;
k->w = c5->w;
@@ -182,6 +206,13 @@ void PTapUI::InitWidgets()
this->widget->children.push_back(c);
}
tooltip = new Label();
tooltip->x = widget->w * 0.5f;
tooltip->y = 10;
tooltip->colour = Colour(1, 1, 1, 1);
tooltip->SetLabel("INIT");
this->widget->children.push_back(tooltip);
}
static void *ui_thread(void *ptr)
@@ -199,6 +230,10 @@ void PTapUI::ParameterChanged(const Widget *w)
if (w->port == UINT_MAX) return;
this->write(this->controller, w->port, sizeof w->value, 0, &w->value);
char tmp[64];
snprintf(tmp, sizeof tmp, "(%s) %s: %0.4f", w->group, w->label, w->value);
tooltip->SetLabel(tmp);
}
static LV2UI_Handle ptapui_instantiate(