/*! \file widget_timeslider.cpp
** \brief Time Slider Widget Implementation File
**
-** $Id: widget_timeslider.cpp,v 1.1.1.1 2005/01/07 03:34:37 darco Exp $
+** $Id$
**
** \legal
** Copyright (c) 2004 Adrian Bentley
+** Copyright (c) 2007 Chris Moore
**
** This package is free software; you can redistribute it and/or
** modify it under the terms of the GNU General Public License as
static Gdk::Color
color_darken(Gdk::Color x, float amount)
{
- x.set_rgb_p(
- x.get_red_p()*amount,
- x.get_green_p()*amount,
- x.get_blue_p()*amount
- );
+ double red = x.get_red_p() * amount;
+ double green = x.get_green_p() * amount;
+ double blue = x.get_blue_p() * amount;
+
+ x.set_rgb_p( red > 1 ? 1 : red,
+ green > 1 ? 1 : green,
+ blue > 1 ? 1 : blue);
+
return x;
}
/* === M E T H O D S ======================================================= */
/* === E N T R Y P O I N T ================================================= */
-double defaultfps = 0;
+double defaultfps = 24;
const int fullheight = 20;
Widget_Timeslider::Widget_Timeslider()
}
}*/
-bool Widget_Timeslider::redraw(bool doublebuffer)
+bool Widget_Timeslider::redraw(bool /*doublebuffer*/)
{
Glib::RefPtr<Gdk::Window> window = get_window();
//search around this area to get the right one
- //get first valid line and it's position in pixel space
+ //get first valid line and its position in pixel space
double time = 0;
double pixel = 0;
double subr = scale / subdiv;
- //get it's position inside...
+ //get its position inside...
time = ceil(start/subr)*subr - start;
pixel = time*dpdt;