private int getSegmentForX ( int x ) { if ( autoScroll . get ( ) ) { int playHead = ( x - ( getWidth ( ) / 2 ) ) ; int offset = Util . timeToHalfFrame ( getFurthestPlaybackPosition ( ) ) / scale . get ( ) ; return ( playHead + offset ) * scale . get ( ) ; } return x * scale . get ( ) ; }
Figure out the starting waveform segment that corresponds to the specified coordinate in the window .