initial commit
[ETG_Helmet] / SOFTWARE / OMEGA2 / player.sh
1 #/bin/bash
2
3 if [ "$TMPFS" == "" ]; then 
4         . "common.sh"
5 fi
6
7 echo $$ > $PID/$0
8
9 echo "------- start player --------" | myLog
10
11 touch $TMPFS/$state
12
13 ## narrativeStructureReset              # creating files for each location in /tmp/...
14
15 afterPause=0
16 pauseOn=0
17 startFrom=0
18
19 # ------------------------ main player ---------------------------------------------------------------
20
21 while [ 1 ]; do 
22
23         if  [ ! -s "$TMPFS/$state" ]; then      # no side messages (state file is empty)
24
25                 time=$(date +%s)
26                 CURRENTGPSStr=$(cat $CURRENTGPS)
27                 prevtime=$(echo $CURRENTGPSStr | awk -F'|' '{print $3; exit}')
28
29                 if [ "$prevtime" == "" ]; then prevtime=0; fi
30                 tdiff=$(( $time - $prevtime ))
31
32                 # -------- searchign for location based on GPS data ---------------------
33                 
34                 # TODO: YOUR LOCATION SEARCHING HERE            
35
36                 # -------- if location has been found -----------------------------------
37
38                 # TODO: YOUR PLAYBACK ROUTNE HERE 
39
40                 # playFile <your_current_file.mp3>
41
42                 else 
43                         # No location found
44                         sleep 1
45                 fi
46         else 
47 #               echo "[$0] Main playback is busy (message playing?)" | myLog
48                 sleep 1
49         fi
50 done 
51
52
Contact me: dev (at) shalnoff (dot) com
PGP fingerprint: A6B8 3B23 6013 F18A 0C71 198B 83D8 C64D 917A 5717