- gc->set_rgb_fg_color(Gdk::Color("#333333"));
-
- //draw these lines... (always 5 between) maybe 6?
- const int subdiv = 4;
-
- //1h 45 30 20 10 5
- //..., 3m, 2m, 1m30s, 1m, 30s, 20s, 10s, 5s, 3s, 2s, 1s, 0.5s
- //frames... (how???)
- double ranges[] =
- { 1.0/fps,subdiv/fps,0.25,0.5, 1, 2, 3, 5, 10, 20, 30, 60, 90, 120, 180, 300, 600, 1200, 1800, 2700, 3600 };
- //{ 3600, 2700, 1800, 1200, 600, 300, 180, 120, 90, 60, 30, 20, 10, 5, 3, 2, 1, 0.5 };
- const int ranges_size = sizeof(ranges)/sizeof(double);
-
- double lowerrange = dtdp*75, upperrange = dtdp*150;
- double midrange = (lowerrange + upperrange)/2;
-
- //find most ideal scale
- double scale = ranges[0];
- {
- double *val = binary_find(ranges, ranges+ranges_size, midrange);
- double *after = val+1;
-
- if(val >= ranges+ranges_size)
- {
- val = ranges+ranges_size-1;
- }
-
- if(after >= ranges+ranges_size)
+ gc->set_rgb_fg_color(Gdk::Color("#333333"));
+
+ int ifps = round_to_int(fps);
+ if (ifps < 1) ifps = 1;
+
+ std::vector<double> ranges;
+
+ unsigned int pos = 0;
+
+ // build a list of all the factors of the frame rate
+ for (int i = 1; i*i <= ifps; i++)
+ if ((ifps%i) == 0)