public class PitSpeedLimit extends SIMPluginCallback
pit-speed-limit-device = A Sound Device
pit-speed-limit-volume = 100.0
pit-speed-limit-clip = com/SIMRacingApps/SIMPluginCallbacks/Sounds/Clips/speeding_beep.wav
pit-speed-limit-rate = 200
pit-speed-limit-rate-excessive = 100
pit-speed-limit-replay = false
#Also these global settings will be used if the specific settings above are not set.
sound-device = A Sound Device Name
sound-volume = 100.0
Setting the volume zero(0) will disable the sounds.
The volume is a percentage from 0.0 to 1.0 or 1.1 to 100.0| Constructor and Description |
|---|
PitSpeedLimit(SIMPlugin SIMPlugin)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Called when the SIMPlugin is destroyed.
|
Data |
getVolume()
Gets the volume as a percentage.
|
boolean |
ProcessData(SIMPlugin SIMPlugin,
java.util.Map<java.lang.String,Data> data)
ProcessData is called from within the dedicated thread for this plug-in
every time there is data available in the queue it pops it off the queue and passes it to this method.
|
Data |
setVolume(double percentage)
Sets the volume as a percentage.
|
Data |
setVolume(java.lang.String percentage) |
DataReady, Waitingpublic PitSpeedLimit(SIMPlugin SIMPlugin) throws SIMPlugin.SIMPluginException
SIMPlugin - An instance of the current SIM.SIMPlugin.SIMPluginException - If there's a problem constructing your plug-in.public void destroy()
destroy in class SIMPluginCallbackpublic Data getVolume()
Data container.public Data setVolume(double percentage)
PATH = /SIMPluginCallback/Sounds/PitSpeedLimit/setVolume/(PERCENTAGE)
percentage - The new volume percentage, between 0.0 and 100.0.Data container.public Data setVolume(java.lang.String percentage)
public boolean ProcessData(SIMPlugin SIMPlugin, java.util.Map<java.lang.String,Data> data)
SIMPluginCallback
//When calling the SIMPlugin from this method, you must synchronize on it first. It is not thread safe.
Data d;
synchronized (SIMPlugin) {
//do not spend much time in here, we are blocking the main thread
//Get the data and get out of the synchronized block
d = SIMPlugin.getData("/Session/IsGreenFlag");
d = SIMPlugin.getSession().getIsGreenFlag();
}
//do something with the data
ProcessData in class SIMPluginCallbackSIMPlugin - A reference to the SIMPlugin instance.data - The Data objects added to the queue.