set_size_request (100, 15);
set_name (X_("ShuttleControl"));
- Config->ParameterChanged.connect (parameter_connection, MISSING_INVALIDATOR, ui_bind (&ShuttleControl::parameter_changed, this, _1), gui_context());
+ Config->ParameterChanged.connect (parameter_connection, MISSING_INVALIDATOR, boost::bind (&ShuttleControl::parameter_changed, this, _1), gui_context());
/* gtkmm 2.4: the C++ wrapper doesn't work */
g_signal_connect ((GObject*) gobj(), "query-tooltip", G_CALLBACK (qt), NULL);
return true;
}
+ bool semis = (Config->get_shuttle_units() == Semitones);
+
switch (ev->direction) {
case GDK_SCROLL_UP:
case GDK_SCROLL_RIGHT:
- shuttle_fract += 0.005;
+ if (semis) {
+ if (shuttle_fract == 0) {
+ shuttle_fract = semitones_as_fract (1, false);
+ } else {
+ bool rev;
+ int st = fract_as_semitones (shuttle_fract, rev);
+ shuttle_fract = semitones_as_fract (st + 1, rev);
+ }
+ } else {
+ shuttle_fract += 0.00125;
+ }
break;
case GDK_SCROLL_DOWN:
case GDK_SCROLL_LEFT:
- shuttle_fract -= 0.005;
+ if (semis) {
+ if (shuttle_fract == 0) {
+ shuttle_fract = semitones_as_fract (1, true);
+ } else {
+ bool rev;
+ int st = fract_as_semitones (shuttle_fract, rev);
+ shuttle_fract = semitones_as_fract (st - 1, rev);
+ }
+ } else {
+ shuttle_fract -= 0.00125;
+ }
break;
default:
return false;
}
-
- if (Config->get_shuttle_units() == Semitones) {
+
+ if (semis) {
float lower_side_of_dead_zone = semitones_as_fract (-24, true);
float upper_side_of_dead_zone = semitones_as_fract (-24, false);
}
bool
-ShuttleControl::on_expose_event (GdkEventExpose* event)
+ShuttleControl::on_expose_event (GdkEventExpose*)
{
cairo_text_extents_t extents;
Glib::RefPtr<Gdk::Window> win (get_window());
if (Config->get_shuttle_units() == Percentage) {
if (speed == 1.0) {
- snprintf (buf, sizeof (buf), _("Playing"));
+ snprintf (buf, sizeof (buf), "%s", _("Playing"));
} else {
if (speed < 0.0) {
snprintf (buf, sizeof (buf), "<<< %d%%", (int) round (-speed * 100));
}
} else {
- snprintf (buf, sizeof (buf), _("Stopped"));
+ snprintf (buf, sizeof (buf), "%s", _("Stopped"));
}
last_speed_displayed = speed;
switch (Config->get_shuttle_behaviour()) {
case Sprung:
- snprintf (buf, sizeof (buf), _("Sprung"));
+ snprintf (buf, sizeof (buf), "%s", _("Sprung"));
break;
case Wheel:
- snprintf (buf, sizeof (buf), _("Wheel"));
+ snprintf (buf, sizeof (buf), "%s", _("Wheel"));
break;
}
{
}
-void
-ShuttleControl::ShuttleControllable::set_id (const std::string& str)
-{
- _id = str;
-}
-
void
ShuttleControl::ShuttleControllable::set_value (double val)
{