summaryrefslogtreecommitdiff
path: root/apps/dolmetschctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dolmetschctl.c')
-rw-r--r--apps/dolmetschctl.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/dolmetschctl.c b/apps/dolmetschctl.c
index b704109..6a0bed9 100644
--- a/apps/dolmetschctl.c
+++ b/apps/dolmetschctl.c
@@ -42,6 +42,11 @@ void print_version()
#endif
}
+void print_string(void* str)
+{
+ printf("%s\n", (char*)str);
+}
+
int main_loop(mixer_t* x, midi_t* m, osc_t* o)
{
int ret = 0;
@@ -67,20 +72,19 @@ int main_loop(mixer_t* x, midi_t* m, osc_t* o)
return -1;
}
- mixer_get_poll_fds(x, &(pfds[mixer_npfds_offset]), mixer_npfds);
- midi_get_poll_fds(m, &(pfds[midi_npfds_offset]), midi_npfds);
- osc_get_poll_fds(o, &(pfds[osc_npfds_offset]), osc_npfds);
-
mixer_print_langs(x);
-
- mixer_switch_lang(x, "en", NULL, NULL);
- mixer_switch_lang(x, "de", free, &npfds);
+ mixer_switch_lang(x, "en", &print_string, "hello world!");
+ mixer_switch_lang(x, "de", &print_string, "hallo welt!");
mixer_print_tasks(x);
printf("main_loop running with %d pollfds...\n", npfds);
for (;;) {
+ mixer_get_poll_fds(x, &(pfds[mixer_npfds_offset]), mixer_npfds);
+ midi_get_poll_fds(m, &(pfds[midi_npfds_offset]), midi_npfds);
+ osc_get_poll_fds(o, &(pfds[osc_npfds_offset]), osc_npfds);
+
int err = poll(pfds, npfds, 200);
if(err < 0 && errno != EINTR) {
error(0, errno, "poll failed");