Class Cut

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.SizeOfHandler, adams.data.InPlaceProcessing, Serializable

    public class Cut
    extends AbstractWaveFilter
    implements adams.data.InPlaceProcessing
    Cuts out the specified section from the Wave object.
    Only works if 'subChunk2Id' is 'data' not 'LIST'.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -type <SAMPLES|SECONDS> (property: type)
        How to interpret the start/duration values.
        default: SAMPLES
     
    -start <double> (property: start)
        The starting point for the cut.
        default: 0.0
        minimum: 0.0
     
    -duration <double> (property: duration)
        The duration of the cut.
        default: 0.0
        minimum: 0.0
     
    -no-copy <boolean> (property: noCopy)
        If enabled, no copy of the Wave is created before cutting.
        default: false
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected double m_Duration
      the duration.
      protected boolean m_NoCopy
      whether to skip creating a copy of the container.
      protected double m_Start
      the start.
      protected WaveIndexingType m_Type
      the starting/duration.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      Cut()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void defineOptions()
      Adds options to the internal list of options.
      String durationTipText()
      Returns the tip text for this property.
      double getDuration()
      Returns the duration of the cut.
      boolean getNoCopy()
      Returns whether to skip creating a copy of the wave before cutting.
      String getQuickInfo()
      Returns a quick info about the actor, which will be displayed in the GUI.
      double getStart()
      Returns the starting point of the cut.
      WaveIndexingType getType()
      Returns the indexing type in use.
      String globalInfo()
      Returns a string describing the object.
      String noCopyTipText()
      Returns the tip text for this property.
      protected WaveContainer processData​(WaveContainer data)
      Performs the actual filtering.
      void setDuration​(double value)
      Sets the duration of the cut.
      void setNoCopy​(boolean value)
      Sets whether to skip creating a copy of the wave before cutting.
      void setStart​(double value)
      Sets the starting point of the cut.
      void setType​(WaveIndexingType value)
      Sets the indexing type to use.
      String startTipText()
      Returns the tip text for this property.
      String typeTipText()
      Returns the tip text for this property.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, toCommandLine, toString
      • Methods inherited from class adams.core.logging.CustomLoggingLevelObject

        setLoggingLevel
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_Start

        protected double m_Start
        the start.
      • m_Duration

        protected double m_Duration
        the duration.
      • m_NoCopy

        protected boolean m_NoCopy
        whether to skip creating a copy of the container.
    • Constructor Detail

      • Cut

        public Cut()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • setType

        public void setType​(WaveIndexingType value)
        Sets the indexing type to use.
        Parameters:
        value - the type
      • getType

        public WaveIndexingType getType()
        Returns the indexing type in use.
        Returns:
        the type
      • typeTipText

        public String typeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setStart

        public void setStart​(double value)
        Sets the starting point of the cut.
        Parameters:
        value - the starting point
      • getStart

        public double getStart()
        Returns the starting point of the cut.
        Returns:
        the starting point
      • startTipText

        public String startTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setDuration

        public void setDuration​(double value)
        Sets the duration of the cut.
        Parameters:
        value - the duration
      • getDuration

        public double getDuration()
        Returns the duration of the cut.
        Returns:
        the duration
      • durationTipText

        public String durationTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setNoCopy

        public void setNoCopy​(boolean value)
        Sets whether to skip creating a copy of the wave before cutting.
        Specified by:
        setNoCopy in interface adams.data.InPlaceProcessing
        Parameters:
        value - true if to skip creating copy
      • getNoCopy

        public boolean getNoCopy()
        Returns whether to skip creating a copy of the wave before cutting.
        Specified by:
        getNoCopy in interface adams.data.InPlaceProcessing
        Returns:
        true if copying is skipped
      • noCopyTipText

        public String noCopyTipText()
        Returns the tip text for this property.
        Specified by:
        noCopyTipText in interface adams.data.InPlaceProcessing
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns a quick info about the actor, which will be displayed in the GUI.
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Overrides:
        getQuickInfo in class AbstractWaveFilter
        Returns:
        null if no info available, otherwise short string