Unified · Split
| @@ -77,6 +77,7 @@ static int rulerstyle = Sfancy, dotstyle = Sfancy; · 76 unmodified lines | ||
| 77 | 77 | |
| 78 | 78 | static char *ip, *udpport; |
| 79 | 79 | static int udp = -1; |
| 80 | +static int nl = 0; | |
| 80 | 81 | |
| 81 | 82 | static char *midipath; |
| 82 | 83 | static int midi = -1; |
| @@ -838,7 +839,9 @@ command(char *s, void (*snapshot)(void)) · 755 unmodified lines | ||
| 838 | 839 | } else if (argc > 1) { |
| 839 | 840 | x = atoi(argv[1]); |
| 840 | 841 | |
| 841 | − if (s[0] == 'b' && s[1] == 'p') /* bpm */ | |
| 842 | + if (s[0] == 'n' && s[1] == 'l' && s[2] == 0) /* nl */ | |
| 843 | + nl = x; | |
| 844 | + else if (s[0] == 'b' && s[1] == 'p') /* bpm */ | |
| 842 | 845 | apm = bpm = MAX(1, x); |
| 843 | 846 | else if (s[0] == 'a' && s[1] == 'p') /* apm */ |
| 844 | 847 | apm = MAX(1, x); |
| @@ -951,7 +954,13 @@ process(Oevent_list *events) · 106 unmodified lines | ||
| 951 | 954 | |
| 952 | 955 | if (t == Oevent_type_udp_string && udp >= 0) { |
| 953 | 956 | Oevent_udp_string *u = &e->udp_string; |
| 954 | − write(udp, u->chars, u->count); /* FIXME show errors */ | |
| 957 | + if (u->count < sizeof(tmp)-1) { | |
| 958 | + memmove(tmp, u->chars, u->count); | |
| 959 | + if (nl) | |
| 960 | + tmp[u->count++] = '\n'; | |
| 961 | + tmp[u->count] = 0; | |
| 962 | + write(udp, tmp, u->count); /* FIXME show errors */ | |
| 963 | + } | |
| 955 | 964 | continue; |
| 956 | 965 | } else if (t == Oevent_type_cmd_string) { |
| 957 | 966 | Oevent_cmd_string *c = &e->cmd_string; |