-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** This package is free software; you can redistribute it and/or
+** modify it under the terms of the GNU General Public License as
+** published by the Free Software Foundation; either version 2 of
+** the License, or (at your option) any later version.
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
+** This package is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+** General Public License for more details.
if(selected)
gc->set_line_attributes(2,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
else
if(selected)
gc->set_line_attributes(2,Gdk::LINE_SOLID,Gdk::CAP_BUTT,Gdk::JOIN_MITER);
else
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
points.push_back(Gdk::Point(area.get_x()+area.get_width()/2,area.get_y()+area.get_height()));
window->draw_polygon(gc,true,points);
gc->set_rgb_fg_color(black);
adj_default(0,0,2,1/defaultfps,10/defaultfps),
adj_timescale(0),
//invalidated(false),
adj_default(0,0,2,1/defaultfps,10/defaultfps),
adj_timescale(0),
//invalidated(false),
//disconnect old connections
time_value_change.disconnect();
time_other_change.disconnect();
//disconnect old connections
time_value_change.disconnect();
time_other_change.disconnect();
double l = adj_timescale->get_lower(),
u = adj_timescale->get_upper(),
v = adj_timescale->get_value();
double l = adj_timescale->get_lower(),
u = adj_timescale->get_upper(),
v = adj_timescale->get_value();
//Get the data for the window and the params to draw it...
int w = get_width(), h = get_height();
//Get the data for the window and the params to draw it...
int w = get_width(), h = get_height();
-
- window->draw_rectangle(gc,true,0,0,w,h);
-
+
+ window->draw_rectangle(gc,true,0,0,w,h);
+
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
//Draw the time line...
double tpx = (current-start)*dpdt;
gc->set_rgb_fg_color(Gdk::Color("#ffaf00"));
window->draw_line(gc,round_to_int(tpx),0,round_to_int(tpx),fullheight);
//Draw the time line...
double tpx = (current-start)*dpdt;
gc->set_rgb_fg_color(Gdk::Color("#ffaf00"));
window->draw_line(gc,round_to_int(tpx),0,round_to_int(tpx),fullheight);
//1h 45 30 20 10 5
//..., 3m, 2m, 1m30s, 1m, 30s, 20s, 10s, 5s, 3s, 2s, 1s, 0.5s
//frames... (how???)
//1h 45 30 20 10 5
//..., 3m, 2m, 1m30s, 1m, 30s, 20s, 10s, 5s, 3s, 2s, 1s, 0.5s
//frames... (how???)
{ 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);
{ 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;
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;
//find most ideal scale
double scale = ranges[0];
{
double *val = binary_find(ranges, ranges+ranges_size, midrange);
double *after = val+1;
-
- //synfig::info("Range found: (l %.2lf,u %.2lf - m %.2lf) -> %.2lf",lowerrange,upperrange,midrange,scale);
-
- //search around this area to get the right one
-
-
+
+ //synfig::info("Range found: (l %.2lf,u %.2lf - m %.2lf) -> %.2lf",lowerrange,upperrange,midrange,scale);
+
+ //search around this area to get the right one
+
+
{ //inside the big'n
double t = (time/scale - floor(time/scale))*subdiv; // the difference from the big mark in 0:1
//sdindex = (int)floor(t + 0.5); //get how far through the range it is...
sdindex = round_to_int(t); //get how far through the range it is...
{ //inside the big'n
double t = (time/scale - floor(time/scale))*subdiv; // the difference from the big mark in 0:1
//sdindex = (int)floor(t + 0.5); //get how far through the range it is...
sdindex = round_to_int(t); //get how far through the range it is...
//synfig::info("Initial values: %.4lf t, %.1lf pixels, %d i", time,pixel,sdindex);
//synfig::info("Initial values: %.4lf t, %.1lf pixels, %d i", time,pixel,sdindex);
if(sdindex == 0)
{
window->draw_line(gc,xpx,0,xpx,heightbig);
if(sdindex == 0)
{
window->draw_line(gc,xpx,0,xpx,heightbig);
Time tm((double)time);
if(get_global_fps()) tm.round(get_global_fps());
Glib::ustring timecode(tm.get_string(get_global_fps(),App::get_time_format()));
Time tm((double)time);
if(get_global_fps()) tm.round(get_global_fps());
Glib::ustring timecode(tm.get_string(get_global_fps(),App::get_time_format()));
//gc->set_rgb_fg_color(Gdk::Color("#000000"));
layout->set_text(timecode);
window->draw_layout(gc,xpx+2,heightsmall,layout);
}else
{
//gc->set_rgb_fg_color(Gdk::Color("#000000"));
layout->set_text(timecode);
window->draw_layout(gc,xpx+2,heightsmall,layout);
}else
{
- window->draw_line(gc,xpx,0,xpx,heightsmall);
+ window->draw_line(gc,xpx,0,xpx,heightsmall);
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper();
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper();
//Note: Use inverse of mouse movement because of conceptual space relationship
double diff = lastx - curx; //curx - lastx;
//Note: Use inverse of mouse movement because of conceptual space relationship
double diff = lastx - curx; //curx - lastx;
//synfig::info("Scrolling timerange to (%.4f,%.4f)",start,end);
//synfig::info("Scrolling timerange to (%.4f,%.4f)",start,end);
//get time from drag...
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
double t = start + curx*(end - start)/get_width();
//get time from drag...
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
double t = start + curx*(end - start)/get_width();
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
//calculate new beginning and end
end = focuspoint + (end-focuspoint)*zoominfactor;
start = focuspoint + (start-focuspoint)*zoominfactor;
//calculate new beginning and end
end = focuspoint + (end-focuspoint)*zoominfactor;
start = focuspoint + (start-focuspoint)*zoominfactor;
//synfig::info("Zooming in timerange to (%.4f,%.4f)",start,end);
if(adj_bounds)
{
//synfig::info("Zooming in timerange to (%.4f,%.4f)",start,end);
if(adj_bounds)
{
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
//calculate new beginning and end
end = focuspoint + (end-focuspoint)*zoomoutfactor;
start = focuspoint + (start-focuspoint)*zoomoutfactor;
//calculate new beginning and end
end = focuspoint + (end-focuspoint)*zoomoutfactor;
start = focuspoint + (start-focuspoint)*zoomoutfactor;
//synfig::info("Zooming out timerange to (%.4f,%.4f)",start,end);
if(adj_bounds)
{
//synfig::info("Zooming out timerange to (%.4f,%.4f)",start,end);
if(adj_bounds)
{
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
double start = adj_timescale->get_lower(),
end = adj_timescale->get_upper(),
current = adj_timescale->get_value();
current, vt, start, end, event->x, w, fps);*/
current, vt, start, end, event->x, w, fps);*/