diff options
author | Christian Pointner <equinox@spreadspace.org> | 2015-10-12 04:24:28 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2015-10-12 04:24:28 +0200 |
commit | 31b2b621cff0a9ca5f3be9b06ef12536ae17d65d (patch) | |
tree | 8d9f80e59c0f0b230b9553e87ec285c250da449d /apps/mixer.c | |
parent | language specific done data (diff) |
done data hangling for midi works now
Diffstat (limited to 'apps/mixer.c')
-rw-r--r-- | apps/mixer.c | 10 |
1 files changed, 7 insertions, 3 deletions
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); } |