private long convertPosToTime(double x, double margin) {		

		long st = filterManager.getGlobalStartTime().getTime();
		long et = filterManager.getGlobalEndTime().getTime();

		if (et == st)
			return st;

		return (long)((x + margin) * (et - st) + st); 

		//int n = (int)((x - border_offset) * PREVIEW_SAMPLES / (getWidth() - border_offset * 2) + 0.5);

		//return (n * et  + (PREVIEW_SAMPLES - n) * st) / PREVIEW_SAMPLES;		
	}