Temporarily revert ongoing varispeed development
This revertsbf88f3fe64
until35813db0f4
in order to move development into a branch, until after the upcoming 6.8 release
This commit is contained in:
parent
35813db0f4
commit
83b9ab1bee
|
@ -2013,13 +2013,13 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd)
|
|||
|
||||
if (fwd) {
|
||||
if (transport_speed <= 0) {
|
||||
_session->request_transport_speed (1.0);
|
||||
_session->request_transport_speed (1.0, false);
|
||||
_session->request_roll (TRS_UI);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (transport_speed >= 0) {
|
||||
_session->request_transport_speed (-1.0);
|
||||
_session->request_transport_speed (-1.0, false);
|
||||
_session->request_roll (TRS_UI);
|
||||
return;
|
||||
}
|
||||
|
@ -2034,12 +2034,12 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd)
|
|||
|
||||
if (fwd) {
|
||||
if (transport_speed <= 0) {
|
||||
_session->request_transport_speed (1.0);
|
||||
_session->request_transport_speed (1.0, false);
|
||||
_session->request_roll (TRS_UI);
|
||||
}
|
||||
} else {
|
||||
if (transport_speed >= 0) {
|
||||
_session->request_transport_speed (-1.0);
|
||||
_session->request_transport_speed (-1.0, false);
|
||||
_session->request_roll (TRS_UI);
|
||||
}
|
||||
}
|
||||
|
@ -2086,7 +2086,7 @@ ARDOUR_UI::transport_ffwd_rewind (bool fwd)
|
|||
|
||||
speed = semitone_ratio * transport_speed;
|
||||
speed = std::max (-maxspeed, std::min (maxspeed, speed));
|
||||
_session->request_transport_speed (speed);
|
||||
_session->request_transport_speed (speed, false);
|
||||
_session->request_roll (TRS_UI);
|
||||
|
||||
}
|
||||
|
|
|
@ -82,7 +82,6 @@
|
|||
#include "video_timeline.h"
|
||||
|
||||
#include "widgets/ardour_button.h"
|
||||
#include "widgets/ardour_dropdown.h"
|
||||
#include "widgets/ardour_spacer.h"
|
||||
|
||||
#include "add_route_dialog.h"
|
||||
|
@ -485,9 +484,6 @@ private:
|
|||
void update_transport_clocks (samplepos_t pos);
|
||||
void record_state_changed ();
|
||||
|
||||
ArdourWidgets::ArdourDropdown _varispeed_pulldown;
|
||||
void set_default_play_spd_from_menu (double spd);
|
||||
|
||||
std::list<MidiTracer*> _midi_tracer_windows;
|
||||
|
||||
/* Transport Control */
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
#include <gtkmm/menu.h>
|
||||
#include <gtkmm/menuitem.h>
|
||||
|
||||
#include <sigc++/bind.h>
|
||||
#include <gtkmm/settings.h>
|
||||
|
||||
|
@ -82,7 +79,6 @@ using namespace ArdourWidgets;
|
|||
using namespace Gtk;
|
||||
using namespace Glib;
|
||||
using namespace ARDOUR_UI_UTILS;
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
void
|
||||
ARDOUR_UI::setup_tooltips ()
|
||||
|
@ -102,8 +98,6 @@ ARDOUR_UI::setup_tooltips ()
|
|||
|
||||
set_tip (latency_disable_button, _("Disable all Plugin Delay Compensation. This results in the shortest delay from live input to output, but any paths with delay-causing plugins will sound later than those without."));
|
||||
|
||||
set_tip (_varispeed_pulldown, _("Varispeed: change the default playback and recording speed"));
|
||||
|
||||
synchronize_sync_source_and_video_pullup ();
|
||||
|
||||
editor->setup_tooltips ();
|
||||
|
@ -534,9 +528,9 @@ ARDOUR_UI::setup_transport ()
|
|||
ssbox->set_spacing (PX_SCALE(2));
|
||||
ssbox->pack_start (sync_button, false, false, 0);
|
||||
ssbox->pack_start (shuttle_box, true, true, 0);
|
||||
ssbox->pack_start (_varispeed_pulldown, false, false, 0);
|
||||
ssbox->pack_start (*shuttle_box.info_button(), false, false, 0);
|
||||
|
||||
|
||||
/* and the main table layout */
|
||||
int vpadding = 1;
|
||||
int hpadding = 2;
|
||||
|
@ -636,20 +630,6 @@ ARDOUR_UI::setup_transport ()
|
|||
transport_table.attach (editor_visibility_button, TCOL, 0, 1 , FILL, SHRINK, hpadding, vpadding);
|
||||
++col;
|
||||
|
||||
// _varispeed_pulldown.set_icon (ArdourIcon::RecButton);
|
||||
_varispeed_pulldown.set_text(_("Vari"));
|
||||
// _varispeed_pulldown.set_icon(record_tape_red);
|
||||
_varispeed_pulldown.AddMenuElem (MenuElem (_("None"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_default_play_spd_from_menu), 1.0)));
|
||||
_varispeed_pulldown.AddMenuElem (SeparatorElem());
|
||||
_varispeed_pulldown.AddMenuElem (MenuElem (_("-10 cents"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_default_play_spd_from_menu), ShuttleControl::cents_as_speed(-10, false))));
|
||||
_varispeed_pulldown.AddMenuElem (MenuElem (_("+10 cents"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_default_play_spd_from_menu), ShuttleControl::cents_as_speed(10, false))));
|
||||
_varispeed_pulldown.AddMenuElem (SeparatorElem());
|
||||
_varispeed_pulldown.AddMenuElem (MenuElem (_("-1 semitone"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_default_play_spd_from_menu), ShuttleControl::semitones_as_speed(-1, false))));
|
||||
_varispeed_pulldown.AddMenuElem (MenuElem (_("+1 semitone"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_default_play_spd_from_menu), ShuttleControl::semitones_as_speed(1, false))));
|
||||
_varispeed_pulldown.AddMenuElem (SeparatorElem());
|
||||
_varispeed_pulldown.AddMenuElem (MenuElem (_("-1 octave"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_default_play_spd_from_menu), ShuttleControl::semitones_as_speed(-12, false))));
|
||||
_varispeed_pulldown.AddMenuElem (MenuElem (_("+1 octave"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::set_default_play_spd_from_menu), ShuttleControl::semitones_as_speed(12, false))));
|
||||
|
||||
/* initialize */
|
||||
latency_switch_changed ();
|
||||
session_latency_updated (true);
|
||||
|
@ -769,12 +749,6 @@ ARDOUR_UI::layered_button_clicked ()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::set_default_play_spd_from_menu (double spd)
|
||||
{
|
||||
_session->set_default_play_speed(spd);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::solo_blink (bool onoff)
|
||||
{
|
||||
|
|
|
@ -2115,7 +2115,7 @@ Editor::scrub (samplepos_t sample, double current_x)
|
|||
if (scrubbing_direction == 0) {
|
||||
/* first move */
|
||||
_session->request_locate (sample, MustStop);
|
||||
_session->request_transport_speed (0.1);
|
||||
_session->request_transport_speed (0.1, false);
|
||||
scrubbing_direction = 1;
|
||||
|
||||
} else {
|
||||
|
@ -2139,7 +2139,7 @@ Editor::scrub (samplepos_t sample, double current_x)
|
|||
scrub_reverse_distance = 0;
|
||||
|
||||
delta = 0.01 * (last_scrub_x - current_x);
|
||||
_session->request_transport_speed_nonzero (_session->actual_speed() - delta);
|
||||
_session->request_transport_speed_nonzero (_session->actual_speed() - delta, false);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -2158,7 +2158,7 @@ Editor::scrub (samplepos_t sample, double current_x)
|
|||
scrub_reverse_distance = 0;
|
||||
|
||||
delta = 0.01 * (current_x - last_scrub_x);
|
||||
_session->request_transport_speed_nonzero (_session->actual_speed() + delta);
|
||||
_session->request_transport_speed_nonzero (_session->actual_speed() + delta, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2170,11 +2170,11 @@ Editor::scrub (samplepos_t sample, double current_x)
|
|||
|
||||
if (scrubbing_direction > 0) {
|
||||
/* was forwards, go backwards */
|
||||
_session->request_transport_speed (-0.1);
|
||||
_session->request_transport_speed (-0.1, false);
|
||||
scrubbing_direction = -1;
|
||||
} else {
|
||||
/* was backwards, go forwards */
|
||||
_session->request_transport_speed (0.1);
|
||||
_session->request_transport_speed (0.1, false);
|
||||
scrubbing_direction = 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -2673,7 +2673,7 @@ Editor::transition_to_rolling (bool fwd)
|
|||
return;
|
||||
}
|
||||
|
||||
_session->request_transport_speed (fwd ? _session->default_play_speed() : -_session->default_play_speed());
|
||||
_session->request_transport_speed (fwd ? 1.0f : -1.0f, false);
|
||||
_session->request_roll ();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
#include <algorithm>
|
||||
#include <gtkmm/stock.h>
|
||||
|
||||
#include <gtkmm/menu.h>
|
||||
#include <gtkmm/menuitem.h>
|
||||
|
||||
#include "pbd/string_convert.h"
|
||||
|
||||
#include "ardour/audioengine.h"
|
||||
|
@ -69,8 +66,6 @@ using namespace Gtkmm2ext;
|
|||
using namespace ArdourWidgets;
|
||||
using namespace Gtk;
|
||||
using namespace std;
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
|
||||
#define PX_SCALE(px) std::max ((float)px, rintf ((float)px* UIConfiguration::instance ().get_ui_scale ()))
|
||||
|
||||
|
@ -236,9 +231,6 @@ RecorderUI::RecorderUI ()
|
|||
_button_table.attach (_btn_new_plist_rec, col, col + 2, 1, 2 , FILL, SHRINK, hpadding, vpadding);
|
||||
col += 2;
|
||||
|
||||
_button_table.attach (*(manage (new ArdourVSpacer ())), col, col + 1, 0, 2, FILL, FILL, spacepad, vpadding);
|
||||
col += 1;
|
||||
|
||||
_toolbar.pack_start (_button_table, false, false);
|
||||
_toolbar.pack_end (_btn_peak_reset, false, false, 4);
|
||||
_toolbar.pack_end (_remain_info_box, false, false, 4);
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
|
||||
#include "input_port_monitor.h"
|
||||
#include "rec_info_box.h"
|
||||
#include "shuttle_control.h"
|
||||
#include "transport_control_ui.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#include "actions.h"
|
||||
#include "rgb_macros.h"
|
||||
#include "shuttle_control.h"
|
||||
#include "timers.h"
|
||||
|
||||
#include "pbd/i18n.h"
|
||||
|
||||
|
@ -60,90 +59,17 @@ gboolean qt (gboolean, gint, gint, gboolean, Gtk::Tooltip*, gpointer)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
ShuttleInfoButton::~ShuttleInfoButton ()
|
||||
{
|
||||
delete disp_context_menu;
|
||||
}
|
||||
|
||||
ShuttleInfoButton::ShuttleInfoButton ()
|
||||
{
|
||||
set_layout_font (UIConfiguration::instance().get_NormalFont());
|
||||
set_sizing_text (S_("LogestShuttle|+00 st"));
|
||||
set_tooltip (*this, _("Speed Display (Context-click for options)"));
|
||||
set_name ("shuttle text");
|
||||
set_visual_state (Gtkmm2ext::NoVisualState);
|
||||
set_elements (ArdourButton::Text);
|
||||
|
||||
Config->ParameterChanged.connect (parameter_connection, MISSING_INVALIDATOR, boost::bind (&ShuttleInfoButton::parameter_changed, this, _1), gui_context());
|
||||
|
||||
add_events (Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK|Gdk::BUTTON_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::POINTER_MOTION_MASK|Gdk::SCROLL_MASK);
|
||||
|
||||
disp_context_menu = 0;
|
||||
_ignore_change = false;
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleInfoButton::set_shuttle_units (ShuttleUnits s)
|
||||
{
|
||||
if (_ignore_change) {
|
||||
return;
|
||||
}
|
||||
Config->set_shuttle_units (s);
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleInfoButton::parameter_changed (std::string p)
|
||||
{
|
||||
/* units changed; recreate the menu when it is next opened to show the current selection*/
|
||||
if (p == "shuttle-units") {
|
||||
delete disp_context_menu;
|
||||
disp_context_menu = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
ShuttleInfoButton::on_button_press_event (GdkEventButton* ev)
|
||||
{
|
||||
if (Keyboard::is_context_menu_event (ev)) {
|
||||
if (disp_context_menu == 0) {
|
||||
build_disp_context_menu ();
|
||||
}
|
||||
disp_context_menu->popup (ev->button, ev->time);
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShuttleInfoButton::build_disp_context_menu ()
|
||||
{
|
||||
PBD::Unwinder<bool> uw (_ignore_change, true);
|
||||
|
||||
using namespace Menu_Helpers;
|
||||
|
||||
disp_context_menu = new Gtk::Menu();
|
||||
MenuList& items = disp_context_menu->items();
|
||||
|
||||
RadioMenuItem::Group units_group;
|
||||
|
||||
items.push_back (RadioMenuElem (units_group, _("Percent"), sigc::bind (sigc::mem_fun (*this, &ShuttleInfoButton::set_shuttle_units), Percentage)));
|
||||
if (Config->get_shuttle_units() == Percentage) {
|
||||
static_cast<RadioMenuItem*>(&items.back())->set_active();
|
||||
}
|
||||
items.push_back (RadioMenuElem (units_group, _("Semitones"), sigc::bind (sigc::mem_fun (*this, &ShuttleInfoButton::set_shuttle_units), Semitones)));
|
||||
if (Config->get_shuttle_units() == Semitones) {
|
||||
static_cast<RadioMenuItem*>(&items.back())->set_active();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
ShuttleControl::ShuttleControl ()
|
||||
: _controllable (new ShuttleControllable (*this))
|
||||
, binding_proxy (_controllable)
|
||||
{
|
||||
_info_button.set_layout_font (UIConfiguration::instance().get_NormalFont());
|
||||
_info_button.set_sizing_text (S_("LogestShuttle|< +00 st"));
|
||||
_info_button.set_name ("shuttle text");
|
||||
_info_button.set_sensitive (false);
|
||||
_info_button.set_visual_state (Gtkmm2ext::NoVisualState);
|
||||
_info_button.set_elements (ArdourButton::Text);
|
||||
|
||||
set_tooltip (*this, _("Shuttle speed control (Context-click for options)"));
|
||||
|
||||
pattern = 0;
|
||||
|
@ -175,7 +101,6 @@ ShuttleControl::ShuttleControl ()
|
|||
|
||||
Config->ParameterChanged.connect (parameter_connection, MISSING_INVALIDATOR, boost::bind (&ShuttleControl::parameter_changed, this, _1), gui_context());
|
||||
UIConfiguration::instance().ColorsChanged.connect (sigc::mem_fun (*this, &ShuttleControl::set_colors));
|
||||
Timers::blink_connect (sigc::mem_fun (*this, &ShuttleControl::do_blink));
|
||||
|
||||
/* gtkmm 2.4: the C++ wrapper doesn't work */
|
||||
g_signal_connect ((GObject*) gobj(), "query-tooltip", G_CALLBACK (qt), NULL);
|
||||
|
@ -189,17 +114,6 @@ ShuttleControl::~ShuttleControl ()
|
|||
delete shuttle_context_menu;
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::do_blink (bool onoff)
|
||||
{
|
||||
if (!shuttle_grabbed && _session && _session->default_play_speed()!=1.0) {
|
||||
_info_button.set_active(onoff);
|
||||
} else {
|
||||
_info_button.set_active(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ShuttleControl::set_session (Session *s)
|
||||
{
|
||||
|
@ -208,7 +122,6 @@ ShuttleControl::set_session (Session *s)
|
|||
if (_session) {
|
||||
set_sensitive (true);
|
||||
_session->add_controllable (_controllable);
|
||||
_info_button.set_session (s);
|
||||
} else {
|
||||
set_sensitive (false);
|
||||
}
|
||||
|
@ -245,61 +158,13 @@ ShuttleControl::on_size_allocate (Gtk::Allocation& alloc)
|
|||
void
|
||||
ShuttleControl::map_transport_state ()
|
||||
{
|
||||
float speed = 0.0;
|
||||
float actual_speed = 0.0;
|
||||
char buf[32];
|
||||
float speed;
|
||||
|
||||
if (_session) {
|
||||
speed = _session->actual_speed ();
|
||||
actual_speed = speed;
|
||||
if (shuttle_grabbed) {
|
||||
speed = requested_speed;
|
||||
} else if (_session->default_play_speed()!=1.0) {
|
||||
/*use has selected a varispeed AND the shuttle widget is not held ... show the varispeed*/
|
||||
actual_speed = _session->default_play_speed();
|
||||
}
|
||||
}
|
||||
|
||||
if (actual_speed != 0) {
|
||||
if (_session->default_play_speed()==1.0) {
|
||||
if (actual_speed == _session->default_play_speed()) {
|
||||
snprintf (buf, sizeof (buf), "%s", _("Play"));
|
||||
} else if (Config->get_shuttle_units() == Percentage) {
|
||||
{
|
||||
if (actual_speed < 0.0) {
|
||||
snprintf (buf, sizeof (buf), "< %.1f%%", -actual_speed * 100.f);
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), "> %.1f%%", actual_speed * 100.f);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bool reversed;
|
||||
int semi = speed_as_semitones (actual_speed, reversed);
|
||||
if (reversed) {
|
||||
snprintf (buf, sizeof (buf), _("< %+2d st"), semi);
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), _("> %+2d st"), semi);
|
||||
}
|
||||
}
|
||||
} else { /*default_play_speed (varispeed) is always forward */
|
||||
if (Config->get_shuttle_units() == Percentage) {
|
||||
snprintf (buf, sizeof (buf), "%.1f%%", actual_speed * 100.f);
|
||||
} else {
|
||||
bool reversed;
|
||||
int semi = speed_as_semitones (actual_speed, reversed);
|
||||
if (abs(semi)<1) {
|
||||
int cents = speed_as_cents (actual_speed, reversed);
|
||||
snprintf (buf, sizeof (buf), _("%+2d c"), cents);
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), _("%+2d st"), semi);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!_session) {
|
||||
speed = 0.0;
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), "%s", _("Stop"));
|
||||
speed = _session->actual_speed ();
|
||||
}
|
||||
_info_button.set_text(buf);
|
||||
|
||||
|
||||
if ( (fabsf( speed - last_speed_displayed) < 0.005f) // dead-zone
|
||||
&& !( speed == 1.f && last_speed_displayed != 1.f)
|
||||
|
@ -336,7 +201,36 @@ ShuttleControl::build_shuttle_context_menu ()
|
|||
shuttle_context_menu = new Menu();
|
||||
MenuList& items = shuttle_context_menu->items();
|
||||
|
||||
{
|
||||
Menu* units_menu = manage (new Menu);
|
||||
MenuList& units_items = units_menu->items();
|
||||
RadioMenuItem::Group units_group;
|
||||
|
||||
units_items.push_back (RadioMenuElem (units_group, _("Percent"), sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_units), Percentage)));
|
||||
if (Config->get_shuttle_units() == Percentage) {
|
||||
static_cast<RadioMenuItem*>(&units_items.back())->set_active();
|
||||
}
|
||||
units_items.push_back (RadioMenuElem (units_group, _("Semitones"), sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_units), Semitones)));
|
||||
if (Config->get_shuttle_units() == Semitones) {
|
||||
static_cast<RadioMenuItem*>(&units_items.back())->set_active();
|
||||
}
|
||||
items.push_back (MenuElem (_("Units"), *units_menu));
|
||||
|
||||
Menu* style_menu = manage (new Menu);
|
||||
MenuList& style_items = style_menu->items();
|
||||
RadioMenuItem::Group style_group;
|
||||
|
||||
style_items.push_back (RadioMenuElem (style_group, _("Sprung"), sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_style), Sprung)));
|
||||
if (Config->get_shuttle_behaviour() == Sprung) {
|
||||
static_cast<RadioMenuItem*>(&style_items.back())->set_active();
|
||||
}
|
||||
style_items.push_back (RadioMenuElem (style_group, _("Wheel"), sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_style), Wheel)));
|
||||
if (Config->get_shuttle_behaviour() == Wheel) {
|
||||
static_cast<RadioMenuItem*>(&style_items.back())->set_active();
|
||||
}
|
||||
|
||||
items.push_back (MenuElem (_("Mode"), *style_menu));
|
||||
|
||||
if (Config->get_shuttle_units() == Percentage) {
|
||||
RadioMenuItem::Group speed_group;
|
||||
|
||||
/* XXX this code assumes that Config->get_max_transport_speed() returns 8 */
|
||||
|
@ -370,6 +264,19 @@ ShuttleControl::build_shuttle_context_menu ()
|
|||
|
||||
items.push_back (MenuElem (_("Maximum speed"), *speed_menu));
|
||||
}
|
||||
|
||||
items.push_back (SeparatorElem ());
|
||||
items.push_back (MenuElem (_("Reset to 100%"), sigc::mem_fun (*this, &ShuttleControl::reset_speed)));
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::reset_speed ()
|
||||
{
|
||||
if (!_session) {
|
||||
return;
|
||||
}
|
||||
|
||||
_session->reset_transport_speed ();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -440,10 +347,14 @@ ShuttleControl::on_button_release_event (GdkEventButton* ev)
|
|||
remove_modal_grab ();
|
||||
gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
||||
|
||||
if (shuttle_speed_on_grab == 0 ) {
|
||||
_session->request_stop ();
|
||||
if (Config->get_shuttle_behaviour() == Sprung) {
|
||||
if (shuttle_speed_on_grab == 0 ) {
|
||||
_session->request_stop ();
|
||||
} else {
|
||||
_session->request_transport_speed (shuttle_speed_on_grab);
|
||||
}
|
||||
} else {
|
||||
_session->request_transport_speed (shuttle_speed_on_grab);
|
||||
mouse_shuttle (ev->x, true);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -464,6 +375,63 @@ ShuttleControl::on_query_tooltip (int, int, bool, const Glib::RefPtr<Gtk::Toolti
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
ShuttleControl::on_scroll_event (GdkEventScroll* ev)
|
||||
{
|
||||
if (!_session || Config->get_shuttle_behaviour() != Wheel) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool semis = (Config->get_shuttle_units() == Semitones);
|
||||
|
||||
switch (ev->direction) {
|
||||
case GDK_SCROLL_UP:
|
||||
case GDK_SCROLL_RIGHT:
|
||||
if (semis) {
|
||||
if (shuttle_fract == 0) {
|
||||
shuttle_fract = semitones_as_fract (-24, false);
|
||||
} else {
|
||||
bool rev;
|
||||
int st = fract_as_semitones (shuttle_fract, rev);
|
||||
st += (rev ? -1 : 1);
|
||||
if (st < -24) {
|
||||
st = -24;
|
||||
rev = !rev;
|
||||
}
|
||||
shuttle_fract = semitones_as_fract (st, rev);
|
||||
}
|
||||
} else {
|
||||
shuttle_fract += 0.00125;
|
||||
}
|
||||
break;
|
||||
case GDK_SCROLL_DOWN:
|
||||
case GDK_SCROLL_LEFT:
|
||||
if (semis) {
|
||||
if (shuttle_fract == 0) {
|
||||
shuttle_fract = semitones_as_fract (-24, true);
|
||||
} else {
|
||||
bool rev;
|
||||
int st = fract_as_semitones (shuttle_fract, rev);
|
||||
st += (rev ? 1 : -1);
|
||||
if (st < -24) {
|
||||
st = -24;
|
||||
rev = !rev;
|
||||
}
|
||||
shuttle_fract = semitones_as_fract (st, rev);
|
||||
}
|
||||
} else {
|
||||
shuttle_fract -= 0.00125;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
use_shuttle_fract (true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
ShuttleControl::on_motion_notify_event (GdkEventMotion* ev)
|
||||
{
|
||||
|
@ -517,30 +485,6 @@ ShuttleControl::speed_as_semitones (float speed, bool& reverse)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
ShuttleControl::speed_as_cents (float speed, bool& reverse)
|
||||
{
|
||||
assert (speed != 0.0);
|
||||
|
||||
if (speed < 0.0) {
|
||||
reverse = true;
|
||||
return (int) ceilf (1200.0 * fast_log2 (-speed));
|
||||
} else {
|
||||
reverse = false;
|
||||
return (int) ceilf (1200.0 * fast_log2 (speed));
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
ShuttleControl::cents_as_speed (int cents, bool reverse)
|
||||
{
|
||||
if (reverse) {
|
||||
return -pow (2.0, (cents / 1200.0));
|
||||
} else {
|
||||
return pow (2.0, (cents / 1200.0));
|
||||
}
|
||||
}
|
||||
|
||||
float
|
||||
ShuttleControl::semitones_as_speed (int semi, bool reverse)
|
||||
{
|
||||
|
@ -594,7 +538,6 @@ ShuttleControl::use_shuttle_fract (bool force, bool zero_ok)
|
|||
speed = 0.0;
|
||||
}
|
||||
} else {
|
||||
shuttle_fract = shuttle_fract*shuttle_fract*shuttle_fract; // ^3 preserves the sign;
|
||||
speed = shuttle_max_speed * shuttle_fract;
|
||||
}
|
||||
|
||||
|
@ -602,9 +545,9 @@ ShuttleControl::use_shuttle_fract (bool force, bool zero_ok)
|
|||
|
||||
if (_session) {
|
||||
if (zero_ok) {
|
||||
_session->request_transport_speed (speed);
|
||||
_session->request_transport_speed (speed, Config->get_shuttle_behaviour() == Wheel);
|
||||
} else {
|
||||
_session->request_transport_speed_nonzero (speed);
|
||||
_session->request_transport_speed_nonzero (speed, Config->get_shuttle_behaviour() == Wheel);
|
||||
}
|
||||
|
||||
if (speed != 0 && !_session->transport_state_rolling()) {
|
||||
|
@ -647,8 +590,12 @@ ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangl
|
|||
cairo_stroke (cr);
|
||||
|
||||
float speed = 0.0;
|
||||
float actual_speed = 0.0;
|
||||
char buf[32];
|
||||
|
||||
if (_session) {
|
||||
speed = _session->actual_speed ();
|
||||
actual_speed = speed;
|
||||
if (shuttle_grabbed) {
|
||||
speed = requested_speed;
|
||||
}
|
||||
|
@ -676,8 +623,34 @@ ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangl
|
|||
}
|
||||
cairo_fill(cr);
|
||||
|
||||
/* text */
|
||||
if (actual_speed != 0) {
|
||||
if (Config->get_shuttle_units() == Percentage) {
|
||||
if (actual_speed == 1.0) {
|
||||
snprintf (buf, sizeof (buf), "%s", _("Play"));
|
||||
} else {
|
||||
if (actual_speed < 0.0) {
|
||||
snprintf (buf, sizeof (buf), "< %.1f%%", -actual_speed * 100.f);
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), "> %.1f%%", actual_speed * 100.f);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bool reversed;
|
||||
int semi = speed_as_semitones (actual_speed, reversed);
|
||||
if (reversed) {
|
||||
snprintf (buf, sizeof (buf), _("< %+2d st"), semi);
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), _("> %+2d st"), semi);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
snprintf (buf, sizeof (buf), "%s", _("Stop"));
|
||||
}
|
||||
|
||||
last_speed_displayed = speed;
|
||||
last_speed_displayed = actual_speed;
|
||||
|
||||
_info_button.set_text (buf);
|
||||
|
||||
#if 0
|
||||
if (UIConfiguration::instance().get_widget_prelight()) {
|
||||
|
@ -690,6 +663,24 @@ ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangl
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::set_shuttle_style (ShuttleBehaviour s)
|
||||
{
|
||||
if (_ignore_change) {
|
||||
return;
|
||||
}
|
||||
Config->set_shuttle_behaviour (s);
|
||||
}
|
||||
|
||||
void
|
||||
ShuttleControl::set_shuttle_units (ShuttleUnits s)
|
||||
{
|
||||
if (_ignore_change) {
|
||||
return;
|
||||
}
|
||||
Config->set_shuttle_units (s);
|
||||
}
|
||||
|
||||
ShuttleControl::ShuttleControllable::ShuttleControllable (ShuttleControl& s)
|
||||
: PBD::Controllable (X_("Shuttle"))
|
||||
, sc (s)
|
||||
|
@ -711,15 +702,44 @@ ShuttleControl::ShuttleControllable::get_value () const
|
|||
void
|
||||
ShuttleControl::parameter_changed (std::string p)
|
||||
{
|
||||
if (p == "shuttle-units") {
|
||||
map_transport_state ();
|
||||
if (p == "shuttle-behaviour") {
|
||||
switch (Config->get_shuttle_behaviour ()) {
|
||||
case Sprung:
|
||||
/* back to Sprung - reset to speed = 1.0 if playing
|
||||
*/
|
||||
if (_session) {
|
||||
if (_session->transport_rolling()) {
|
||||
if (_session->actual_speed() == 1.0) {
|
||||
queue_draw ();
|
||||
} else {
|
||||
/* reset current speed and
|
||||
revert to 1.0 as the default
|
||||
*/
|
||||
_session->reset_transport_speed ();
|
||||
/* redraw when speed changes */
|
||||
}
|
||||
} else {
|
||||
queue_draw ();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Wheel:
|
||||
queue_draw ();
|
||||
break;
|
||||
}
|
||||
|
||||
} else if (p == "shuttle-max-speed") {
|
||||
shuttle_max_speed = Config->get_shuttle_max_speed ();
|
||||
last_speed_displayed = -99999999;
|
||||
map_transport_state ();
|
||||
use_shuttle_fract (true);
|
||||
} else if (p == "shuttle-units") {
|
||||
last_speed_displayed = -99999999;
|
||||
map_transport_state ();
|
||||
use_shuttle_fract (true);
|
||||
delete shuttle_context_menu;
|
||||
shuttle_context_menu=0;
|
||||
shuttle_context_menu = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,25 +36,6 @@ namespace Gtk {
|
|||
class Menu;
|
||||
}
|
||||
|
||||
class ShuttleInfoButton : public ArdourWidgets::ArdourButton, public ARDOUR::SessionHandlePtr
|
||||
{
|
||||
public:
|
||||
ShuttleInfoButton ();
|
||||
~ShuttleInfoButton ();
|
||||
|
||||
bool on_button_press_event (GdkEventButton*);
|
||||
|
||||
void set_shuttle_units (ARDOUR::ShuttleUnits s);
|
||||
|
||||
private:
|
||||
void parameter_changed (std::string);
|
||||
void build_disp_context_menu ();
|
||||
Gtk::Menu* disp_context_menu;
|
||||
PBD::ScopedConnection parameter_connection;
|
||||
|
||||
bool _ignore_change;
|
||||
};
|
||||
|
||||
class ShuttleControl : public CairoWidget, public ARDOUR::SessionHandlePtr
|
||||
{
|
||||
public:
|
||||
|
@ -66,8 +47,6 @@ public:
|
|||
double get_shuttle_fract () const { return shuttle_fract; }
|
||||
void set_session (ARDOUR::Session*);
|
||||
|
||||
void do_blink (bool);
|
||||
|
||||
struct ShuttleControllable : public PBD::Controllable {
|
||||
ShuttleControllable (ShuttleControl&);
|
||||
void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
|
||||
|
@ -84,17 +63,6 @@ public:
|
|||
|
||||
ArdourWidgets::ArdourButton* info_button () { return &_info_button; }
|
||||
|
||||
public:
|
||||
static int speed_as_semitones (float, bool&);
|
||||
static int fract_as_semitones (float, bool&);
|
||||
|
||||
static float semitones_as_speed (int, bool);
|
||||
static float semitones_as_fract (int, bool);
|
||||
|
||||
static int speed_as_cents (float, bool&);
|
||||
static float cents_as_speed (int, bool);
|
||||
|
||||
|
||||
protected:
|
||||
bool _hovering;
|
||||
float shuttle_max_speed;
|
||||
|
@ -108,21 +76,22 @@ protected:
|
|||
cairo_pattern_t* shine_pattern;
|
||||
ARDOUR::microseconds_t last_shuttle_request;
|
||||
PBD::ScopedConnection parameter_connection;
|
||||
ShuttleInfoButton _info_button;
|
||||
ArdourWidgets::ArdourButton _info_button;
|
||||
Gtk::Menu* shuttle_context_menu;
|
||||
ArdourWidgets::BindingProxy binding_proxy;
|
||||
float bg_r, bg_g, bg_b;
|
||||
void build_shuttle_context_menu ();
|
||||
void shuttle_style_changed();
|
||||
void set_shuttle_max_speed (float);
|
||||
void reset_speed ();
|
||||
|
||||
bool on_enter_notify_event (GdkEventCrossing*);
|
||||
bool on_leave_notify_event (GdkEventCrossing*);
|
||||
bool on_button_press_event (GdkEventButton*);
|
||||
bool on_button_release_event(GdkEventButton*);
|
||||
bool on_scroll_event (GdkEventScroll*);
|
||||
bool on_motion_notify_event(GdkEventMotion*);
|
||||
|
||||
bool on_button_press_event_for_display (GdkEventButton*);
|
||||
|
||||
void render (Cairo::RefPtr<Cairo::Context> const&, cairo_rectangle_t*);
|
||||
|
||||
void on_size_allocate (Gtk::Allocation&);
|
||||
|
@ -133,6 +102,13 @@ protected:
|
|||
void parameter_changed (std::string);
|
||||
|
||||
void set_shuttle_units (ARDOUR::ShuttleUnits);
|
||||
void set_shuttle_style (ARDOUR::ShuttleBehaviour);
|
||||
|
||||
int speed_as_semitones (float, bool&);
|
||||
int fract_as_semitones (float, bool&);
|
||||
|
||||
float semitones_as_speed (int, bool);
|
||||
float semitones_as_fract (int, bool);
|
||||
|
||||
bool _ignore_change;
|
||||
};
|
||||
|
|
|
@ -385,8 +385,7 @@
|
|||
<ColorAlias name="send pan" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="shuttle" alias="widget:bg"/>
|
||||
<ColorAlias name="shuttle bg" alias="neutral:backgroundest"/>
|
||||
<ColorAlias name="shuttle text: fill" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="shuttle text: fill active" alias="alert:red"/>
|
||||
<ColorAlias name="shuttle text" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="silence" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="silence text" alias="neutral:foreground"/>
|
||||
<ColorAlias name="solo button: fill" alias="widget:bg"/>
|
||||
|
|
|
@ -386,8 +386,7 @@
|
|||
<ColorAlias name="send pan" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="shuttle" alias="widget:bg"/>
|
||||
<ColorAlias name="shuttle bg" alias="neutral:backgroundest"/>
|
||||
<ColorAlias name="shuttle text: fill" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="shuttle text: fill active" alias="alert:red"/>
|
||||
<ColorAlias name="shuttle text" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="silence" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="silence text" alias="neutral:foreground"/>
|
||||
<ColorAlias name="solo button: fill" alias="widget:bg"/>
|
||||
|
|
|
@ -386,8 +386,7 @@
|
|||
<ColorAlias name="send pan" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="shuttle" alias="widget:bg"/>
|
||||
<ColorAlias name="shuttle bg" alias="neutral:backgroundest"/>
|
||||
<ColorAlias name="shuttle text: fill" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="shuttle text: fill active" alias="alert:red"/>
|
||||
<ColorAlias name="shuttle text" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="silence" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="silence text" alias="neutral:foreground"/>
|
||||
<ColorAlias name="solo button: fill" alias="widget:bg"/>
|
||||
|
|
|
@ -386,8 +386,7 @@
|
|||
<ColorAlias name="send pan" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="shuttle" alias="widget:bg"/>
|
||||
<ColorAlias name="shuttle bg" alias="neutral:backgroundest"/>
|
||||
<ColorAlias name="shuttle text: fill" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="shuttle text: fill active" alias="alert:red"/>
|
||||
<ColorAlias name="shuttle text" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="silence" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="silence text" alias="neutral:foreground"/>
|
||||
<ColorAlias name="solo button: fill" alias="widget:bg"/>
|
||||
|
|
|
@ -386,8 +386,7 @@
|
|||
<ColorAlias name="send pan" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="shuttle" alias="widget:bg"/>
|
||||
<ColorAlias name="shuttle bg" alias="neutral:backgroundest"/>
|
||||
<ColorAlias name="shuttle text: fill" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="shuttle text: fill active" alias="alert:red"/>
|
||||
<ColorAlias name="shuttle text" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="silence" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="silence text" alias="neutral:foreground"/>
|
||||
<ColorAlias name="solo button: fill" alias="widget:bg"/>
|
||||
|
|
|
@ -386,8 +386,7 @@
|
|||
<ColorAlias name="send pan" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="shuttle" alias="widget:bg"/>
|
||||
<ColorAlias name="shuttle bg" alias="neutral:backgroundest"/>
|
||||
<ColorAlias name="shuttle text: fill" alias="neutral:foreground2"/>
|
||||
<ColorAlias name="shuttle text: fill active" alias="alert:red"/>
|
||||
<ColorAlias name="shuttle text" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="silence" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="silence text" alias="neutral:foreground"/>
|
||||
<ColorAlias name="solo button: fill" alias="widget:bg"/>
|
||||
|
|
|
@ -385,8 +385,7 @@
|
|||
<ColorAlias name="send pan" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="shuttle" alias="widget:bg"/>
|
||||
<ColorAlias name="shuttle bg" alias="neutral:backgroundest"/>
|
||||
<ColorAlias name="shuttle text: fill" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="shuttle text: fill active" alias="alert:red"/>
|
||||
<ColorAlias name="shuttle text" alias="neutral:foregroundest"/>
|
||||
<ColorAlias name="silence" alias="theme:contrasting alt"/>
|
||||
<ColorAlias name="silence text" alias="neutral:foreground"/>
|
||||
<ColorAlias name="solo button: fill" alias="widget:bg"/>
|
||||
|
|
|
@ -174,6 +174,7 @@ CONFIG_VARIABLE (samplecnt_t, preroll, "preroll", 0)
|
|||
CONFIG_VARIABLE (samplecnt_t, postroll, "postroll", 0)
|
||||
CONFIG_VARIABLE (float, shuttle_speed_factor, "shuttle-speed-factor", 1.0f) // used for MMC shuttle
|
||||
CONFIG_VARIABLE (float, shuttle_speed_threshold, "shuttle-speed-threshold", 5.0f) // used for MMC shuttle
|
||||
CONFIG_VARIABLE (ShuttleBehaviour, shuttle_behaviour, "shuttle-behaviour", Wheel)
|
||||
CONFIG_VARIABLE (ShuttleUnits, shuttle_units, "shuttle-units", Percentage)
|
||||
CONFIG_VARIABLE (float, shuttle_max_speed, "shuttle-max-speed", 8.0f)
|
||||
CONFIG_VARIABLE (bool, locate_while_waiting_for_sync, "locate-while-waiting-for-sync", false)
|
||||
|
|
|
@ -479,12 +479,9 @@ public:
|
|||
void use_rf_shuttle_speed ();
|
||||
void allow_auto_play (bool yn);
|
||||
|
||||
double default_play_speed ();
|
||||
void set_default_play_speed (double spd, TransportRequestSource origin = TRS_UI);
|
||||
void reset_transport_speed (TransportRequestSource origin = TRS_UI);
|
||||
|
||||
void request_transport_speed (double speed, TransportRequestSource origin = TRS_UI);
|
||||
void request_transport_speed_nonzero (double, TransportRequestSource origin = TRS_UI);
|
||||
void request_transport_speed (double speed, bool as_default = true, TransportRequestSource origin = TRS_UI);
|
||||
void request_transport_speed_nonzero (double, bool as_default = true, TransportRequestSource origin = TRS_UI);
|
||||
void request_overwrite_buffer (boost::shared_ptr<Track>, OverwriteReason);
|
||||
void adjust_playback_buffering();
|
||||
void adjust_capture_buffering();
|
||||
|
@ -1393,6 +1390,10 @@ private:
|
|||
|
||||
// varispeed playback -- TODO: move out of session to backend.
|
||||
double _engine_speed;
|
||||
double _default_transport_speed;
|
||||
double _default_engine_speed;
|
||||
double _last_transport_speed;
|
||||
double _requested_transport_speed;
|
||||
double _signalled_varispeed;
|
||||
|
||||
bool auto_play_legal;
|
||||
|
|
|
@ -54,6 +54,7 @@ struct TransportFSM
|
|||
bool force;
|
||||
/* for SetSpeed */
|
||||
double speed;
|
||||
bool as_default;
|
||||
|
||||
Event (EventType t)
|
||||
: type (t)
|
||||
|
@ -94,9 +95,10 @@ struct TransportFSM
|
|||
cast double-to-bool and complains. C++11 would allow "=
|
||||
delete" as an alternate fix, but this is fine.
|
||||
*/
|
||||
Event (double sp)
|
||||
Event (double sp, bool ad)
|
||||
: type (SetSpeed)
|
||||
, speed (sp)
|
||||
, as_default (ad)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -145,9 +147,7 @@ struct TransportFSM
|
|||
std::string current_state () const;
|
||||
|
||||
double transport_speed() const { return _transport_speed; }
|
||||
|
||||
double default_speed() const { return _default_speed; }
|
||||
void set_default_speed(double spd) const { _default_speed = spd; }
|
||||
|
||||
private:
|
||||
MotionState _motion_state;
|
||||
|
|
|
@ -626,6 +626,11 @@ enum TransportRequestType {
|
|||
TR_Locate = 0x4
|
||||
};
|
||||
|
||||
enum ShuttleBehaviour {
|
||||
Sprung,
|
||||
Wheel
|
||||
};
|
||||
|
||||
enum ShuttleUnits {
|
||||
Percentage,
|
||||
Semitones
|
||||
|
|
|
@ -48,6 +48,7 @@ DEFINE_ENUM_CONVERT(ARDOUR::ListenPosition)
|
|||
DEFINE_ENUM_CONVERT(ARDOUR::LayerModel)
|
||||
DEFINE_ENUM_CONVERT(ARDOUR::InsertMergePolicy)
|
||||
DEFINE_ENUM_CONVERT(ARDOUR::SyncSource)
|
||||
DEFINE_ENUM_CONVERT(ARDOUR::ShuttleBehaviour)
|
||||
DEFINE_ENUM_CONVERT(ARDOUR::ShuttleUnits)
|
||||
DEFINE_ENUM_CONVERT(ARDOUR::ClockDeltaMode)
|
||||
DEFINE_ENUM_CONVERT(ARDOUR::DenormalModel)
|
||||
|
|
|
@ -99,6 +99,7 @@ setup_enum_writer ()
|
|||
PluginType _PluginType;
|
||||
SyncSource _SyncSource;
|
||||
TransportRequestType _TransportRequestType;
|
||||
ShuttleBehaviour _ShuttleBehaviour;
|
||||
ShuttleUnits _ShuttleUnits;
|
||||
Session::RecordState _Session_RecordState;
|
||||
SessionEvent::Type _SessionEvent_Type;
|
||||
|
@ -433,6 +434,10 @@ setup_enum_writer ()
|
|||
REGISTER_ENUM (TR_Locate);
|
||||
REGISTER (_TransportRequestType);
|
||||
|
||||
REGISTER_ENUM (Sprung);
|
||||
REGISTER_ENUM (Wheel);
|
||||
REGISTER (_ShuttleBehaviour);
|
||||
|
||||
REGISTER_ENUM (Percentage);
|
||||
REGISTER_ENUM (Semitones);
|
||||
REGISTER (_ShuttleUnits);
|
||||
|
|
|
@ -2274,6 +2274,11 @@ LuaBindings::common (lua_State* L)
|
|||
.addConst ("ForceSel", ARDOUR::RangeSelectionAfterSplit(ForceSel))
|
||||
.endNamespace ()
|
||||
|
||||
.beginNamespace ("ShuttleBehaviour")
|
||||
.addConst ("Sprung", ARDOUR::ShuttleBehaviour(Sprung))
|
||||
.addConst ("Wheel", ARDOUR::ShuttleBehaviour(Wheel))
|
||||
.endNamespace ()
|
||||
|
||||
.beginNamespace ("ScreenSaverMode")
|
||||
.addConst ("InhibitNever", ARDOUR::ScreenSaverMode(InhibitNever))
|
||||
.addConst ("InhibitWhileRecording", ARDOUR::ScreenSaverMode(InhibitWhileRecording))
|
||||
|
|
|
@ -191,6 +191,8 @@ Session::Session (AudioEngine &eng,
|
|||
, _silent (false)
|
||||
, _remaining_latency_preroll (0)
|
||||
, _engine_speed (1.0)
|
||||
, _last_transport_speed (1.0)
|
||||
, _requested_transport_speed (std::numeric_limits<double>::max())
|
||||
, _signalled_varispeed (0)
|
||||
, auto_play_legal (false)
|
||||
, _requested_return_sample (-1)
|
||||
|
|
|
@ -43,7 +43,7 @@ using namespace ARDOUR;
|
|||
using namespace PBD;
|
||||
|
||||
#define TFSM_ROLL() { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::StartTransport)); }
|
||||
#define TFSM_SPEED(speed) { _transport_fsm->enqueue (new TransportFSM::Event (speed)); }
|
||||
#define TFSM_SPEED(speed,as_default) { _transport_fsm->enqueue (new TransportFSM::Event (speed,as_default)); }
|
||||
|
||||
boost::shared_ptr<ExportHandler>
|
||||
Session::get_export_handler ()
|
||||
|
@ -308,7 +308,7 @@ Session::process_export_fw (pframes_t nframes)
|
|||
return;
|
||||
}
|
||||
|
||||
TFSM_SPEED (1.0);
|
||||
TFSM_SPEED (1.0, false);
|
||||
TFSM_ROLL ();
|
||||
_butler->schedule_transport_work ();
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ using namespace std;
|
|||
#define TFSM_EVENT(evtype) { _transport_fsm->enqueue (new TransportFSM::Event (evtype)); }
|
||||
#define TFSM_ROLL() { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::StartTransport)); }
|
||||
#define TFSM_STOP(abort,clear) { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::StopTransport,abort,clear)); }
|
||||
#define TFSM_SPEED(speed) { _transport_fsm->enqueue (new TransportFSM::Event (speed)); }
|
||||
#define TFSM_SPEED(speed,as_default) { _transport_fsm->enqueue (new TransportFSM::Event (speed,as_default)); }
|
||||
#define TFSM_LOCATE(target,ltd,loop,force) { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::Locate,target,ltd,loop,force)); }
|
||||
|
||||
|
||||
|
@ -918,7 +918,7 @@ Session::process_event (SessionEvent* ev)
|
|||
|
||||
|
||||
case SessionEvent::SetTransportSpeed:
|
||||
TFSM_SPEED (ev->speed);
|
||||
TFSM_SPEED (ev->speed, ev->yes_or_no);
|
||||
break;
|
||||
|
||||
case SessionEvent::StartRoll:
|
||||
|
@ -986,7 +986,7 @@ Session::process_event (SessionEvent* ev)
|
|||
break;
|
||||
|
||||
case SessionEvent::SetPlayAudioRange:
|
||||
set_play_range (ev->audio_range, (ev->speed == _transport_fsm->default_speed())); //an explicit PLAY state would be nicer here
|
||||
set_play_range (ev->audio_range, (ev->speed == 1.0f));
|
||||
break;
|
||||
|
||||
case SessionEvent::CancelPlayAudioRange:
|
||||
|
@ -1251,11 +1251,7 @@ Session::plan_master_strategy (pframes_t nframes, double master_speed, samplepos
|
|||
*/
|
||||
|
||||
if (!config.get_external_sync()) {
|
||||
float desired = actual_speed ();
|
||||
if (desired==0.0) {
|
||||
return _transport_fsm->default_speed();
|
||||
}
|
||||
return desired;
|
||||
return actual_speed ();
|
||||
}
|
||||
|
||||
/* When calling TransportMasterStart, sould aim for
|
||||
|
|
|
@ -86,7 +86,7 @@ using namespace PBD;
|
|||
#define TFSM_EVENT(evtype) { _transport_fsm->enqueue (new TransportFSM::Event (evtype)); }
|
||||
#define TFSM_STOP(abort,clear) { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::StopTransport,abort,clear)); }
|
||||
#define TFSM_LOCATE(target,ltd,loop,force) { _transport_fsm->enqueue (new TransportFSM::Event (TransportFSM::Locate,target,ltd,loop,force)); }
|
||||
#define TFSM_SPEED(speed) { _transport_fsm->enqueue (new TransportFSM::Event (speed)); }
|
||||
#define TFSM_SPEED(speed,as_default) { _transport_fsm->enqueue (new TransportFSM::Event (speed,as_default)); }
|
||||
|
||||
/* *****************************************************************************
|
||||
* REALTIME ACTIONS (to be called on state transitions)
|
||||
|
@ -309,23 +309,6 @@ Session::post_locate ()
|
|||
}
|
||||
}
|
||||
|
||||
double
|
||||
Session::default_play_speed ()
|
||||
{
|
||||
return _transport_fsm->default_speed();
|
||||
}
|
||||
|
||||
/** Set the default speed that is used when we respond to a "play" action.
|
||||
* @param speed New speed
|
||||
*/
|
||||
void
|
||||
Session::set_default_play_speed (double spd, TransportRequestSource origin)
|
||||
{
|
||||
_transport_fsm->set_default_speed(spd);
|
||||
TFSM_SPEED(spd);
|
||||
TransportStateChange (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
/** Set the transport speed.
|
||||
* Called from the process thread.
|
||||
* @param speed New speed
|
||||
|
@ -336,8 +319,6 @@ Session::set_transport_speed (double speed)
|
|||
ENSURE_PROCESS_THREAD;
|
||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("@ %1 Set transport speed to %2 from %3 (es = %4)\n", _transport_sample, speed, _transport_fsm->transport_speed(), _engine_speed));
|
||||
|
||||
double default_speed = _transport_fsm->default_speed();
|
||||
|
||||
assert (speed != 0.0);
|
||||
|
||||
/* the logic:
|
||||
|
@ -354,7 +335,7 @@ Session::set_transport_speed (double speed)
|
|||
|
||||
*/
|
||||
|
||||
if ((_engine_speed != default_speed) && (_engine_speed == fabs (speed)) && ((speed * _transport_fsm->transport_speed()) > 0)) {
|
||||
if ((_engine_speed != 1) && (_engine_speed == fabs (speed)) && ((speed * _transport_fsm->transport_speed()) > 0)) {
|
||||
/* engine speed is not changing and no direction change, do nothing */
|
||||
DEBUG_TRACE (DEBUG::Transport, "no reason to change speed, do nothing\n");
|
||||
return;
|
||||
|
@ -384,9 +365,8 @@ Session::set_transport_speed (double speed)
|
|||
clear_clicks ();
|
||||
_engine_speed = new_engine_speed;
|
||||
|
||||
if (!Config->get_auto_return_after_rewind_ffwd() && fabs (speed) > 2.0) {
|
||||
/* fast-wind of any sort should cancel auto-return */
|
||||
/* since we don't have an actual ffwd/rew state yet, just trigger on a 'fast' varispeed */
|
||||
if (!Config->get_auto_return_after_rewind_ffwd() && fabs (speed) != 1.0 && _transport_fsm->default_speed() == 1.0) {
|
||||
/* varispeed of any sort cancels auto-return */
|
||||
_requested_return_sample = -1;
|
||||
_last_roll_location = -1;
|
||||
_last_roll_or_reversal_location = -1;
|
||||
|
@ -410,7 +390,7 @@ Session::set_transport_speed (double speed)
|
|||
|
||||
if (fabs (_signalled_varispeed - act_speed) > .002
|
||||
// still, signal hard changes to 1.0 and 0.0:
|
||||
|| (act_speed == default_speed && _signalled_varispeed != default_speed)
|
||||
|| (act_speed == 1.0 && _signalled_varispeed != 1.0)
|
||||
|| (act_speed == 0.0 && _signalled_varispeed != 0.0)
|
||||
)
|
||||
{
|
||||
|
@ -762,11 +742,11 @@ Session::request_sync_source (boost::shared_ptr<TransportMaster> tm)
|
|||
void
|
||||
Session::reset_transport_speed (TransportRequestSource origin)
|
||||
{
|
||||
request_transport_speed (_transport_fsm->default_speed(), origin);
|
||||
request_transport_speed (1.0, true, origin);
|
||||
}
|
||||
|
||||
void
|
||||
Session::request_transport_speed (double speed, TransportRequestSource origin)
|
||||
Session::request_transport_speed (double speed, bool as_default, TransportRequestSource origin)
|
||||
{
|
||||
if (synced_to_engine()) {
|
||||
if (speed != 0) {
|
||||
|
@ -788,7 +768,8 @@ Session::request_transport_speed (double speed, TransportRequestSource origin)
|
|||
}
|
||||
|
||||
SessionEvent* ev = new SessionEvent (SessionEvent::SetTransportSpeed, SessionEvent::Add, SessionEvent::Immediate, 0, speed);
|
||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("Request transport speed = %1 as default = %2\n", speed));
|
||||
ev->yes_or_no = as_default; // as_default
|
||||
DEBUG_TRACE (DEBUG::Transport, string_compose ("Request transport speed = %1 as default = %2\n", speed, as_default));
|
||||
queue_event (ev);
|
||||
}
|
||||
|
||||
|
@ -797,13 +778,13 @@ Session::request_transport_speed (double speed, TransportRequestSource origin)
|
|||
* be used by callers who are varying transport speed but don't ever want to stop it.
|
||||
*/
|
||||
void
|
||||
Session::request_transport_speed_nonzero (double speed, TransportRequestSource origin)
|
||||
Session::request_transport_speed_nonzero (double speed, bool as_default, TransportRequestSource origin)
|
||||
{
|
||||
if (speed == 0) {
|
||||
speed = DBL_EPSILON;
|
||||
}
|
||||
|
||||
request_transport_speed (speed);
|
||||
request_transport_speed (speed, as_default);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -925,7 +906,7 @@ Session::request_count_in_record ()
|
|||
}
|
||||
maybe_enable_record ();
|
||||
_count_in_once = true;
|
||||
request_transport_speed(_transport_fsm->default_speed());
|
||||
request_transport_speed (1.0, true);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -955,7 +936,7 @@ Session::request_play_loop (bool yn, bool change_transport_roll)
|
|||
/* currently stopped */
|
||||
if (yn) {
|
||||
/* start looping at normal speed */
|
||||
target_speed = _transport_fsm->default_speed();
|
||||
target_speed = 1.0;
|
||||
} else {
|
||||
target_speed = 0.0;
|
||||
}
|
||||
|
@ -973,7 +954,7 @@ Session::request_play_loop (bool yn, bool change_transport_roll)
|
|||
void
|
||||
Session::request_play_range (list<AudioRange>* range, bool leave_rolling)
|
||||
{
|
||||
SessionEvent* ev = new SessionEvent (SessionEvent::SetPlayAudioRange, SessionEvent::Add, SessionEvent::Immediate, 0, (leave_rolling ? _transport_fsm->default_speed() : 0.0));
|
||||
SessionEvent* ev = new SessionEvent (SessionEvent::SetPlayAudioRange, SessionEvent::Add, SessionEvent::Immediate, 0, (leave_rolling ? 1.0 : 0.0));
|
||||
if (range) {
|
||||
ev->audio_range = *range;
|
||||
} else {
|
||||
|
@ -1754,7 +1735,7 @@ Session::set_requested_return_sample (samplepos_t return_to)
|
|||
void
|
||||
Session::request_roll_at_and_return (samplepos_t start, samplepos_t return_to)
|
||||
{
|
||||
SessionEvent *ev = new SessionEvent (SessionEvent::LocateRollLocate, SessionEvent::Add, SessionEvent::Immediate, return_to, _transport_fsm->default_speed());
|
||||
SessionEvent *ev = new SessionEvent (SessionEvent::LocateRollLocate, SessionEvent::Add, SessionEvent::Immediate, return_to, 1.0);
|
||||
ev->target2_sample = start;
|
||||
queue_event (ev);
|
||||
}
|
||||
|
|
|
@ -505,10 +505,8 @@ TransportFSM::maybe_reset_speed ()
|
|||
|
||||
if (Config->get_reset_default_speed_on_stop()) {
|
||||
|
||||
if (most_recently_requested_speed != 1.0 || default_speed() != 1.0) {
|
||||
set_default_speed(1.0);
|
||||
set_speed (Event (1.0));
|
||||
state_changed = true;
|
||||
if (most_recently_requested_speed != 1.0) {
|
||||
state_changed = set_speed (Event (1.0, false));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -517,11 +515,11 @@ TransportFSM::maybe_reset_speed ()
|
|||
* speed change from whatever we have been rolling at to
|
||||
* whatever the current default is. We could have been
|
||||
* rewinding at -4.5 ... when we restart, we need to play at
|
||||
* the current _default_speed
|
||||
* the current _default_transport_speed
|
||||
*/
|
||||
|
||||
if (most_recently_requested_speed != _default_speed) {
|
||||
state_changed = set_speed (Event (_default_speed));
|
||||
state_changed = set_speed (Event (_default_speed, false));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -804,6 +802,10 @@ TransportFSM::set_speed (Event const & ev)
|
|||
|
||||
most_recently_requested_speed = ev.speed;
|
||||
|
||||
if (ev.as_default) {
|
||||
_default_speed = ev.speed;
|
||||
}
|
||||
|
||||
if (must_reverse) {
|
||||
|
||||
/* direction change */
|
||||
|
|
|
@ -200,13 +200,13 @@ BasicUI::button_varispeed (bool fwd)
|
|||
|
||||
if (fwd) {
|
||||
if (transport_speed <= 0) {
|
||||
session->request_transport_speed (1.0);
|
||||
session->request_transport_speed (1.0, false);
|
||||
session->request_roll (TRS_UI);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (transport_speed >= 0) {
|
||||
session->request_transport_speed (-1.0);
|
||||
session->request_transport_speed (-1.0, false);
|
||||
session->request_roll (TRS_UI);
|
||||
return;
|
||||
}
|
||||
|
@ -221,12 +221,12 @@ BasicUI::button_varispeed (bool fwd)
|
|||
|
||||
if (fwd) {
|
||||
if (transport_speed <= 0) {
|
||||
session->request_transport_speed (1.0);
|
||||
session->request_transport_speed (1.0, false);
|
||||
session->request_roll (TRS_UI);
|
||||
}
|
||||
} else {
|
||||
if (transport_speed >= 0) {
|
||||
session->request_transport_speed (-1.0);
|
||||
session->request_transport_speed (-1.0, false);
|
||||
session->request_roll (TRS_UI);
|
||||
}
|
||||
}
|
||||
|
@ -272,7 +272,7 @@ BasicUI::button_varispeed (bool fwd)
|
|||
|
||||
speed = semitone_ratio * transport_speed;
|
||||
speed = std::max (-maxspeed, std::min (maxspeed, speed));
|
||||
session->request_transport_speed (speed);
|
||||
session->request_transport_speed (speed, false);
|
||||
session->request_roll (TRS_UI);
|
||||
}
|
||||
|
||||
|
@ -374,7 +374,7 @@ BasicUI::transport_play (bool from_last_start)
|
|||
}
|
||||
|
||||
if (rolling) {
|
||||
session->request_transport_speed (1.0, TRS_UI);
|
||||
session->request_transport_speed (1.0, false, TRS_UI);
|
||||
} else {
|
||||
session->request_roll ();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue