package util;

import java.util.regex.Pattern;

public class AssTime {
	public int h;
	public int m;
	public int s;
	public int hs;
	public AssTime(String format) {
		// to do add check
		
		
		
		format = format.replace(".", ":");
		Pattern p = Pattern.compile(":");

		String[] items = p.split(format);
		h = Integer.parseInt(items[0]);
		m = Integer.parseInt(items[1]);
		s = Integer.parseInt(items[2]);
		hs = Integer.parseInt(items[3]);
		
	}
	public int toMillis(){
		int ms = hs * 10 + s * 1000 + m * 60000 + h * 3600000;
		return ms;
	}
	public String toString(){
		String ret = String.format("%d:%02d:%02d.%02d", h,m,s,hs);
		return ret;
	}
	public int toFrame(float frameRate){
		float ms = (float)this.toMillis();
		float f = ms*frameRate/1000.0f;
		return (int)f;
	}
}

@@ -194,20 +194,8 @@
 ck%0D%0A
-%09%09%0D%0A%09%09%0D%0A%09%09%0D%0A
 %09%09fo
@@ -228,16 +228,16 @@
  %22:%22);%0D%0A
+
 %09%09Patter
@@ -265,18 +265,16 @@
 (%22:%22);%0D%0A
-%0D%0A
 %09%09String
@@ -447,16 +447,16 @@
 );%0D%0A
-
 %09%09%0D%0A%09%7D%0D%0A
 %09pub
@@ -447,24 +447,187 @@
 );%0D%0A%09%09%0D%0A%09%7D%0D%0A
+%09public AssTime(int ms) %7B%0D%0A%09%09int h  = (ms / 3600000) %25 10;%0D%0A%09%09int m  = (ms %25 3600000) / 60000;%0D%0A%09%09int s  = (ms %25 60000) / 1000;%0D%0A%09%09int hs = (ms %25 1000) / 10;%0D%0A%09%7D%0D%0A
 %09public int 

add asstime constructor from ms,clean some blank line.