Class ToneIndicatorProperties

java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.JposCommonProperties
de.gmxhome.conrad.jpos.jpos_base.toneindicator.ToneIndicatorProperties
All Implemented Interfaces:
JposBaseInterface, ToneIndicatorInterface
Direct Known Subclasses:
ToneIndicator

public class ToneIndicatorProperties extends JposCommonProperties implements ToneIndicatorInterface
Class containing the tone indicator specific properties, their default values and default implementations of ToneIndicatorInterface. For details about properties, methods and method parameters, see UPOS specification, chapter Tone Indicator.
  • Field Details

    • CapMelody

      public int CapMelody
      UPOS property CapMelody. Default: 0. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapPitch

      public boolean CapPitch
      UPOS property CapPitch. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • CapVolume

      public boolean CapVolume
      UPOS property CapVolume. Default: false. Can be overwritten by objects derived from JposDevice within the changeDefaults method.
    • InterToneWait

      public int InterToneWait
      UPOS property InterToneWait.
    • MelodyType

      public int MelodyType
      UPOS property MelodyType.
    • MelodyVolume

      public int MelodyVolume
      UPOS property MelodyVolume.
    • Tone1Duration

      public int Tone1Duration
      UPOS property Tone1Duration.
    • Tone1Pitch

      public int Tone1Pitch
      UPOS property Tone1Pitch.
    • Tone1Volume

      public int Tone1Volume
      UPOS property Tone1Volume.
    • Tone2Duration

      public int Tone2Duration
      UPOS property Tone2Duration.
    • Tone2Pitch

      public int Tone2Pitch
      UPOS property Tone2Pitch.
    • Tone2Volume

      public int Tone2Volume
      UPOS property Tone2Volume.
  • Constructor Details

    • ToneIndicatorProperties

      public ToneIndicatorProperties(int dev)
      Constructor. Sets ExclusiveUse to ExclusiveAllowed to match the ToneIndicator device model.
      Parameters:
      dev - Device index
  • Method Details

    • initOnOpen

      public void initOnOpen()
      Description copied from class: JposCommonProperties
      Initialization of properties that must be initialized during open.
      Overrides:
      initOnOpen in class JposCommonProperties
    • initOnFirstEnable

      public boolean initOnFirstEnable()
      Description copied from class: JposCommonProperties
      Initialize properties that must be initialized whenever the device will be enabled the first time-
      Overrides:
      initOnFirstEnable in class JposCommonProperties
      Returns:
      Returns true in case of first enable.
    • melodyType

      public void melodyType(int type) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting MelodyType. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • type is between 0 and CapMelody.
      Specified by:
      melodyType in interface ToneIndicatorInterface
      Parameters:
      type - New MelodyType value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • melodyVolume

      public void melodyVolume(int volume) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting MelodyVolume. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      melodyVolume in interface ToneIndicatorInterface
      Parameters:
      volume - New MelodyVolume value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • interToneWait

      public void interToneWait(int delay) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting InterToneWait. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • delay is ≥ 0.
      Specified by:
      interToneWait in interface ToneIndicatorInterface
      Parameters:
      delay - New InterToneWait value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tone1Duration

      public void tone1Duration(int duration) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting Tone1Duration. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      tone1Duration in interface ToneIndicatorInterface
      Parameters:
      duration - New Tone1Duration value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tone1Pitch

      public void tone1Pitch(int type) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting Tone1Pitch. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      tone1Pitch in interface ToneIndicatorInterface
      Parameters:
      type - New Tone1Pitch value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tone1Volume

      public void tone1Volume(int type) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting Tone1Volume. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      tone1Volume in interface ToneIndicatorInterface
      Parameters:
      type - New Tone1Volume value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tone2Duration

      public void tone2Duration(int type) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting Tone2Duration. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      tone2Duration in interface ToneIndicatorInterface
      Parameters:
      type - New Tone2Duration value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tone2Pitch

      public void tone2Pitch(int type) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting Tone2Pitch. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      tone2Pitch in interface ToneIndicatorInterface
      Parameters:
      type - New Tone2Pitch value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • tone2Volume

      public void tone2Volume(int type) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of setting Tone2Volume. Can be overwritten within derived classes, if necessary. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled.
      Specified by:
      tone2Volume in interface ToneIndicatorInterface
      Parameters:
      type - New Tone2Volume value
      Throws:
      jpos.JposException - If an error occurs during enable or disable
    • sound

      public Sound sound(int numberOfCycles, int interSoundWait) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Validation part of Sound method. For details, see UPOS specification. Can be overwritten within derived classes, if necessary. This method shall only perform additional validation. It will be called before the service buffers the method call for synchronous or asynchronous execution. This method will be called only if the following plausibility checks lead to a positive result:
      • Device is enabled,
      • interSoundWait ≥ 0,
      • numberOfCycles > 0 or JPOS_FOREVER,
      • AsyncMode is false: numberOfCycles is not JPOS_FOREVER.
      This method will be used in method SoundImmediate as well.
      Specified by:
      sound in interface ToneIndicatorInterface
      Parameters:
      numberOfCycles - The number of cycles to sound the indicator device. If FOREVER, then start the indicator sounding and repeat continuously, else perform the sound for the specified number of cycles.
      interSoundWait - When numberOfCycles is not one, then pause for interSoundWait milliseconds before repeating the tone cycle (before playing tone-1 again).
      Returns:
      Sound object for use in final part.
      Throws:
      jpos.JposException - For details, see UPOS method Sound.
    • sound

      public void sound(Sound request) throws jpos.JposException
      Description copied from interface: ToneIndicatorInterface
      Final part of Sound method. Can be overwritten within derived classes, if necessary. The parameters of the method will be passed via a Sound object. This method will be called when the corresponding operation shall be performed, either synchronously or asynchronously. All plausibility checks have been made before, only runtime errors can occur.
      This method will be used in method SoundImmediate as well.
      Specified by:
      sound in interface ToneIndicatorInterface
      Parameters:
      request - Sound object. Used to perform methods synchronously or asynchronously, depending on call parameters. Holds Abort and EndSync objects that should be checked in longer operations.
      Throws:
      jpos.JposException - See UPOS specification, method Sound