I got sick of inserting Hornz, Hornz, Hornz, ... in a train schedule.
I create a driver command to play the horn 1, 2, up to 10 times.
The config file has these entries:
The delay is used between each play to put the running thread to sleep while the sound comes out.
The 'play_x_val' tag's values are the number of times that the horn is blasted.
You would tune up the delay in millisecs to get a better sequence if it is needed. The values of the tags can be changed but not the names of the tags or you would screw up the script.
Here is a demo: http://youtu.be/JZjxxb-BkBw
If anyone is interested I will upload it.
cheers,
José
I create a driver command to play the horn 1, 2, up to 10 times.
The config file has these entries:
Code:
play_0_label "Play once"
play_1_label "Play twice"
play_2_label "Play 3 times"
play_3_label "Play 4 times"
play_4_label "Play 5 times"
play_5_label "Play 6 times"
play_6_label "Play 7 times"
play_7_label "Play 8 times"
play_8_label "Play 9 times"
play_9_label "Play 10 times"
play_0_val "1"
play_1_val "2"
play_2_val "3"
play_3_val "4"
play_4_val "5"
play_5_val "6"
play_6_val "7"
play_7_val "8"
play_8_val "9"
play_9_val "10"
delay_millisecs "200"
The delay is used between each play to put the running thread to sleep while the sound comes out.
The 'play_x_val' tag's values are the number of times that the horn is blasted.
You would tune up the delay in millisecs to get a better sequence if it is needed. The values of the tags can be changed but not the names of the tags or you would screw up the script.
Here is a demo: http://youtu.be/JZjxxb-BkBw
If anyone is interested I will upload it.
cheers,
José