1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-19 09:01:15 +02:00

Update Nyquist to v3.09.

This commit is contained in:
Leland Lucius
2015-04-07 22:10:17 -05:00
parent f88b27e6d8
commit 9fb0ce5b82
358 changed files with 26327 additions and 7043 deletions

View File

@@ -27,7 +27,8 @@
#include "xlisp.h"
#include "sound.h" /* to get nosc_enabled */
#include "lo/lo.h"
#include "sliders.h"
#include "nyq-osc-server.h"
#include "sndsliders.h"
static lo_server the_server = NULL;
static int lo_fd;
@@ -63,14 +64,16 @@ static int wii_orientation_handler(const char *path, const char *types,
int nosc_init()
{
the_server = lo_server_new("7770", error);
/* add method that will match the path /slider, with two numbers, coerced
* to int and float */
lo_server_add_method(the_server, "/slider", "if", slider_handler, NULL);
lo_server_add_method(the_server, "/wii/orientation", "ff",
wii_orientation_handler, NULL);
lo_fd = lo_server_get_socket_fd(the_server);
nosc_enabled = true;
if (!SAFE_NYQUIST) {
the_server = lo_server_new("7770", error);
/* add method that will match the path /slider, with two numbers, coerced
* to int and float */
lo_server_add_method(the_server, "/slider", "if", slider_handler, NULL);
lo_server_add_method(the_server, "/wii/orientation", "ff",
wii_orientation_handler, NULL);
lo_fd = lo_server_get_socket_fd(the_server);
nosc_enabled = true;
}
return 0;
}
@@ -81,6 +84,7 @@ int nosc_poll()
struct timeval tv;
int retval;
if (SAFE_NYQUIST) return 0;
// loop, receiving all pending OSC messages
while (true) {
FD_ZERO(&rfds);
@@ -99,13 +103,16 @@ int nosc_poll()
return 0;
}
}
return 0;
}
void nosc_finish()
{
lo_server_free(the_server);
nosc_enabled = false;
if (!SAFE_NYQUIST) {
lo_server_free(the_server);
nosc_enabled = false;
}
}
#endif