X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fardour_ui2.cc;h=1b16c6a7617a45ef38300c2241b11d20974995bb;hb=ae6dbb836cc1ab1bcbc21883f282361c43f10883;hp=568bfb54edfb6816dcf9a1fe187f5145a56b6afa;hpb=68e943265edf04e63a8e8b8f62bab20f99d9c637;p=ardour.git diff --git a/gtk2_ardour/ardour_ui2.cc b/gtk2_ardour/ardour_ui2.cc index 568bfb54ed..1b16c6a761 100644 --- a/gtk2_ardour/ardour_ui2.cc +++ b/gtk2_ardour/ardour_ui2.cc @@ -25,17 +25,17 @@ #include #include -#include -#include -#include +#include "pbd/error.h" +#include "pbd/basename.h" +#include "pbd/fastlog.h" #include #include #include -#include -#include -#include -#include +#include "ardour/audioengine.h" +#include "ardour/ardour.h" +#include "ardour/profile.h" +#include "ardour/route.h" #include "ardour_ui.h" #include "keyboard.h" @@ -115,7 +115,7 @@ ARDOUR_UI::display_message (const char *prefix, gint prefix_len, RefPtr"; } else { - text = "???"; + text = "???"; } text += prefix; @@ -192,6 +192,10 @@ ARDOUR_UI::setup_transport () transport_tearoff = manage (new TearOff (transport_tearoff_hbox)); transport_tearoff->set_name ("TransportBase"); + if (Profile->get_sae()) { + transport_tearoff->set_can_be_torn_off (false); + } + transport_hbox.pack_start (*transport_tearoff, true, false); transport_base.set_name ("TransportBase"); @@ -367,16 +371,17 @@ ARDOUR_UI::setup_transport () speed_display_box.add (speed_display_label); speed_display_box.set_name (X_("ShuttleDisplay")); + set_size_request_to_display_given_text (speed_display_label, X_("> 24.0"), 2, 2); shuttle_units_button.set_name (X_("ShuttleButton")); shuttle_units_button.signal_clicked().connect (mem_fun(*this, &ARDOUR_UI::shuttle_unit_clicked)); - shuttle_style_button.set_name (X_("ShuttleButton")); + shuttle_style_button.set_name (X_("ShuttleStyleButton")); vector shuttle_strings; shuttle_strings.push_back (_("sprung")); shuttle_strings.push_back (_("wheel")); - set_popdown_strings (shuttle_style_button, shuttle_strings); + set_popdown_strings (shuttle_style_button, shuttle_strings, true); shuttle_style_button.signal_changed().connect (mem_fun (*this, &ARDOUR_UI::shuttle_style_changed)); Frame* sdframe = manage (new Frame); @@ -386,8 +391,9 @@ ARDOUR_UI::setup_transport () mtc_port_changed (); sync_option_combo.signal_changed().connect (mem_fun (*this, &ARDOUR_UI::sync_option_changed)); - const guint32 FUDGE = 25; // Combo's are stupid - they steal space from the entry for the button - set_size_request_to_display_given_text (sync_option_combo, X_("Igternal"), 2+FUDGE, 10); + // XXX HOW TO USE set_popdown_strings() and combo_fudge with this when we don't know + // the real strings till later? + set_size_request_to_display_given_text (sync_option_combo, X_("Igternal"), 4+COMBO_FUDGE, 10); shbox->pack_start (*sdframe, false, false); shbox->pack_start (shuttle_units_button, true, true); @@ -451,13 +457,6 @@ ARDOUR_UI::setup_transport () transport_tearoff_hbox.pack_start (*toggle_box, false, false, 4); transport_tearoff_hbox.pack_start (alert_box, false, false); - VBox* panic_box = manage (new VBox); - midi_panic_button.set_name("TransportMidiPanic"); - midi_panic_button.signal_pressed().connect (mem_fun(*this, &ARDOUR_UI::midi_panic_toggle)); - panic_box->pack_start (midi_panic_button, true, true); - transport_tearoff_hbox.pack_start(*panic_box, true, true, 4); - - if (Profile->get_sae()) { Image* img = manage (new Image ((::get_icon (X_("sae"))))); transport_tearoff_hbox.pack_end (*img, false, false, 6); @@ -525,16 +524,6 @@ ARDOUR_UI::solo_alert_toggle () } } -void -ARDOUR_UI::midi_panic_toggle () -{ - if (session) { - session->midi_panic(); - midi_panic_button.set_active (false); - midi_panic_button.set_state (STATE_NORMAL); - } -} - void ARDOUR_UI::solo_blink (bool onoff) { @@ -675,7 +664,7 @@ ARDOUR_UI::shuttle_box_button_release (GdkEventButton* ev) shuttle_grabbed = false; shuttle_box.remove_modal_grab (); if (Config->get_shuttle_behaviour() == Sprung) { - if (Config->get_auto_play() || roll_button.get_visual_state()) { + if (session->config.get_auto_play() || roll_button.get_visual_state()) { shuttle_fract = SHUTTLE_FRACT_SPEED1; session->request_transport_speed (1.0); stop_button.set_visual_state (0); @@ -785,15 +774,33 @@ ARDOUR_UI::use_shuttle_fract (bool force) last_shuttle_request = now; - bool neg = (shuttle_fract < 0.0); + if (Config->get_shuttle_units() == Semitones) { - double fract = 1 - sqrt (1 - (shuttle_fract * shuttle_fract)); // Formula A1 + const double step = 1.0 / 24.0; // range is 24 semitones up & down + double semitones; + double speed; - if (neg) { - fract = -fract; + 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 + + if (neg) { + fract = -fract; + } + + session->request_transport_speed (shuttle_max_speed * fract); } - session->request_transport_speed (shuttle_max_speed * fract); // Formula A2 shuttle_box.queue_draw (); } @@ -864,10 +871,11 @@ ARDOUR_UI::update_speed_display () if (Config->get_shuttle_units() == Percentage) { snprintf (buf, sizeof (buf), "%.2f", x); } else { + if (x < 0) { - snprintf (buf, sizeof (buf), "< %.1f", 12.0 * fast_log2 (-x)); + snprintf (buf, sizeof (buf), "< %d", (int) round (12.0 * fast_log2 (-x))); } else { - snprintf (buf, sizeof (buf), "> %.1f", 12.0 * fast_log2 (x)); + snprintf (buf, sizeof (buf), "> %d", (int) round (12.0 * fast_log2 (x))); } } speed_display_label.set_text (buf); @@ -892,9 +900,7 @@ ARDOUR_UI::editor_realized () Config->map_parameters (mem_fun (*this, &ARDOUR_UI::parameter_changed)); set_size_request_to_display_given_text (speed_display_box, _("-0.55"), 2, 2); - const guint32 FUDGE = 25; // Combo's are stupid - they steal space from the entry for the button - set_size_request_to_display_given_text (shuttle_style_button, _("sprung"), 2+FUDGE, 10); - reset_dpi(); + reset_dpi (); } void