@Override public void populateFrame(Audio a){
  if (!(a instanceof AudioSource)) {
    throw new IllegalArgumentException(a.getSystemName() + " is not an AudioSource object");
  }
  super.populateFrame(a);
  AudioSource s=(AudioSource)a;
  AudioManager am=InstanceManager.getDefault(jmri.AudioManager.class);
  String ab=s.getAssignedBufferName();
  Audio b=am.getAudio(ab);
  if (b != null) {
    assignedBuffer.setSelectedItem(b.getUserName() == null ? ab : b.getUserName());
  }
  loopInfinite.setSelected((s.getMinLoops() == AudioSource.LOOP_CONTINUOUS));
  loopMin.setValue(loopInfinite.isSelected() ? 0 : s.getMinLoops());
  loopMax.setValue(loopInfinite.isSelected() ? 0 : s.getMaxLoops());
  position.setValue(s.getPosition());
  positionRelative.setSelected(s.isPositionRelative());
  velocity.setValue(s.getVelocity());
  gain.setValue(s.getGain());
  pitch.setValue(s.getPitch());
  refDistance.setValue(s.getReferenceDistance());
  maxDistance.setValue(s.getMaximumDistance());
  rollOffFactor.setValue(s.getRollOffFactor());
  fadeInTime.setValue(s.getFadeIn());
  fadeOutTime.setValue(s.getFadeOut());
  this.newSource=false;
}

@ Override public void populateFrame ( Audio a ) { if ( ! ( a instanceof AudioSource ) ) { throw new IllegalArgumentException ( a . getSystemName ( ) + " is not an AudioSource object" ) ; } super . populateFrame ( a ) ; AudioSource s = ( AudioSource ) a ; AudioManager am = InstanceManager . getDefault ( jmri . AudioManager . class ) ; String ab = s . getAssignedBufferName ( ) ; Audio b = am . getAudio ( ab ) ; if ( b != null ) { assignedBuffer . setSelectedItem ( b . getUserName ( ) == null ? ab : b . getUserName ( ) ) ; } loopInfinite . setSelected ( ( s . getMinLoops ( ) == AudioSource . LOOP_CONTINUOUS ) ) ; loopMin . setValue ( loopInfinite . isSelected ( ) ? 0 : s . getMinLoops ( ) ) ; loopMax . setValue ( loopInfinite . isSelected ( ) ? 0 : s . getMaxLoops ( ) ) ; position . setValue ( s . getPosition ( ) ) ; positionRelative . setSelected ( s . isPositionRelative ( ) ) ; velocity . setValue ( s . getVelocity ( ) ) ; gain . setValue ( s . getGain ( ) ) ; pitch . setValue ( s . getPitch ( ) ) ; refDistance . setValue ( s . getReferenceDistance ( ) ) ; maxDistance . setValue ( s . getMaximumDistance ( ) ) ; rollOffFactor . setValue ( s . getRollOffFactor ( ) ) ; fadeInTime . setValue ( s . getFadeIn ( ) ) ; fadeOutTime . setValue ( s . getFadeOut ( ) ) ; this . newSource = false ; }
method to populate the edit source frame with current values
