Added udpclient #2
This commit is contained in:
20
csoundbox.c
20
csoundbox.c
@@ -37,7 +37,7 @@ int main(int argc, char *argv[]) {
|
||||
break;
|
||||
case 'i':
|
||||
//connect to a csoundbox server
|
||||
|
||||
inputNetwork(optarg);
|
||||
break;
|
||||
case 'l':
|
||||
default:
|
||||
@@ -70,6 +70,24 @@ void inputLocal(void) {
|
||||
endwin();
|
||||
}
|
||||
|
||||
void inputNetwork(char *server) {
|
||||
initscr();
|
||||
nonl(); //no newline
|
||||
noecho();
|
||||
keypad(stdscr, FALSE); //Disable the F1-12 keypad
|
||||
curs_set(0); //Disable the cursor
|
||||
|
||||
printCursesWelcome();
|
||||
|
||||
char input[2];
|
||||
while ((input[0] = getch()) != 13) {
|
||||
input[1] = '\0';
|
||||
sendKeyUDP(server, input);
|
||||
}
|
||||
|
||||
endwin();
|
||||
}
|
||||
|
||||
void printCursesWelcome(void) {
|
||||
int y, x;
|
||||
getmaxyx(stdscr, y, x);
|
||||
|
Reference in New Issue
Block a user