code: public int millisecondsToX(long milliseconds) {
          if (autoScroll.get()) {
              int playHead = (getWidth() / 2) + 2;
              long offset = milliseconds - getFurthestPlaybackPosition();
              return playHead + (Util.timeToHalfFrame(offset) / scale.get());
          }
          return Util.timeToHalfFrame(milliseconds) / scale.get();
      }
docs: Converts a time in milliseconds to the appropriate x coordinate for drawing something at that time.
  
  @param milliseconds the time at which something should be drawn
  
  @return the component x coordinate at which it should be drawn