New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Virtual device #41

Merged
merged 122 commits into from Oct 2, 2017
Commits
Jump to file or symbol
Failed to load files and symbols.
+25 −1
Diff settings

Always

Just for now

Viewing a subset of changes. View all

avtka: events from ui being sent to app

Signed-off-by: Harry van Haaren <harryhaaren@gmail.com>
  • Loading branch information...
harryhaaren committed Aug 22, 2017
commit 5457308fdeb9d623aafd992ad5017053d6105697
View
@@ -94,9 +94,33 @@ avtka_disconnect(struct ctlra_dev_t *base)
static void
event_cb(struct avtka_t *avtka, uint32_t item, void *userdata)
{
struct cavtka_t *dev = (struct cavtka_t *)userdata;
printf("event on item %d\n", item);
}
uint32_t type = dev->id_to_ctlra[item].type;
uint32_t id = dev->id_to_ctlra[item].id;
printf("event type %d, id = %d\n", type, id);
struct ctlra_event_t event = {
.type = type,
.button = {
.id = id,
// TODO: value get
.pressed = 1,
},
};
switch(type) {
case CTLRA_EVENT_SLIDER:
event.slider.id = id;
event.slider.value = 0.5;
break;
default:
break;
}
struct ctlra_event_t *e = {&event};
dev->base.event_func(&dev->base, 1, &e,
dev->base.event_func_userdata);
}
struct ctlra_dev_t *
ctlra_avtka_connect(ctlra_event_func event_func, void *userdata, void *future)
ProTip! Use n and p to navigate between commits in a pull request.