Added showhelp
This commit is contained in:
10
README.md
10
README.md
@@ -2,15 +2,19 @@
|
|||||||
|
|
||||||
A soundboard to trigger sounds remotely or local with a keyboard.
|
A soundboard to trigger sounds remotely or local with a keyboard.
|
||||||
|
|
||||||
|
## Compile & install
|
||||||
|
|
||||||
First install
|
First install
|
||||||
* libao
|
* libao
|
||||||
* mpg123
|
* mpg123
|
||||||
|
* libconfig
|
||||||
|
|
||||||
On Debian:
|
On Debian:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt-get install libao-dev
|
sudo apt-get install libao-dev
|
||||||
sudo apt-get install mpg123
|
sudo apt-get install mpg123
|
||||||
|
sudo apt-get install libconfig-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@@ -25,3 +29,9 @@ to
|
|||||||
default_driver=pulse
|
default_driver=pulse
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Arguments
|
||||||
|
|
||||||
|
* -h: Show the help screen and exit
|
||||||
|
* -s: Start the server
|
||||||
|
* -i <ip>: connect to a server
|
||||||
|
* -l or without arguments: Start local
|
||||||
|
@@ -34,7 +34,7 @@ int main(int argc, char *argv[]) {
|
|||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
//show the help page
|
//show the help page
|
||||||
|
showHelp();
|
||||||
break;
|
break;
|
||||||
case 'i':
|
case 'i':
|
||||||
//connect to a csoundbox server
|
//connect to a csoundbox server
|
||||||
@@ -111,4 +111,10 @@ void printCursesWelcome(void) {
|
|||||||
mvprintw(y + 1, x - (strlen(msg2) / 2), msg2);
|
mvprintw(y + 1, x - (strlen(msg2) / 2), msg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void showHelp(void) {
|
||||||
|
printf("-h: Show the help screen and exit\n");
|
||||||
|
printf("-s: Start the server\n");
|
||||||
|
printf("-i <ip>: connect to a server\n");
|
||||||
|
printf("-l or without arguments: Start local\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -2,3 +2,4 @@
|
|||||||
void inputLocal(void);
|
void inputLocal(void);
|
||||||
void printCursesWelcome(void);
|
void printCursesWelcome(void);
|
||||||
void inputNetwork(char *server);
|
void inputNetwork(char *server);
|
||||||
|
void showHelp(void);
|
||||||
|
11
udpserver.c
11
udpserver.c
@@ -1,8 +1,8 @@
|
|||||||
#include<stdio.h> //printf
|
#include <stdio.h> //printf
|
||||||
#include<string.h> //memset, strtok
|
#include <string.h> //memset, strtok
|
||||||
#include<stdlib.h> //exit(0);
|
#include <stdlib.h> //exit(0);
|
||||||
#include<arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include<sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <unistd.h> //close()
|
#include <unistd.h> //close()
|
||||||
|
|
||||||
#include "udpserver.h"
|
#include "udpserver.h"
|
||||||
@@ -13,7 +13,6 @@
|
|||||||
//#define PORT 8888
|
//#define PORT 8888
|
||||||
|
|
||||||
|
|
||||||
#include "udpserver.h"
|
|
||||||
void die(char *s)
|
void die(char *s)
|
||||||
{
|
{
|
||||||
perror(s);
|
perror(s);
|
||||||
|
Reference in New Issue
Block a user