NO-OP: clang-format
This commit is contained in:
parent
e764714157
commit
8b365e238e
|
@ -34,10 +34,10 @@
|
||||||
#include "ardour/session.h"
|
#include "ardour/session.h"
|
||||||
|
|
||||||
#include "gtkmm2ext/colors.h"
|
#include "gtkmm2ext/colors.h"
|
||||||
#include "gtkmm2ext/keyboard.h"
|
|
||||||
#include "gtkmm2ext/gui_thread.h"
|
#include "gtkmm2ext/gui_thread.h"
|
||||||
#include "gtkmm2ext/utils.h"
|
#include "gtkmm2ext/keyboard.h"
|
||||||
#include "gtkmm2ext/rgb_macros.h"
|
#include "gtkmm2ext/rgb_macros.h"
|
||||||
|
#include "gtkmm2ext/utils.h"
|
||||||
|
|
||||||
#include "widgets/tooltips.h"
|
#include "widgets/tooltips.h"
|
||||||
|
|
||||||
|
@ -52,10 +52,11 @@ using namespace Gtk;
|
||||||
using namespace Gtkmm2ext;
|
using namespace Gtkmm2ext;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace ArdourWidgets;
|
using namespace ArdourWidgets;
|
||||||
using std::min;
|
|
||||||
using std::max;
|
using std::max;
|
||||||
|
using std::min;
|
||||||
|
|
||||||
gboolean qt (gboolean, gint, gint, gboolean, Gtk::Tooltip*, gpointer)
|
gboolean
|
||||||
|
qt (gboolean, gint, gint, gboolean, Gtk::Tooltip*, gpointer)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -67,19 +68,19 @@ ShuttleInfoButton::~ShuttleInfoButton ()
|
||||||
|
|
||||||
ShuttleInfoButton::ShuttleInfoButton ()
|
ShuttleInfoButton::ShuttleInfoButton ()
|
||||||
{
|
{
|
||||||
set_layout_font (UIConfiguration::instance().get_NormalFont());
|
set_layout_font (UIConfiguration::instance ().get_NormalFont ());
|
||||||
set_sizing_text (S_("LogestShuttle|+00 st"));
|
set_sizing_text (S_("LogestShuttle|+00 st"));
|
||||||
set_tooltip (*this, _("Speed Display (Context-click for options)"));
|
set_tooltip (*this, _("Speed Display (Context-click for options)"));
|
||||||
set_name ("shuttle text");
|
set_name ("shuttle text");
|
||||||
set_visual_state (Gtkmm2ext::NoVisualState);
|
set_visual_state (Gtkmm2ext::NoVisualState);
|
||||||
set_elements (ArdourButton::Text);
|
set_elements (ArdourButton::Text);
|
||||||
|
|
||||||
Config->ParameterChanged.connect (parameter_connection, MISSING_INVALIDATOR, boost::bind (&ShuttleInfoButton::parameter_changed, this, _1), gui_context());
|
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);
|
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;
|
disp_context_menu = 0;
|
||||||
_ignore_change = false;
|
_ignore_change = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -115,7 +116,6 @@ ShuttleInfoButton::on_button_press_event (GdkEventButton* ev)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ShuttleInfoButton::build_disp_context_menu ()
|
ShuttleInfoButton::build_disp_context_menu ()
|
||||||
{
|
{
|
||||||
|
@ -123,22 +123,22 @@ ShuttleInfoButton::build_disp_context_menu ()
|
||||||
|
|
||||||
using namespace Menu_Helpers;
|
using namespace Menu_Helpers;
|
||||||
|
|
||||||
disp_context_menu = new Gtk::Menu();
|
disp_context_menu = new Gtk::Menu ();
|
||||||
MenuList& items = disp_context_menu->items();
|
MenuList& items = disp_context_menu->items ();
|
||||||
|
|
||||||
RadioMenuItem::Group units_group;
|
RadioMenuItem::Group units_group;
|
||||||
|
|
||||||
items.push_back (RadioMenuElem (units_group, _("Percent"), sigc::bind (sigc::mem_fun (*this, &ShuttleInfoButton::set_shuttle_units), Percentage)));
|
items.push_back (RadioMenuElem (units_group, _("Percent"), sigc::bind (sigc::mem_fun (*this, &ShuttleInfoButton::set_shuttle_units), Percentage)));
|
||||||
if (Config->get_shuttle_units() == Percentage) {
|
if (Config->get_shuttle_units () == Percentage) {
|
||||||
static_cast<RadioMenuItem*>(&items.back())->set_active();
|
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)));
|
items.push_back (RadioMenuElem (units_group, _("Semitones"), sigc::bind (sigc::mem_fun (*this, &ShuttleInfoButton::set_shuttle_units), Semitones)));
|
||||||
if (Config->get_shuttle_units() == Semitones) {
|
if (Config->get_shuttle_units () == Semitones) {
|
||||||
static_cast<RadioMenuItem*>(&items.back())->set_active();
|
static_cast<RadioMenuItem*> (&items.back ())->set_active ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ****************************************************************************/
|
||||||
|
|
||||||
ShuttleControl::ShuttleControl ()
|
ShuttleControl::ShuttleControl ()
|
||||||
: _controllable (new ShuttleControllable (*this))
|
: _controllable (new ShuttleControllable (*this))
|
||||||
|
@ -146,47 +146,53 @@ ShuttleControl::ShuttleControl ()
|
||||||
{
|
{
|
||||||
set_tooltip (*this, _("Shuttle speed control (Context-click for options)"));
|
set_tooltip (*this, _("Shuttle speed control (Context-click for options)"));
|
||||||
|
|
||||||
pattern = 0;
|
pattern = 0;
|
||||||
shine_pattern = 0;
|
shine_pattern = 0;
|
||||||
last_shuttle_request = 0;
|
last_shuttle_request = 0;
|
||||||
last_speed_displayed = -99999999;
|
last_speed_displayed = -99999999;
|
||||||
shuttle_grabbed = false;
|
shuttle_grabbed = false;
|
||||||
shuttle_speed_on_grab = 0;
|
shuttle_speed_on_grab = 0;
|
||||||
shuttle_fract = 0.0;
|
shuttle_fract = 0.0;
|
||||||
shuttle_max_speed = Config->get_max_transport_speed();
|
shuttle_max_speed = Config->get_max_transport_speed ();
|
||||||
shuttle_context_menu = 0;
|
shuttle_context_menu = 0;
|
||||||
_hovering = false;
|
_hovering = false;
|
||||||
_ignore_change = false;
|
_ignore_change = false;
|
||||||
|
|
||||||
set_flags (CAN_FOCUS);
|
set_flags (CAN_FOCUS);
|
||||||
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);
|
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);
|
||||||
set_name (X_("ShuttleControl"));
|
set_name (X_("ShuttleControl"));
|
||||||
|
|
||||||
ensure_style ();
|
ensure_style ();
|
||||||
|
|
||||||
shuttle_max_speed = Config->get_shuttle_max_speed();
|
shuttle_max_speed = Config->get_shuttle_max_speed ();
|
||||||
|
|
||||||
if (shuttle_max_speed >= Config->get_max_transport_speed()) { shuttle_max_speed = Config->get_max_transport_speed(); }
|
if (shuttle_max_speed >= Config->get_max_transport_speed ()) {
|
||||||
else if (shuttle_max_speed >= 6.f) { shuttle_max_speed = 6.0f; }
|
shuttle_max_speed = Config->get_max_transport_speed ();
|
||||||
else if (shuttle_max_speed >= 4.f) { shuttle_max_speed = 4.0f; }
|
} else if (shuttle_max_speed >= 6.f) {
|
||||||
else if (shuttle_max_speed >= 3.f) { shuttle_max_speed = 3.0f; }
|
shuttle_max_speed = 6.0f;
|
||||||
else if (shuttle_max_speed >= 2.f) { shuttle_max_speed = 2.0f; }
|
} else if (shuttle_max_speed >= 4.f) {
|
||||||
else { shuttle_max_speed = 1.5f; }
|
shuttle_max_speed = 4.0f;
|
||||||
|
} else if (shuttle_max_speed >= 3.f) {
|
||||||
|
shuttle_max_speed = 3.0f;
|
||||||
|
} else if (shuttle_max_speed >= 2.f) {
|
||||||
|
shuttle_max_speed = 2.0f;
|
||||||
|
} else {
|
||||||
|
shuttle_max_speed = 1.5f;
|
||||||
|
}
|
||||||
|
|
||||||
Config->ParameterChanged.connect (parameter_connection, MISSING_INVALIDATOR, boost::bind (&ShuttleControl::parameter_changed, this, _1), gui_context());
|
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));
|
UIConfiguration::instance ().ColorsChanged.connect (sigc::mem_fun (*this, &ShuttleControl::set_colors));
|
||||||
Timers::blink_connect (sigc::mem_fun (*this, &ShuttleControl::do_blink));
|
Timers::blink_connect (sigc::mem_fun (*this, &ShuttleControl::do_blink));
|
||||||
|
|
||||||
set_tooltip (_vari_button, _("Varispeed: change the default playback and recording speed"));
|
set_tooltip (_vari_button, _("Varispeed: change the default playback and recording speed"));
|
||||||
|
|
||||||
// _vari_button.set_icon (ArdourIcon::RecButton);
|
|
||||||
_vari_button.set_name ("vari button");
|
_vari_button.set_name ("vari button");
|
||||||
_vari_button.set_text(_("Vari"));
|
_vari_button.set_text (_("Vari"));
|
||||||
_vari_button.signal_clicked.connect (sigc::mem_fun (*this, &ShuttleControl::varispeed_button_clicked));
|
_vari_button.signal_clicked.connect (sigc::mem_fun (*this, &ShuttleControl::varispeed_button_clicked));
|
||||||
_vari_button.signal_scroll_event().connect (sigc::mem_fun (*this, &ShuttleControl::varispeed_button_scroll_event), false);
|
_vari_button.signal_scroll_event ().connect (sigc::mem_fun (*this, &ShuttleControl::varispeed_button_scroll_event), false);
|
||||||
|
|
||||||
/* gtkmm 2.4: the C++ wrapper doesn't work */
|
/* gtkmm 2.4: the C++ wrapper doesn't work */
|
||||||
g_signal_connect ((GObject*) gobj(), "query-tooltip", G_CALLBACK (qt), NULL);
|
g_signal_connect ((GObject*)gobj (), "query-tooltip", G_CALLBACK (qt), NULL);
|
||||||
// signal_query_tooltip().connect (sigc::mem_fun (*this, &ShuttleControl::on_query_tooltip));
|
// signal_query_tooltip().connect (sigc::mem_fun (*this, &ShuttleControl::on_query_tooltip));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,7 +206,7 @@ ShuttleControl::~ShuttleControl ()
|
||||||
void
|
void
|
||||||
ShuttleControl::varispeed_button_clicked ()
|
ShuttleControl::varispeed_button_clicked ()
|
||||||
{
|
{
|
||||||
if (_session->default_play_speed() == 1.0 && !_vari_dialog.is_visible ()) {
|
if (_session->default_play_speed () == 1.0 && !_vari_dialog.is_visible ()) {
|
||||||
_vari_dialog.present ();
|
_vari_dialog.present ();
|
||||||
} else {
|
} else {
|
||||||
_vari_dialog.hide ();
|
_vari_dialog.hide ();
|
||||||
|
@ -238,18 +244,17 @@ ShuttleControl::varispeed_button_scroll_event (GdkEventScroll* ev)
|
||||||
void
|
void
|
||||||
ShuttleControl::do_blink (bool onoff)
|
ShuttleControl::do_blink (bool onoff)
|
||||||
{
|
{
|
||||||
if (!shuttle_grabbed && _session && _session->default_play_speed()!=1.0) {
|
if (!shuttle_grabbed && _session && _session->default_play_speed () != 1.0) {
|
||||||
_info_button.set_active(onoff);
|
_info_button.set_active (onoff);
|
||||||
_vari_button.set_active(onoff);
|
_vari_button.set_active (onoff);
|
||||||
} else {
|
} else {
|
||||||
_info_button.set_active(false);
|
_info_button.set_active (false);
|
||||||
_vari_button.set_active(false);
|
_vari_button.set_active (false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ShuttleControl::set_session (Session *s)
|
ShuttleControl::set_session (Session* s)
|
||||||
{
|
{
|
||||||
SessionHandlePtr::set_session (s);
|
SessionHandlePtr::set_session (s);
|
||||||
_vari_dialog.set_session (_session);
|
_vari_dialog.set_session (_session);
|
||||||
|
@ -274,47 +279,47 @@ ShuttleControl::on_size_allocate (Gtk::Allocation& alloc)
|
||||||
shine_pattern = 0;
|
shine_pattern = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
CairoWidget::on_size_allocate ( alloc);
|
CairoWidget::on_size_allocate (alloc);
|
||||||
|
|
||||||
//background
|
/* background */
|
||||||
pattern = cairo_pattern_create_linear (0, 0, 0, alloc.get_height());
|
pattern = cairo_pattern_create_linear (0, 0, 0, alloc.get_height ());
|
||||||
uint32_t col = UIConfiguration::instance().color ("shuttle");
|
uint32_t col = UIConfiguration::instance ().color ("shuttle");
|
||||||
int r,b,g,a;
|
int r, b, g, a;
|
||||||
UINT_TO_RGBA(col, &r, &g, &b, &a);
|
UINT_TO_RGBA (col, &r, &g, &b, &a);
|
||||||
cairo_pattern_add_color_stop_rgb (pattern, 0.0, r/400.0, g/400.0, b/400.0);
|
cairo_pattern_add_color_stop_rgb (pattern, 0.0, r / 400.0, g / 400.0, b / 400.0);
|
||||||
cairo_pattern_add_color_stop_rgb (pattern, 0.4, r/255.0, g/255.0, b/255.0);
|
cairo_pattern_add_color_stop_rgb (pattern, 0.4, r / 255.0, g / 255.0, b / 255.0);
|
||||||
cairo_pattern_add_color_stop_rgb (pattern, 1.0, r/512.0, g/512.0, b/512.0);
|
cairo_pattern_add_color_stop_rgb (pattern, 1.0, r / 512.0, g / 512.0, b / 512.0);
|
||||||
|
|
||||||
//reflection
|
/* reflection */
|
||||||
shine_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, 10);
|
shine_pattern = cairo_pattern_create_linear (0.0, 0.0, 0.0, 10);
|
||||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0, 1,1,1,0.0);
|
cairo_pattern_add_color_stop_rgba (shine_pattern, 0, 1, 1, 1, 0.0);
|
||||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 0.2, 1,1,1,0.4);
|
cairo_pattern_add_color_stop_rgba (shine_pattern, 0.2, 1, 1, 1, 0.4);
|
||||||
cairo_pattern_add_color_stop_rgba (shine_pattern, 1, 1,1,1,0.1);
|
cairo_pattern_add_color_stop_rgba (shine_pattern, 1, 1, 1, 1, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ShuttleControl::map_transport_state ()
|
ShuttleControl::map_transport_state ()
|
||||||
{
|
{
|
||||||
float speed = 0.0;
|
float speed = 0.0;
|
||||||
float actual_speed = 0.0;
|
float actual_speed = 0.0;
|
||||||
char buf[32];
|
char buf[32];
|
||||||
|
|
||||||
if (_session) {
|
if (_session) {
|
||||||
speed = _session->actual_speed ();
|
speed = _session->actual_speed ();
|
||||||
actual_speed = speed;
|
actual_speed = speed;
|
||||||
if (shuttle_grabbed) {
|
if (shuttle_grabbed) {
|
||||||
speed = requested_speed;
|
speed = requested_speed;
|
||||||
} else if (_session->default_play_speed()!=1.0) {
|
} else if (_session->default_play_speed () != 1.0) {
|
||||||
/*use has selected a varispeed AND the shuttle widget is not held ... show the varispeed*/
|
/*use has selected a varispeed AND the shuttle widget is not held ... show the varispeed*/
|
||||||
actual_speed = _session->default_play_speed();
|
actual_speed = _session->default_play_speed ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (actual_speed != 0) {
|
if (actual_speed != 0) {
|
||||||
if (_session->default_play_speed()==1.0) {
|
if (_session->default_play_speed () == 1.0) {
|
||||||
if (actual_speed == _session->default_play_speed()) {
|
if (actual_speed == _session->default_play_speed ()) {
|
||||||
snprintf (buf, sizeof (buf), "%s", _("Play"));
|
snprintf (buf, sizeof (buf), "%s", _("Play"));
|
||||||
} else if (Config->get_shuttle_units() == Percentage) {
|
} else if (Config->get_shuttle_units () == Percentage) {
|
||||||
{
|
{
|
||||||
if (actual_speed < 0.0) {
|
if (actual_speed < 0.0) {
|
||||||
snprintf (buf, sizeof (buf), "< %.1f%%", -actual_speed * 100.f);
|
snprintf (buf, sizeof (buf), "< %.1f%%", -actual_speed * 100.f);
|
||||||
|
@ -324,7 +329,7 @@ ShuttleControl::map_transport_state ()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bool reversed;
|
bool reversed;
|
||||||
int semi = speed_as_semitones (actual_speed, reversed);
|
int semi = speed_as_semitones (actual_speed, reversed);
|
||||||
if (reversed) {
|
if (reversed) {
|
||||||
snprintf (buf, sizeof (buf), _("< %+2d st"), semi);
|
snprintf (buf, sizeof (buf), _("< %+2d st"), semi);
|
||||||
} else {
|
} else {
|
||||||
|
@ -332,12 +337,12 @@ ShuttleControl::map_transport_state ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { /*default_play_speed (varispeed) is always forward */
|
} else { /*default_play_speed (varispeed) is always forward */
|
||||||
if (Config->get_shuttle_units() == Percentage) {
|
if (Config->get_shuttle_units () == Percentage) {
|
||||||
snprintf (buf, sizeof (buf), "%.1f%%", actual_speed * 100.f);
|
snprintf (buf, sizeof (buf), "%.1f%%", actual_speed * 100.f);
|
||||||
} else {
|
} else {
|
||||||
bool reversed;
|
bool reversed;
|
||||||
int semi = speed_as_semitones (actual_speed, reversed);
|
int semi = speed_as_semitones (actual_speed, reversed);
|
||||||
if (abs(semi)<1) {
|
if (abs (semi) < 1) {
|
||||||
int cents = speed_as_cents (actual_speed, reversed);
|
int cents = speed_as_cents (actual_speed, reversed);
|
||||||
snprintf (buf, sizeof (buf), _("%+2d c"), cents);
|
snprintf (buf, sizeof (buf), _("%+2d c"), cents);
|
||||||
} else {
|
} else {
|
||||||
|
@ -348,25 +353,23 @@ ShuttleControl::map_transport_state ()
|
||||||
} else {
|
} else {
|
||||||
snprintf (buf, sizeof (buf), "%s", _("Stop"));
|
snprintf (buf, sizeof (buf), "%s", _("Stop"));
|
||||||
}
|
}
|
||||||
_info_button.set_text(buf);
|
|
||||||
|
|
||||||
|
_info_button.set_text (buf);
|
||||||
|
|
||||||
if ( (fabsf( speed - last_speed_displayed) < 0.005f) // dead-zone
|
if ((fabsf (speed - last_speed_displayed) < 0.005f) // dead-zone
|
||||||
&& !( speed == 1.f && last_speed_displayed != 1.f)
|
&& !(speed == 1.f && last_speed_displayed != 1.f)
|
||||||
&& !( speed == 0.f && last_speed_displayed != 0.f)
|
&& !(speed == 0.f && last_speed_displayed != 0.f)) {
|
||||||
)
|
|
||||||
{
|
|
||||||
return; // nothing to see here, move along.
|
return; // nothing to see here, move along.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Q: is there a good reason why we re-calculate this every time?
|
// Q: is there a good reason why we re-calculate this every time?
|
||||||
if (fabs(speed) <= (2*DBL_EPSILON)) {
|
if (fabs (speed) <= (2 * DBL_EPSILON)) {
|
||||||
shuttle_fract = 0;
|
shuttle_fract = 0;
|
||||||
} else {
|
} else {
|
||||||
if (Config->get_shuttle_units() == Semitones) {
|
if (Config->get_shuttle_units () == Semitones) {
|
||||||
bool reverse;
|
bool reverse;
|
||||||
int semi = speed_as_semitones (speed, reverse);
|
int semi = speed_as_semitones (speed, reverse);
|
||||||
semi = std::max (-24, std::min (24, semi));
|
semi = std::max (-24, std::min (24, semi));
|
||||||
shuttle_fract = semitones_as_fract (semi, reverse);
|
shuttle_fract = semitones_as_fract (semi, reverse);
|
||||||
} else {
|
} else {
|
||||||
shuttle_fract = speed / shuttle_max_speed;
|
shuttle_fract = speed / shuttle_max_speed;
|
||||||
|
@ -383,39 +386,39 @@ ShuttleControl::build_shuttle_context_menu ()
|
||||||
|
|
||||||
using namespace Menu_Helpers;
|
using namespace Menu_Helpers;
|
||||||
|
|
||||||
shuttle_context_menu = new Menu();
|
shuttle_context_menu = new Menu ();
|
||||||
MenuList& items = shuttle_context_menu->items();
|
MenuList& items = shuttle_context_menu->items ();
|
||||||
|
|
||||||
{
|
{
|
||||||
RadioMenuItem::Group speed_group;
|
RadioMenuItem::Group speed_group;
|
||||||
|
|
||||||
/* XXX this code assumes that Config->get_max_transport_speed() returns 8 */
|
/* XXX this code assumes that Config->get_max_transport_speed() returns 8 */
|
||||||
Menu* speed_menu = manage (new Menu());
|
Menu* speed_menu = manage (new Menu ());
|
||||||
MenuList& speed_items = speed_menu->items();
|
MenuList& speed_items = speed_menu->items ();
|
||||||
|
|
||||||
speed_items.push_back (RadioMenuElem (speed_group, "8", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 8.0f)));
|
speed_items.push_back (RadioMenuElem (speed_group, "8", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 8.0f)));
|
||||||
if (shuttle_max_speed == 8.0) {
|
if (shuttle_max_speed == 8.0) {
|
||||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
static_cast<RadioMenuItem*> (&speed_items.back ())->set_active ();
|
||||||
}
|
}
|
||||||
speed_items.push_back (RadioMenuElem (speed_group, "6", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 6.0f)));
|
speed_items.push_back (RadioMenuElem (speed_group, "6", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 6.0f)));
|
||||||
if (shuttle_max_speed == 6.0) {
|
if (shuttle_max_speed == 6.0) {
|
||||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
static_cast<RadioMenuItem*> (&speed_items.back ())->set_active ();
|
||||||
}
|
}
|
||||||
speed_items.push_back (RadioMenuElem (speed_group, "4", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 4.0f)));
|
speed_items.push_back (RadioMenuElem (speed_group, "4", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 4.0f)));
|
||||||
if (shuttle_max_speed == 4.0) {
|
if (shuttle_max_speed == 4.0) {
|
||||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
static_cast<RadioMenuItem*> (&speed_items.back ())->set_active ();
|
||||||
}
|
}
|
||||||
speed_items.push_back (RadioMenuElem (speed_group, "3", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 3.0f)));
|
speed_items.push_back (RadioMenuElem (speed_group, "3", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 3.0f)));
|
||||||
if (shuttle_max_speed == 3.0) {
|
if (shuttle_max_speed == 3.0) {
|
||||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
static_cast<RadioMenuItem*> (&speed_items.back ())->set_active ();
|
||||||
}
|
}
|
||||||
speed_items.push_back (RadioMenuElem (speed_group, "2", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 2.0f)));
|
speed_items.push_back (RadioMenuElem (speed_group, "2", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 2.0f)));
|
||||||
if (shuttle_max_speed == 2.0) {
|
if (shuttle_max_speed == 2.0) {
|
||||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
static_cast<RadioMenuItem*> (&speed_items.back ())->set_active ();
|
||||||
}
|
}
|
||||||
speed_items.push_back (RadioMenuElem (speed_group, "1.5", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 1.5f)));
|
speed_items.push_back (RadioMenuElem (speed_group, "1.5", sigc::bind (sigc::mem_fun (*this, &ShuttleControl::set_shuttle_max_speed), 1.5f)));
|
||||||
if (shuttle_max_speed == 1.5) {
|
if (shuttle_max_speed == 1.5) {
|
||||||
static_cast<RadioMenuItem*>(&speed_items.back())->set_active ();
|
static_cast<RadioMenuItem*> (&speed_items.back ())->set_active ();
|
||||||
}
|
}
|
||||||
|
|
||||||
items.push_back (MenuElem (_("Maximum speed"), *speed_menu));
|
items.push_back (MenuElem (_("Maximum speed"), *speed_menu));
|
||||||
|
@ -451,26 +454,26 @@ ShuttleControl::on_button_press_event (GdkEventButton* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ev->button) {
|
switch (ev->button) {
|
||||||
case 1:
|
case 1:
|
||||||
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
if (Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
||||||
_session->reset_transport_speed ();
|
_session->reset_transport_speed ();
|
||||||
} else {
|
} else {
|
||||||
add_modal_grab ();
|
add_modal_grab ();
|
||||||
shuttle_grabbed = true;
|
shuttle_grabbed = true;
|
||||||
shuttle_speed_on_grab = _session->actual_speed ();
|
shuttle_speed_on_grab = _session->actual_speed ();
|
||||||
requested_speed = shuttle_speed_on_grab;
|
requested_speed = shuttle_speed_on_grab;
|
||||||
mouse_shuttle (ev->x, true);
|
mouse_shuttle (ev->x, true);
|
||||||
gdk_pointer_grab(ev->window,false,
|
gdk_pointer_grab (ev->window, false,
|
||||||
GdkEventMask( Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK |Gdk::BUTTON_RELEASE_MASK),
|
GdkEventMask (Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK),
|
||||||
NULL,NULL,ev->time);
|
NULL, NULL, ev->time);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
case 3:
|
case 3:
|
||||||
default:
|
default:
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -484,25 +487,24 @@ ShuttleControl::on_button_release_event (GdkEventButton* ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ev->button) {
|
switch (ev->button) {
|
||||||
case 1:
|
case 1:
|
||||||
if (shuttle_grabbed) {
|
if (shuttle_grabbed) {
|
||||||
shuttle_grabbed = false;
|
shuttle_grabbed = false;
|
||||||
remove_modal_grab ();
|
remove_modal_grab ();
|
||||||
gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
gdk_pointer_ungrab (GDK_CURRENT_TIME);
|
||||||
|
|
||||||
if (shuttle_speed_on_grab == 0 ) {
|
if (shuttle_speed_on_grab == 0) {
|
||||||
_session->request_stop ();
|
_session->request_stop ();
|
||||||
} else {
|
} else {
|
||||||
_session->request_transport_speed (shuttle_speed_on_grab);
|
_session->request_transport_speed (shuttle_speed_on_grab);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
return true;
|
||||||
return true;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
case 3:
|
|
||||||
default:
|
|
||||||
return true;
|
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -527,8 +529,8 @@ ShuttleControl::on_motion_notify_event (GdkEventMotion* ev)
|
||||||
gint
|
gint
|
||||||
ShuttleControl::mouse_shuttle (double x, bool force)
|
ShuttleControl::mouse_shuttle (double x, bool force)
|
||||||
{
|
{
|
||||||
double const center = get_width() / 2.0;
|
double const center = get_width () / 2.0;
|
||||||
double distance_from_center = x - center;
|
double distance_from_center = x - center;
|
||||||
|
|
||||||
if (distance_from_center > 0) {
|
if (distance_from_center > 0) {
|
||||||
distance_from_center = min (distance_from_center, center);
|
distance_from_center = min (distance_from_center, center);
|
||||||
|
@ -560,10 +562,10 @@ ShuttleControl::speed_as_semitones (float speed, bool& reverse)
|
||||||
|
|
||||||
if (speed < 0.0) {
|
if (speed < 0.0) {
|
||||||
reverse = true;
|
reverse = true;
|
||||||
return (int) round (12.0 * fast_log2 (-speed));
|
return (int)round (12.0 * fast_log2 (-speed));
|
||||||
} else {
|
} else {
|
||||||
reverse = false;
|
reverse = false;
|
||||||
return (int) round (12.0 * fast_log2 (speed));
|
return (int)round (12.0 * fast_log2 (speed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -574,10 +576,10 @@ ShuttleControl::speed_as_cents (float speed, bool& reverse)
|
||||||
|
|
||||||
if (speed < 0.0) {
|
if (speed < 0.0) {
|
||||||
reverse = true;
|
reverse = true;
|
||||||
return (int) ceilf (1200.0 * fast_log2 (-speed));
|
return (int)ceilf (1200.0 * fast_log2 (-speed));
|
||||||
} else {
|
} else {
|
||||||
reverse = false;
|
reverse = false;
|
||||||
return (int) ceilf (1200.0 * fast_log2 (speed));
|
return (int)ceilf (1200.0 * fast_log2 (speed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -605,7 +607,7 @@ float
|
||||||
ShuttleControl::semitones_as_fract (int semi, bool reverse)
|
ShuttleControl::semitones_as_fract (int semi, bool reverse)
|
||||||
{
|
{
|
||||||
float speed = semitones_as_speed (semi, reverse);
|
float speed = semitones_as_speed (semi, reverse);
|
||||||
return speed/4.0; /* 4.0 is the maximum speed for a 24 semitone shift */
|
return speed / 4.0; /* 4.0 is the maximum speed for a 24 semitone shift */
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -618,7 +620,7 @@ ShuttleControl::fract_as_semitones (float fract, bool& reverse)
|
||||||
void
|
void
|
||||||
ShuttleControl::use_shuttle_fract (bool force, bool zero_ok)
|
ShuttleControl::use_shuttle_fract (bool force, bool zero_ok)
|
||||||
{
|
{
|
||||||
PBD::microseconds_t now = PBD::get_microseconds();
|
PBD::microseconds_t now = PBD::get_microseconds ();
|
||||||
|
|
||||||
shuttle_fract = max (-1.0f, shuttle_fract);
|
shuttle_fract = max (-1.0f, shuttle_fract);
|
||||||
shuttle_fract = min (1.0f, shuttle_fract);
|
shuttle_fract = min (1.0f, shuttle_fract);
|
||||||
|
@ -627,7 +629,7 @@ ShuttleControl::use_shuttle_fract (bool force, bool zero_ok)
|
||||||
more than once per process cycle.
|
more than once per process cycle.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!force && (now - last_shuttle_request) < (PBD::microseconds_t) AudioEngine::instance()->usecs_per_cycle()) {
|
if (!force && (now - last_shuttle_request) < (PBD::microseconds_t)AudioEngine::instance ()->usecs_per_cycle ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -635,17 +637,17 @@ ShuttleControl::use_shuttle_fract (bool force, bool zero_ok)
|
||||||
|
|
||||||
double speed = 0;
|
double speed = 0;
|
||||||
|
|
||||||
if (Config->get_shuttle_units() == Semitones) {
|
if (Config->get_shuttle_units () == Semitones) {
|
||||||
if (shuttle_fract != 0.0) {
|
if (shuttle_fract != 0.0) {
|
||||||
bool reverse;
|
bool reverse;
|
||||||
int semi = fract_as_semitones (shuttle_fract, reverse);
|
int semi = fract_as_semitones (shuttle_fract, reverse);
|
||||||
speed = semitones_as_speed (semi, reverse);
|
speed = semitones_as_speed (semi, reverse);
|
||||||
} else {
|
} else {
|
||||||
speed = 0.0;
|
speed = 0.0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
shuttle_fract = shuttle_fract*shuttle_fract*shuttle_fract; // ^3 preserves the sign;
|
shuttle_fract = shuttle_fract * shuttle_fract * shuttle_fract; // ^3 preserves the sign;
|
||||||
speed = shuttle_max_speed * shuttle_fract;
|
speed = shuttle_max_speed * shuttle_fract;
|
||||||
}
|
}
|
||||||
|
|
||||||
requested_speed = speed;
|
requested_speed = speed;
|
||||||
|
@ -657,9 +659,9 @@ ShuttleControl::use_shuttle_fract (bool force, bool zero_ok)
|
||||||
_session->request_transport_speed_nonzero (speed);
|
_session->request_transport_speed_nonzero (speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (speed != 0 && !_session->transport_state_rolling()) {
|
if (speed != 0 && !_session->transport_state_rolling ()) {
|
||||||
_session->request_roll ();
|
_session->request_roll ();
|
||||||
} else if (speed == 0 && zero_ok && _session->transport_state_rolling()) {
|
} else if (speed == 0 && zero_ok && _session->transport_state_rolling ()) {
|
||||||
_session->request_stop ();
|
_session->request_stop ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -670,27 +672,27 @@ ShuttleControl::set_colors ()
|
||||||
{
|
{
|
||||||
int r, g, b, a;
|
int r, g, b, a;
|
||||||
|
|
||||||
uint32_t bg_color = UIConfiguration::instance().color (X_("shuttle bg"));
|
uint32_t bg_color = UIConfiguration::instance ().color (X_("shuttle bg"));
|
||||||
|
|
||||||
UINT_TO_RGBA (bg_color, &r, &g, &b, &a);
|
UINT_TO_RGBA (bg_color, &r, &g, &b, &a);
|
||||||
bg_r = r/255.0;
|
bg_r = r / 255.0;
|
||||||
bg_g = g/255.0;
|
bg_g = g / 255.0;
|
||||||
bg_b = b/255.0;
|
bg_b = b / 255.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*)
|
ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangle_t*)
|
||||||
{
|
{
|
||||||
cairo_t* cr = ctx->cobj();
|
cairo_t* cr = ctx->cobj ();
|
||||||
// center slider line
|
// center slider line
|
||||||
float yc = get_height() / 2;
|
float yc = get_height () / 2;
|
||||||
float lw = 3;
|
float lw = 3;
|
||||||
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
|
cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND);
|
||||||
cairo_set_line_width (cr, 3);
|
cairo_set_line_width (cr, 3);
|
||||||
cairo_move_to (cr, lw, yc);
|
cairo_move_to (cr, lw, yc);
|
||||||
cairo_line_to (cr, get_width () - lw, yc);
|
cairo_line_to (cr, get_width () - lw, yc);
|
||||||
cairo_set_source_rgb (cr, bg_r, bg_g, bg_b);
|
cairo_set_source_rgb (cr, bg_r, bg_g, bg_b);
|
||||||
if (UIConfiguration::instance().get_widget_prelight() && _hovering) {
|
if (UIConfiguration::instance ().get_widget_prelight () && _hovering) {
|
||||||
cairo_stroke_preserve (cr);
|
cairo_stroke_preserve (cr);
|
||||||
cairo_set_source_rgba (cr, 1, 1, 1, 0.15);
|
cairo_set_source_rgba (cr, 1, 1, 1, 0.15);
|
||||||
}
|
}
|
||||||
|
@ -706,26 +708,25 @@ ShuttleControl::render (Cairo::RefPtr<Cairo::Context> const& ctx, cairo_rectangl
|
||||||
|
|
||||||
/* marker */
|
/* marker */
|
||||||
float visual_fraction = std::max (-1.0f, std::min (1.0f, speed / shuttle_max_speed));
|
float visual_fraction = std::max (-1.0f, std::min (1.0f, speed / shuttle_max_speed));
|
||||||
float marker_size = round (get_height() * 0.66);
|
float marker_size = round (get_height () * 0.66);
|
||||||
float avail_width = get_width() - marker_size;
|
float avail_width = get_width () - marker_size;
|
||||||
float x = 0.5 * (get_width() + visual_fraction * avail_width - marker_size);
|
float x = 0.5 * (get_width () + visual_fraction * avail_width - marker_size);
|
||||||
|
|
||||||
rounded_rectangle (cr, x, 0, marker_size, get_height(), 5);
|
rounded_rectangle (cr, x, 0, marker_size, get_height (), 5);
|
||||||
cairo_set_source_rgba (cr, 0, 0, 0, 1);
|
cairo_set_source_rgba (cr, 0, 0, 0, 1);
|
||||||
cairo_fill(cr);
|
cairo_fill (cr);
|
||||||
rounded_rectangle (cr, x + 1, 1, marker_size - 2, get_height() - 2, 3.5);
|
rounded_rectangle (cr, x + 1, 1, marker_size - 2, get_height () - 2, 3.5);
|
||||||
if (flat_buttons ()) {
|
if (flat_buttons ()) {
|
||||||
uint32_t col = UIConfiguration::instance().color ("shuttle");
|
uint32_t col = UIConfiguration::instance ().color ("shuttle");
|
||||||
Gtkmm2ext::set_source_rgba (cr, col);
|
Gtkmm2ext::set_source_rgba (cr, col);
|
||||||
} else {
|
} else {
|
||||||
cairo_set_source (cr, pattern);
|
cairo_set_source (cr, pattern);
|
||||||
}
|
}
|
||||||
if (UIConfiguration::instance().get_widget_prelight() && _hovering) {
|
if (UIConfiguration::instance ().get_widget_prelight () && _hovering) {
|
||||||
cairo_fill_preserve (cr);
|
cairo_fill_preserve (cr);
|
||||||
cairo_set_source_rgba (cr, 1, 1, 1, 0.15);
|
cairo_set_source_rgba (cr, 1, 1, 1, 0.15);
|
||||||
}
|
}
|
||||||
cairo_fill(cr);
|
cairo_fill (cr);
|
||||||
|
|
||||||
|
|
||||||
last_speed_displayed = speed;
|
last_speed_displayed = speed;
|
||||||
|
|
||||||
|
@ -749,13 +750,13 @@ ShuttleControl::ShuttleControllable::ShuttleControllable (ShuttleControl& s)
|
||||||
void
|
void
|
||||||
ShuttleControl::ShuttleControllable::set_value (double val, PBD::Controllable::GroupControlDisposition /*group_override*/)
|
ShuttleControl::ShuttleControllable::set_value (double val, PBD::Controllable::GroupControlDisposition /*group_override*/)
|
||||||
{
|
{
|
||||||
sc.set_shuttle_fract ((val - lower()) / (upper() - lower()), true);
|
sc.set_shuttle_fract ((val - lower ()) / (upper () - lower ()), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
double
|
double
|
||||||
ShuttleControl::ShuttleControllable::get_value () const
|
ShuttleControl::ShuttleControllable::get_value () const
|
||||||
{
|
{
|
||||||
return lower() + (sc.get_shuttle_fract () * (upper() - lower()));
|
return lower () + (sc.get_shuttle_fract () * (upper () - lower ()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -764,22 +765,21 @@ ShuttleControl::parameter_changed (std::string p)
|
||||||
if (p == "shuttle-units") {
|
if (p == "shuttle-units") {
|
||||||
map_transport_state ();
|
map_transport_state ();
|
||||||
} else if (p == "shuttle-max-speed") {
|
} else if (p == "shuttle-max-speed") {
|
||||||
shuttle_max_speed = Config->get_shuttle_max_speed ();
|
shuttle_max_speed = Config->get_shuttle_max_speed ();
|
||||||
last_speed_displayed = -99999999;
|
last_speed_displayed = -99999999;
|
||||||
map_transport_state ();
|
map_transport_state ();
|
||||||
use_shuttle_fract (true);
|
use_shuttle_fract (true);
|
||||||
delete shuttle_context_menu;
|
delete shuttle_context_menu;
|
||||||
shuttle_context_menu=0;
|
shuttle_context_menu = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
ShuttleControl::on_enter_notify_event (GdkEventCrossing* ev)
|
ShuttleControl::on_enter_notify_event (GdkEventCrossing* ev)
|
||||||
{
|
{
|
||||||
_hovering = true;
|
_hovering = true;
|
||||||
|
|
||||||
if (UIConfiguration::instance().get_widget_prelight()) {
|
if (UIConfiguration::instance ().get_widget_prelight ()) {
|
||||||
queue_draw ();
|
queue_draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -791,7 +791,7 @@ ShuttleControl::on_leave_notify_event (GdkEventCrossing* ev)
|
||||||
{
|
{
|
||||||
_hovering = false;
|
_hovering = false;
|
||||||
|
|
||||||
if (UIConfiguration::instance().get_widget_prelight()) {
|
if (UIConfiguration::instance ().get_widget_prelight ()) {
|
||||||
queue_draw ();
|
queue_draw ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,8 +49,8 @@ public:
|
||||||
void set_shuttle_units (ARDOUR::ShuttleUnits s);
|
void set_shuttle_units (ARDOUR::ShuttleUnits s);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void parameter_changed (std::string);
|
void parameter_changed (std::string);
|
||||||
void build_disp_context_menu ();
|
void build_disp_context_menu ();
|
||||||
Gtk::Menu* disp_context_menu;
|
Gtk::Menu* disp_context_menu;
|
||||||
PBD::ScopedConnection parameter_connection;
|
PBD::ScopedConnection parameter_connection;
|
||||||
|
|
||||||
|
@ -63,29 +63,42 @@ public:
|
||||||
ShuttleControl ();
|
ShuttleControl ();
|
||||||
~ShuttleControl ();
|
~ShuttleControl ();
|
||||||
|
|
||||||
void map_transport_state ();
|
void map_transport_state ();
|
||||||
void set_shuttle_fract (double, bool zero_ok = false);
|
void set_shuttle_fract (double, bool zero_ok = false);
|
||||||
double get_shuttle_fract () const { return shuttle_fract; }
|
double get_shuttle_fract () const
|
||||||
|
{
|
||||||
|
return shuttle_fract;
|
||||||
|
}
|
||||||
void set_session (ARDOUR::Session*);
|
void set_session (ARDOUR::Session*);
|
||||||
|
|
||||||
void do_blink (bool);
|
void do_blink (bool);
|
||||||
|
void set_colors ();
|
||||||
|
|
||||||
struct ShuttleControllable : public PBD::Controllable {
|
struct ShuttleControllable : public PBD::Controllable {
|
||||||
ShuttleControllable (ShuttleControl&);
|
ShuttleControllable (ShuttleControl&);
|
||||||
void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
|
void set_value (double, PBD::Controllable::GroupControlDisposition group_override);
|
||||||
double get_value (void) const;
|
double get_value (void) const;
|
||||||
|
|
||||||
double lower() const { return -1.0; }
|
double lower () const { return -1.0; }
|
||||||
double upper() const { return 1.0; }
|
double upper () const { return 1.0; }
|
||||||
|
|
||||||
ShuttleControl& sc;
|
ShuttleControl& sc;
|
||||||
};
|
};
|
||||||
|
|
||||||
boost::shared_ptr<ShuttleControllable> controllable() const { return _controllable; }
|
boost::shared_ptr<ShuttleControllable> controllable () const
|
||||||
void set_colors ();
|
{
|
||||||
|
return _controllable;
|
||||||
|
}
|
||||||
|
|
||||||
ArdourWidgets::ArdourButton* info_button () { return &_info_button; }
|
ArdourWidgets::ArdourButton* info_button ()
|
||||||
ArdourWidgets::ArdourButton* vari_button () { return &_vari_button; }
|
{
|
||||||
|
return &_info_button;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArdourWidgets::ArdourButton* vari_button ()
|
||||||
|
{
|
||||||
|
return &_vari_button;
|
||||||
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static int speed_as_semitones (float, bool&);
|
static int speed_as_semitones (float, bool&);
|
||||||
|
@ -94,40 +107,39 @@ public:
|
||||||
static float semitones_as_speed (int, bool);
|
static float semitones_as_speed (int, bool);
|
||||||
static float semitones_as_fract (int, bool);
|
static float semitones_as_fract (int, bool);
|
||||||
|
|
||||||
static int speed_as_cents (float, bool&);
|
static int speed_as_cents (float, bool&);
|
||||||
static float cents_as_speed (int, bool);
|
static float cents_as_speed (int, bool);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool _hovering;
|
bool _hovering;
|
||||||
float shuttle_max_speed;
|
float shuttle_max_speed;
|
||||||
float last_speed_displayed;
|
float last_speed_displayed;
|
||||||
bool shuttle_grabbed;
|
bool shuttle_grabbed;
|
||||||
double shuttle_speed_on_grab;
|
double shuttle_speed_on_grab;
|
||||||
double requested_speed;
|
double requested_speed;
|
||||||
float shuttle_fract;
|
float shuttle_fract;
|
||||||
boost::shared_ptr<ShuttleControllable> _controllable;
|
boost::shared_ptr<ShuttleControllable> _controllable;
|
||||||
cairo_pattern_t* pattern;
|
cairo_pattern_t* pattern;
|
||||||
cairo_pattern_t* shine_pattern;
|
cairo_pattern_t* shine_pattern;
|
||||||
PBD::microseconds_t last_shuttle_request;
|
PBD::microseconds_t last_shuttle_request;
|
||||||
PBD::ScopedConnection parameter_connection;
|
PBD::ScopedConnection parameter_connection;
|
||||||
ShuttleInfoButton _info_button;
|
ShuttleInfoButton _info_button;
|
||||||
Gtk::Menu* shuttle_context_menu;
|
Gtk::Menu* shuttle_context_menu;
|
||||||
ArdourWidgets::BindingProxy binding_proxy;
|
ArdourWidgets::BindingProxy binding_proxy;
|
||||||
float bg_r, bg_g, bg_b;
|
float bg_r, bg_g, bg_b;
|
||||||
void build_shuttle_context_menu ();
|
void build_shuttle_context_menu ();
|
||||||
void set_shuttle_max_speed (float);
|
void set_shuttle_max_speed (float);
|
||||||
|
|
||||||
VarispeedDialog _vari_dialog;
|
VarispeedDialog _vari_dialog;
|
||||||
ArdourWidgets::ArdourButton _vari_button;
|
ArdourWidgets::ArdourButton _vari_button;
|
||||||
void varispeed_button_clicked ();
|
void varispeed_button_clicked ();
|
||||||
bool varispeed_button_scroll_event (GdkEventScroll*);
|
bool varispeed_button_scroll_event (GdkEventScroll*);
|
||||||
|
|
||||||
bool on_enter_notify_event (GdkEventCrossing*);
|
bool on_enter_notify_event (GdkEventCrossing*);
|
||||||
bool on_leave_notify_event (GdkEventCrossing*);
|
bool on_leave_notify_event (GdkEventCrossing*);
|
||||||
bool on_button_press_event (GdkEventButton*);
|
bool on_button_press_event (GdkEventButton*);
|
||||||
bool on_button_release_event(GdkEventButton*);
|
bool on_button_release_event (GdkEventButton*);
|
||||||
bool on_motion_notify_event(GdkEventMotion*);
|
bool on_motion_notify_event (GdkEventMotion*);
|
||||||
|
|
||||||
bool on_button_press_event_for_display (GdkEventButton*);
|
bool on_button_press_event_for_display (GdkEventButton*);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user