projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check master sources when determining whether a region uses a source. should fix...
[ardour.git]
/
gtk2_ardour
/
shuttle_control.cc
diff --git
a/gtk2_ardour/shuttle_control.cc
b/gtk2_ardour/shuttle_control.cc
index aaa22f50897763b31d4ed16f2044d090d84b6af3..a4a83d7018fe2b443f49483865c5c08a617fb5f8 100644
(file)
--- a/
gtk2_ardour/shuttle_control.cc
+++ b/
gtk2_ardour/shuttle_control.cc
@@
-18,7
+18,7
@@
#include <algorithm>
#include <algorithm>
-#include <cairo
/cairo
.h>
+#include <cairo.h>
#include "ardour/ardour.h"
#include "ardour/audioengine.h"
#include "ardour/ardour.h"
#include "ardour/audioengine.h"
@@
-31,6
+31,7
@@
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/rgb_macros.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/rgb_macros.h"
+#include "actions.h"
#include "ardour_ui.h"
#include "rgb_macros.h"
#include "shuttle_control.h"
#include "ardour_ui.h"
#include "rgb_macros.h"
#include "shuttle_control.h"
@@
-290,6
+291,9
@@
ShuttleControl::on_button_release_event (GdkEventButton* ev)
gdk_pointer_ungrab (GDK_CURRENT_TIME);
if (Config->get_shuttle_behaviour() == Sprung) {
gdk_pointer_ungrab (GDK_CURRENT_TIME);
if (Config->get_shuttle_behaviour() == Sprung) {
+ if (shuttle_speed_on_grab == 0 ) {
+ _session->request_transport_speed (1.0);
+ }
_session->request_transport_speed (shuttle_speed_on_grab);
} else {
mouse_shuttle (ev->x, true);
_session->request_transport_speed (shuttle_speed_on_grab);
} else {
mouse_shuttle (ev->x, true);
@@
-424,10
+428,10
@@
ShuttleControl::mouse_shuttle (double x, bool force)
}
void
}
void
-ShuttleControl::set_shuttle_fract (double f)
+ShuttleControl::set_shuttle_fract (double f
, bool zero_ok
)
{
shuttle_fract = f;
{
shuttle_fract = f;
- use_shuttle_fract (false);
+ use_shuttle_fract (false
, zero_ok
);
}
int
}
int
@@
-469,7
+473,7
@@
ShuttleControl::fract_as_semitones (float fract, bool& reverse)
}
void
}
void
-ShuttleControl::use_shuttle_fract (bool force)
+ShuttleControl::use_shuttle_fract (bool force
, bool zero_ok
)
{
microseconds_t now = get_microseconds();
{
microseconds_t now = get_microseconds();
@@
-500,7
+504,11
@@
ShuttleControl::use_shuttle_fract (bool force)
speed = shuttle_max_speed * shuttle_fract;
}
speed = shuttle_max_speed * shuttle_fract;
}
- _session->request_transport_speed_nonzero (speed, true);
+ if (zero_ok) {
+ _session->request_transport_speed (speed, Config->get_shuttle_behaviour() == Wheel);
+ } else {
+ _session->request_transport_speed_nonzero (speed, Config->get_shuttle_behaviour() == Wheel);
+ }
}
void
}
void
@@
-654,25
+662,13
@@
ShuttleControl::ShuttleControllable::ShuttleControllable (ShuttleControl& s)
void
ShuttleControl::ShuttleControllable::set_value (double val)
{
void
ShuttleControl::ShuttleControllable::set_value (double val)
{
- double fract;
-
- if (val == 0.5) {
- fract = 0.0;
- } else {
- if (val < 0.5) {
- fract = -((0.5 - val)/0.5);
- } else {
- fract = ((val - 0.5)/0.5);
- }
- }
-
- sc.set_shuttle_fract (fract);
+ sc.set_shuttle_fract ((val - lower()) / (upper() - lower()), true);
}
double
ShuttleControl::ShuttleControllable::get_value () const
{
}
double
ShuttleControl::ShuttleControllable::get_value () const
{
- return
sc.get_shuttle_fract (
);
+ return
lower() + (sc.get_shuttle_fract () * (upper() - lower())
);
}
void
}
void