#include "midi_tracer.h"
#include "global_port_matrix.h"
#include "location_ui.h"
+#include "rc_option_editor.h"
#include "i18n.h"
ActionManager::get_action ("Transport", "TogglePunchIn")->connect_proxy (punch_in_button);
ActionManager::get_action ("Transport", "TogglePunchOut")->connect_proxy (punch_out_button);
+ click_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::click_button_clicked), false);
+
preroll_button.set_name ("TransportButton");
postroll_button.set_name ("TransportButton");
gint
ARDOUR_UI::mouse_shuttle (double x, bool force)
{
- double half_width = shuttle_box.get_width() / 2.0;
+ double const half_width = shuttle_box.get_width() / 2.0;
double distance = x - half_width;
if (distance > 0) {
last_shuttle_request = now;
- if (Config->get_shuttle_units() == Semitones) {
+ double speed = 0;
- const double step = 1.0 / 24.0; // range is 24 semitones up & down
- double semitones;
- double speed;
+ if (Config->get_shuttle_units() == Semitones) {
- semitones = round (shuttle_fract / step);
+ double const step = 1.0 / 24.0; // range is 24 semitones up & down
+ double const semitones = round (shuttle_fract / step);
speed = pow (2.0, (semitones / 12.0));
- _session->request_transport_speed (speed);
-
} else {
- bool neg;
- double fract;
-
- neg = (shuttle_fract < 0.0);
-
- fract = 1 - sqrt (1 - (shuttle_fract * shuttle_fract)); // Formula A1
+ bool const neg = (shuttle_fract < 0.0);
+ double fract = 1 - sqrt (1 - (shuttle_fract * shuttle_fract)); // Formula A1
if (neg) {
fract = -fract;
}
- _session->request_transport_speed (shuttle_max_speed * fract);
+ speed = shuttle_max_speed * fract;
}
-
+
+ _session->request_transport_speed_nonzero (speed);
+
shuttle_box.queue_draw ();
}
transport_tearoff->set_visible (true);
editor->restore_editing_space ();
}
+
+bool
+ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
+{
+ if (ev->button != 3) {
+ /* this handler is just for button-3 clicks */
+ return false;
+ }
+
+ RefPtr<Action> act = ActionManager::get_action (X_("Common"), X_("ToggleRCOptionsEditor"));
+ assert (act);
+
+ RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
+ tact->set_active ();
+
+ rc_option_editor->set_current_page (_("Misc"));
+ return true;
+}