src/init_functions.c File Reference

#include "init_functions.h"

Functions

int extension (char *filename)
void help (int argc, char **argv)
int handle_arguments (int argc, char **argv)
int set_midi_devices ()
int load_input_file ()

Function Documentation

int extension ( char *  filename  ) 

This function receives the filename string and performs a simple check to find out the file's extension. It returns 1 in case of a '.mid' file, 2 in case of a '.csv' file and 0 otherwise.

void help ( int  argc,
char **  argv 
)

This function shows the general usage information.

int handle_arguments ( int  argc,
char **  argv 
)

This function checks the arguments that the user has chosen. First it assigns the input filename to the respective variable and then it sets 1 to the 'player' variable if one of the arguments is '-p' and sets 1 to the 'verbose' variable if one of the arguments is '-d'. It returns 0 in case of success and returns 1 otherwise.

int set_midi_devices (  ) 

This function scans the '/dev' directory and prints all the available midi devices. Then opens the input and output devices chosen by the user. It returns 0 in case of success and returns 1 otherwise.

int load_input_file (  ) 

This function opens the chosen input file and calls the respective function for each valid extension to interpret its bytes. It returns 0 in case of success and returns 1 otherwise.

 All Data Structures Files Functions Variables Typedefs Defines
Generated by  doxygen 1.6.2-20100124