Unified · Split
| @@ -77,6 +77,7 @@ static int rulerstyle = Sfancy, dotstyle = Sfancy; · 76 unmodified lines | |||
| 77 | 77 | ||
| 78 | static char *ip, *udpport; | 78 | static char *ip, *udpport; |
| 79 | static int udp = -1; | 79 | static int udp = -1; |
| 80 | static int nl = 0; | ||
| 80 | 81 | ||
| 81 | static char *midipath; | 82 | static char *midipath; |
| 82 | static int midi = -1; | 83 | static int midi = -1; |
| @@ -838,7 +839,9 @@ command(char *s, void (*snapshot)(void)) · 755 unmodified lines | |||
| 838 | } else if (argc > 1) { | 839 | } else if (argc > 1) { |
| 839 | x = atoi(argv[1]); | 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 | apm = bpm = MAX(1, x); | 845 | apm = bpm = MAX(1, x); |
| 843 | else if (s[0] == 'a' && s[1] == 'p') /* apm */ | 846 | else if (s[0] == 'a' && s[1] == 'p') /* apm */ |
| 844 | apm = MAX(1, x); | 847 | apm = MAX(1, x); |
| @@ -951,7 +954,13 @@ process(Oevent_list *events) · 106 unmodified lines | |||
| 951 | 954 | ||
| 952 | if (t == Oevent_type_udp_string && udp >= 0) { | 955 | if (t == Oevent_type_udp_string && udp >= 0) { |
| 953 | Oevent_udp_string *u = &e->udp_string; | 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 | continue; | 964 | continue; |
| 956 | } else if (t == Oevent_type_cmd_string) { | 965 | } else if (t == Oevent_type_cmd_string) { |
| 957 | Oevent_cmd_string *c = &e->cmd_string; | 966 | Oevent_cmd_string *c = &e->cmd_string; |