session->engine().make_port_name_non_relative (outp->name())
);
-
- StripableSelectionChanged.connect (selection_connection, MISSING_INVALIDATOR, boost::bind (&FaderPort::gui_track_selection_changed, this, _1), this);
-
/* Catch port connections and disconnections */
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connection, MISSING_INVALIDATOR, boost::bind (&FaderPort::connection_handler, this, _1, _2, _3, _4, _5), this);
if (_input_port) {
DEBUG_TRACE (DEBUG::FaderPort, string_compose ("unregistering input port %1\n", boost::shared_ptr<ARDOUR::Port>(_input_port)->name()));
+ Glib::Threads::Mutex::Lock em (AudioEngine::instance()->process_lock());
AudioEngine::instance()->unregister_port (_input_port);
_input_port.reset ();
}
if (_output_port) {
_output_port->drain (10000, 250000); /* check every 10 msecs, wait up to 1/4 second for the port to drain */
DEBUG_TRACE (DEBUG::FaderPort, string_compose ("unregistering output port %1\n", boost::shared_ptr<ARDOUR::Port>(_output_port)->name()));
+ Glib::Threads::Mutex::Lock em (AudioEngine::instance()->process_lock());
AudioEngine::instance()->unregister_port (_output_port);
_output_port.reset ();
}
void
FaderPort::thread_init ()
{
- struct sched_param rtparam;
-
pthread_set_name (event_loop_name().c_str());
PBD::notify_event_loops_about_thread_creation (pthread_self(), event_loop_name(), 2048);
ARDOUR::SessionEvent::create_per_thread_pool (event_loop_name(), 128);
- memset (&rtparam, 0, sizeof (rtparam));
- rtparam.sched_priority = 9; /* XXX should be relative to audio (JACK) thread */
-
- if (pthread_setschedparam (pthread_self(), SCHED_FIFO, &rtparam) != 0) {
- // do we care? not particularly.
- }
+ set_thread_priority ();
}
void
if (tb->value) {
gain->start_touch (now);
} else {
- gain->stop_touch (true, now);
+ gain->stop_touch (now);
}
}
}
if ((button_state & trim_modifier) == trim_modifier ) { // mod+encoder = input trim
boost::shared_ptr<AutomationControl> trim = _current_stripable->trim_control ();
if (trim) {
- float val = trim->get_user(); //for gain elements, the "user" value is in dB
- val += delta;
- trim->set_user(val);
+ float val = accurate_coefficient_to_dB (trim->get_value());
+ val += delta * .5f; // use 1/2 dB Steps -20..+20
+ trim->set_value (dB_to_coefficient (val), Controllable::UseGroup);
}
} else if (width_modifier && ((button_state & width_modifier) == width_modifier)) {
ardour_pan_width (delta);
}
void
-FaderPort::gui_track_selection_changed (StripableNotificationListPtr stripables)
+FaderPort::stripable_selection_changed ()
{
set_current_stripable (ControlProtocol::first_selected_stripable());
}