Class Beat

    • Constructor Detail

      • Beat

        public Beat​(long time,
                    int number)
        Beat with known beat number.
        Parameters:
        time - time in milliseconds
        number - beat number, e.g. 1 for a downbeat
      • Beat

        public Beat​(long time)
        Beat with UNKNOWN beat number.
        Parameters:
        time - time in milliseconds
      • Beat

        public Beat​(long time,
                    TimeUnit timeUnit,
                    int number)
        Beat with known beat number.
        Parameters:
        time - time
        timeUnit - time unit
        number - beat number, e.g. 1 for a downbeat
      • Beat

        public Beat​(long time,
                    TimeUnit timeUnit)
        Beat with UNKNOWN beat number.
        Parameters:
        time - time
        timeUnit - time unit
      • Beat

        public Beat​(String jsonString)
    • Method Detail

      • getNumber

        public int getNumber()
        Beat number. The number is 1-based, so the downbeat is usually 1.
        Returns:
        beat number, 1-based
      • getTime

        public long getTime()
        Beat time.
        Returns:
        time in milliseconds
      • getTime

        public long getTime​(TimeUnit timeUnit)
        Beat time.
        Parameters:
        timeUnit - desired time unit
        Returns:
        time in desired unit
      • toJSONString

        public String toJSONString()
        Specified by:
        toJSONString in interface org.json.simple.JSONAware
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object