From 31b2b621cff0a9ca5f3be9b06ef12536ae17d65d Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 12 Oct 2015 04:24:28 +0200 Subject: done data hangling for midi works now --- apps/mixer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'apps/mixer.c') diff --git a/apps/mixer.c b/apps/mixer.c index 50684ca..83ac8c7 100644 --- a/apps/mixer.c +++ b/apps/mixer.c @@ -198,7 +198,6 @@ int mixer_switch_lang(mixer_t* x, const char* lang, void (*done_cb)(void*), void return -1; } - void mixer_print_tasks(mixer_t* x) { assert(x); @@ -222,23 +221,27 @@ void mixer_print_tasks(mixer_t* x) int mixer_get_poll_fd_count(mixer_t* x) { + assert(x); + return snd_rawmidi_poll_descriptors_count(x->output_); } int mixer_get_poll_fds(mixer_t* x, struct pollfd *pfds, int npfds) { + assert(x && pfds && npfds); + int ret = snd_rawmidi_poll_descriptors(x->output_, pfds, npfds); if(!slist_length(&(x->tasks_))) { int i; for(i = 0; i < ret; ++i) - pfds[i].fd = -1; + pfds[i].events = 0; } return ret; } int mixer_handle_revents(mixer_t* x, struct pollfd *pfds, int npfds) { - assert(x); + assert(x && pfds && npfds); int err; unsigned short revents; @@ -273,6 +276,7 @@ int mixer_handle_revents(mixer_t* x, struct pollfd *pfds, int npfds) } if(task->done_cb_) task->done_cb_(task->done_data_); + slist_remove(&(x->tasks_), task); } -- cgit v1.2.3