I know I can use Attention has :ToneProfile in the CODE, but I'd rather spare the unfunctional parts fro the user by not displaying the relevant SETTINGS for devices that don't have it. For this I'd need a way to generate the monkey.jungle either :
I know I can use Attention has :ToneProfile in the CODE, but I'd rather spare the unfunctional parts fro the user by not displaying the relevant SETTINGS for devices that don't have it. For this I'd need a way to generate the monkey.jungle either :
Each device folder has a file called {device id}.debug.xml, which contains the text "ToneProfile" if and only if the device supports Attention.ToneProfile.
From the SDK Devices folder (in macOS…
Thanks!
Here's my customized version:
#!/usr/bin/env bash METHOD="$1" EXCLUDE_ANNOTATION="${2:-$1}" if [ x"${METHOD}" == x"" ]; then echo "Usage: $0 <methodName>" [<excludeAnnotation>] …
Each device folder has a file called {device id}.debug.xml, which contains the text "ToneProfile" if and only if the device supports Attention.ToneProfile.
From the SDK Devices folder (in macOS terminal, linux shell, or Windows WSL shell), you can run the following *nix shell commands (bash or zsh should work):
(Skip to the lines starting with if you're only interested in the commands you need for the end result, as opposed to "background info" stuff.)
- Determine the number of files named "*.debug.xml" (there's one for each device):
# find . -name "*.debug.xml" | wc -l
136
- List the path of each "*.debug.xml" file, in sorted order
# find . -name "*.debug.xml" | sort
./approachs60/approachs60.api.debug.xml./approachs62/approachs62.api.debug.xml./approachs7042mm/approachs7042mm.api.debug.xml./approachs7047mm/approachs7047mm.api.debug.xml...
- List the number of "*.debug.xml" files which contain the text "ToneProfile":
# grep -R ToneProfile -l --include="*.debug.xml" | wc -l
110
- List the number of "*.debug.xml" files which do not contain the text "ToneProfile":
# grep -R ToneProfile -l --include="*.debug.xml" -L | wc -l 26
- List the path of each file containing the text "ToneProfile":
# grep -R ToneProfile -l --include="*.debug.xml" | sort
./approachs7042mm/approachs7042mm.api.debug.xml./approachs7047mm/approachs7047mm.api.debug.xml./d2airx10/d2airx10.api.debug.xml...
List each device ID with ToneProfile support:
# grep -R ToneProfile -l --include="*.debug.xml" | sort | cut -d/ -f2
approachs7042mmapproachs7047mmd2airx10...
List each device ID without ToneProfile support:
# grep -R ToneProfile -l --include="*.debug.xml" -L | sort | cut -d/ -f2
approachs60approachs62d2airlegacyherocaptainmarvellegacyherofirstavengerlegacysagadarthvaderlegacysagareyvenuvenu2venu2svenu2system6previewvenudvenusqvenusq2venusq2mvenusqmvivoactivevivoactive3vivoactive3dvivoactive3mvivoactive3mltevivoactive4vivoactive4svivoactive5vivoactive_hrvivolife
You should be able to pass the lists generated by the latter two commands to your script/program which generates monkey.jungle (or incorporate those commands in your script.)
Thanks!
Here's my customized version:
#!/usr/bin/env bash
METHOD="$1"
EXCLUDE_ANNOTATION="${2:-$1}"
if [ x"${METHOD}" == x"" ]; then
echo "Usage: $0 <methodName>" [<excludeAnnotation>]
exit 1
fi
DEVICES_DIR="${CIQ_SDK_HOME}/Devices"
(cd "${DEVICES_DIR}" ; grep -R "${METHOD}" -l --include="*.debug.xml" | sort | cut -d/ -f2 | sed -e "s#\$#:no_${EXCLUDE_ANNOTATION}#" ; \
grep -R "${METHOD}" -l --include="*.debug.xml" -L | sort | cut -d/ -f2 | sed -e "s#\$#:${EXCLUDE_ANNOTATION}#") | sort
This is the example from the SDK documentation:
// Play a predefined tone
if (Attention has :playTone) {
Attention.playTone(Attention.TONE_LOUD_BEEP);
}
// Use an array of ToneProfile objects to build and play a custom tone
if (Attention has :ToneProfile) {
var toneProfile =
[
new Attention.ToneProfile( 2500, 250),
new Attention.ToneProfile( 5000, 250),
new Attention.ToneProfile(10000, 250),
new Attention.ToneProfile( 5000, 250),
new Attention.ToneProfile( 2500, 250),
];
Attention.playTone({:toneProfile=>toneProfile});
}
It's not clear if we need to check for both playTone and ToneProfile or one of then is sufficient.
Based on the debug.xml-s either one of them should be enough, because either both are defined or both aren't.