--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.Linq;\r
+using System.Text;\r
+\r
+namespace HandBrake.Interop\r
+{\r
+ public static class Converters\r
+ {\r
+ private static Dictionary<double, int> vrates = new Dictionary<double, int>\r
+ {\r
+ {5, 5400000},\r
+ {10, 2700000},\r
+ {12, 2250000},\r
+ {15, 1800000},\r
+ {23.976, 1126125},\r
+ {24, 1125000},\r
+ {25, 1080000},\r
+ {29.97, 900900}\r
+ };\r
+\r
+ public static int FramerateToVrate(double framerate)\r
+ {\r
+ if (!vrates.ContainsKey(framerate))\r
+ {\r
+ throw new ArgumentException("Framerate not recognized.", "framerate");\r
+ }\r
+\r
+ return vrates[framerate];\r
+ }\r
+ }\r
+}\r