Package jmri.jmrit.vsdecoder
Class EngineSound
- java.lang.Object
-
- jmri.jmrit.vsdecoder.VSDSound
-
- jmri.jmrit.vsdecoder.EngineSound
-
- Direct Known Subclasses:
Diesel3Sound
,DieselSound
,Steam1Sound
,SteamSound
public class EngineSound extends VSDSound
Superclass for Steam, Diesel and Electric Sound.
This file is part of JMRI.JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
auto_start_engine
(package private) float
engine_gain
(package private) EnginePane
engine_pane
(package private) float
engine_rd
(package private) float
exponent
(package private) int
fade_in_time
(package private) int
fade_length
(package private) int
fade_out_time
(package private) boolean
is_auto_start
(package private) int
sleep_interval
-
Fields inherited from class jmri.jmrit.vsdecoder.VSDSound
BufSysNamePrefix, BufUserNamePrefix, default_exponent, default_gain, default_reference_distance, default_sleep_interval, gain, is_tunnel, myposition, name, SrcSysNamePrefix, SrcUserNamePrefix, t, tunnel_volume, volume
-
-
Constructor Summary
Constructors Constructor Description EngineSound(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
autoStartCheck()
static int
calcEngineNotch(double throttle)
static int
calcEngineNotch(float throttle)
void
changeLocoDirection(int d)
void
fadeIn()
void
fadeOut()
void
functionKey(java.lang.String e, boolean v, java.lang.String n)
float
getActualSpeed()
int
getFadeInTime()
int
getFadeOutTime()
(package private) boolean
getFirstSpeed()
org.jdom2.Element
getXml()
void
handleSpeedChange(java.lang.Float s, EnginePane e)
boolean
isEngineStarted()
void
loop()
void
mute(boolean m)
void
play()
(package private) void
setActualSpeed(float a)
void
setEngineStarted(boolean es)
protected void
setFadeInTime(int t)
protected void
setFadeInTime(java.lang.String s)
protected void
setFadeOutTime(int t)
protected void
setFadeOutTime(java.lang.String s)
(package private) void
setFirstSpeed(boolean f)
void
setVolume(float v)
void
setXml(org.jdom2.Element e, VSDFile vf)
protected boolean
setXMLAutoStart(org.jdom2.Element e)
protected float
setXMLEngineReferenceDistance(org.jdom2.Element e)
protected float
setXMLExponent(org.jdom2.Element e)
protected float
setXMLGain(org.jdom2.Element e)
protected float
setXMLReferenceDistance(org.jdom2.Element e)
protected int
setXMLSleepInterval(org.jdom2.Element e)
void
shutdown()
(package private) double
speedCurve(float t)
void
startEngine()
void
stop()
void
stopEngine()
-
Methods inherited from class jmri.jmrit.vsdecoder.VSDSound
changeNotch, changeThrottle, getGain, getName, getPosition, getTunnel, newTimer, setGain, setName, setPosition, setTunnel, setXml
-
-
-
-
Field Detail
-
auto_start_engine
boolean auto_start_engine
-
is_auto_start
boolean is_auto_start
-
fade_length
int fade_length
-
fade_in_time
int fade_in_time
-
fade_out_time
int fade_out_time
-
engine_rd
float engine_rd
-
engine_gain
float engine_gain
-
sleep_interval
int sleep_interval
-
exponent
float exponent
-
engine_pane
EnginePane engine_pane
-
-
Constructor Detail
-
EngineSound
public EngineSound(java.lang.String name)
-
-
Method Detail
-
getFadeInTime
public int getFadeInTime()
-
getFadeOutTime
public int getFadeOutTime()
-
setFadeInTime
protected void setFadeInTime(int t)
-
setFadeInTime
protected void setFadeInTime(java.lang.String s)
-
setFadeOutTime
protected void setFadeOutTime(int t)
-
setFadeOutTime
protected void setFadeOutTime(java.lang.String s)
-
calcEngineNotch
public static final int calcEngineNotch(float throttle)
-
calcEngineNotch
public static final int calcEngineNotch(double throttle)
-
handleSpeedChange
public void handleSpeedChange(java.lang.Float s, EnginePane e)
-
setFirstSpeed
void setFirstSpeed(boolean f)
-
getFirstSpeed
boolean getFirstSpeed()
-
setActualSpeed
void setActualSpeed(float a)
-
getActualSpeed
public float getActualSpeed()
-
speedCurve
double speedCurve(float t)
-
startEngine
public void startEngine()
-
stopEngine
public void stopEngine()
-
isEngineStarted
public boolean isEngineStarted()
-
setEngineStarted
public void setEngineStarted(boolean es)
-
functionKey
public void functionKey(java.lang.String e, boolean v, java.lang.String n)
-
changeLocoDirection
public void changeLocoDirection(int d)
-
autoStartCheck
void autoStartCheck()
-
setXMLAutoStart
protected boolean setXMLAutoStart(org.jdom2.Element e)
-
setXMLExponent
protected float setXMLExponent(org.jdom2.Element e)
-
setXMLGain
protected float setXMLGain(org.jdom2.Element e)
-
setXMLReferenceDistance
protected float setXMLReferenceDistance(org.jdom2.Element e)
-
setXMLEngineReferenceDistance
protected float setXMLEngineReferenceDistance(org.jdom2.Element e)
-
setXMLSleepInterval
protected int setXMLSleepInterval(org.jdom2.Element e)
-
-