Class HapticViewPort

  • java.lang.Object
    • uk.ac.qmul.eecs.depic.daw.haptics.HapticViewPort


  • public class HapticViewPort
    extends java.lang.Object
    The haptic viewport is the specific portion of a track that is visible in the haptic view in every moment. It uses the same concept of a scrollable window: if the content is to big to be represented in a single window, then you only represent a portion of it and allow the user to scroll up and down. Likewise the haptic view port only represent one portion of audio track at the time and when the haptic proxy gets to the left or right ends of the view port, then the viewport is shifted of a certain amount of pixels.
    • Constructor Detail

      • HapticViewPort

        public HapticViewPort(int scaleFactor)
    • Method Detail

      • shift

        public void shift(float amount)
        Parameters:
        amount - the amount of shift in pixels (or chunks)
      • getPosition

        public int getPosition(float ratio)
        Returns the position in the haptic view port that is mapped to ratio. ratio is a normalized value ranging from 0 to 1.
        Parameters:
        ratio - the position on the haptic view port as a ratio of the haptic view port width
        Returns:
        the the position on the haptic view port as chunk/pixel position
      • setTrackSize

        public void setTrackSize(int trackSize)
      • getScaleFactor

        public int getScaleFactor()
      • getWidth

        public int getWidth()
      • setScaleFactor

        public void setScaleFactor(int scaleFactor)
      • log2

        public static double log2(double x)