Commit 24bc27d9500ce3e2791bdca6b4e1518e0b94a2a6

Authored by Arnaud Blanchard
2 parents 5c9c0760 1b5034af

Merge branch 'master' of https://promethe.u-cergy.fr/blaar/bapps

@@ -3,17 +3,6 @@ Set of programs to manipulate data in blc_channels. They do not have any lib dep @@ -3,17 +3,6 @@ Set of programs to manipulate data in blc_channels. They do not have any lib dep
3 Acquire input values 3 Acquire input values
4 ==================== 4 ====================
5 5
6 -from files  
7 -----------  
8 -  
9 -`i_fread <filename.tsv>` reads a line of data from the file in tsv (i.e. '0.3 0.55 0.56 ' is a vector of 3 values) and creates a channel (a vector) containing these data.  
10 -If there are many lines, it updates the data as fast as possible with each time.  
11 -It is very fast you can be either be synchronized or using **-p** to requiert a minimal time between each update.  
12 -You can also use a first column describing the time in µs to read the line.  
13 -Finaly you can limit the number of line read by using -n.  
14 -  
15 -To load sound or images, see [i_sndfile](http://blaar.org/../sndfile) and [i_pngfile](http://blaar.org/../png)  
16 -  
17 from keyboard 6 from keyboard
18 ------------- 7 -------------
19 8
@@ -48,25 +37,46 @@ It can be changed with `-S`. @@ -48,25 +37,46 @@ It can be changed with `-S`.
48 37
49 Sometime you do not want intermediate values but only **toggle** between max and min. Then use `-T`. 38 Sometime you do not want intermediate values but only **toggle** between max and min. Then use `-T`.
50 39
  40 +from files
  41 +----------
  42 +
  43 +`i_fread <filename.tsv>` reads a line of data from the file in tsv (i.e. '0.3 0.55 0.56 ' is a vector of 3 values) and creates a channel (a vector) containing these data.
  44 +If there are many lines, it updates the data as fast as possible with each time.
  45 +It is very fast you can be either be synchronized or using `-p` to requiert a minimal time between each update.
  46 +You can also use a first column describing the time in µs to read the line.
  47 +Finaly you can limit the number of line read by using `-n`.
  48 +
  49 +To load sound or images, see [i_sndfile](https://promethe.u-cergy.fr/blaar/sndfile) and [i_pngfile](https://promethe.u-cergy.fr/blaar/png)
  50 +
51 from oscillator 51 from oscillator
52 --------------- 52 ---------------
53 53
54 `i_oscillator -o/toto` generates sinusoidale oscillations and put it in the channel /toto. 54 `i_oscillator -o/toto` generates sinusoidale oscillations and put it in the channel /toto.
55 -You can specify the frequency with -f and the refresh rate with -r. 55 +You can specify the frequency with `-f` and the refresh rate with `-r`.
56 The refresh rate defines how often you will update the value of the oscillator but will not change the frequency. 56 The refresh rate defines how often you will update the value of the oscillator but will not change the frequency.
57 57
58 You can use a buffer to keep the historic of the oscillation. 58 You can use a buffer to keep the historic of the oscillation.
59 59
  60 +from mouse
  61 +----------
  62 +
  63 +`i_mouse` but you need to be sudo for now ...
60 64
61 Generate outputs 65 Generate outputs
62 ================ 66 ================
63 67
  68 +to the terminal
  69 +---------------
  70 +
  71 +In development ...
  72 +`o_display <blc_channel-in>`
  73 +
64 to a file 74 to a file
65 --------- 75 ---------
66 76
67 -`o_fread <channel> -f <filename.tsv>` create a tsv file with the data of the channel. The options are symetrical with i_fread. 77 +`o_fwrite <channel> -f <filename.tsv>` create a tsv file with the data of the channel. The options are symetrical with **i_fread**.
68 78
69 -To save sounds or images see [o_sndfile](http://blaar.org/../sndfile] and [o_pngfile](http://blaar.org/../png] 79 +To save sounds or images see [o_sndfile](https://promethe.u-cergy.fr/blaar/sndfile] and [o_pngfile](https://promethe.u-cergy.fr/blaar/png]
70 80
71 81
72   82  
@@ -16,9 +16,9 @@ project(i_keyboard) @@ -16,9 +16,9 @@ project(i_keyboard)
16 find_package(blc_channel REQUIRED) 16 find_package(blc_channel REQUIRED)
17 find_package(blc_program REQUIRED) 17 find_package(blc_program REQUIRED)
18 18
19 -add_definitions(${BL_DEFINITIONS}) 19 +add_definitions(${BL_DEFINITIONS} -Wno-multichar)
20 include_directories(${BL_INCLUDE_DIRS}) 20 include_directories(${BL_INCLUDE_DIRS})
21 -add_executable(i_keyboard src/main.cpp) 21 +add_executable(i_keyboard src/i_keyboard.cpp)
22 target_link_libraries(i_keyboard ${BL_LIBRARIES}) 22 target_link_libraries(i_keyboard ${BL_LIBRARIES})
23 23
24 24
@@ -231,7 +231,7 @@ int main(int argc, char** argv){ @@ -231,7 +231,7 @@ int main(int argc, char** argv){
231 uchar answer; 231 uchar answer;
232 blc_array array_select; 232 blc_array array_select;
233 233
234 - asprintf(&default_output, "/%s%d", basename(argv[0]), getpid()); //This will not be free but it is only allocate once 234 + SYSTEM_ERROR_CHECK(asprintf(&default_output, "/%s%d", basename(argv[0]), getpid()), -1, NULL); //This will not be free but it is only allocate once
235 blc_program_set_description("Get keyboard inputs"); 235 blc_program_set_description("Get keyboard inputs");
236 blc_program_add_option(&display, 'd', "display", NULL, "Display a text graph", NULL); 236 blc_program_add_option(&display, 'd', "display", NULL, "Display a text graph", NULL);
237 blc_program_add_option(&filename, 'f', "file", "filename", "Initialize the values with a tsv file", NULL); 237 blc_program_add_option(&filename, 'f', "file", "filename", "Initialize the values with a tsv file", NULL);
@@ -300,9 +300,7 @@ int main(int argc, char** argv){ @@ -300,9 +300,7 @@ int main(int argc, char** argv){
300 } 300 }
301 } 301 }
302 } 302 }
303 -  
304 -  
305 - 303 +
306 304
307 305
308 if (memchr(key_list, quitting_key, keys_nb)) EXIT_ON_ERROR("The quitting key '%c' is in your key list %.*s, you need to select an other one with --quitting_key=...", quitting_key, keys_nb, key_list); 306 if (memchr(key_list, quitting_key, keys_nb)) EXIT_ON_ERROR("The quitting key '%c' is in your key list %.*s, you need to select an other one with --quitting_key=...", quitting_key, keys_nb, key_list);