, _connection_state (ConnectionState (0))
, _device_active (false)
, _ctrls (*this)
- , _channel_off (0)
, _plugin_off (0)
, _parameter_off (0)
, _show_presets (false)
setup_actions ();
_ctrls.FaderModeChanged.connect_same_thread (modechange_connections, boost::bind (&FaderPort8::notify_fader_mode_changed, this));
- _ctrls.MixModeChanged.connect_same_thread (modechange_connections, boost::bind (&FaderPort8::assign_strips, this, true));
+ _ctrls.MixModeChanged.connect_same_thread (modechange_connections, boost::bind (&FaderPort8::assign_strips, this));
}
FaderPort8::~FaderPort8 ()
if (_input_port) {
DEBUG_TRACE (DEBUG::FaderPort8, 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::FaderPort8, 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
FaderPort8::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 ();
}
bool
// ideally check firmware version >= 1.01 (USB bcdDevice 0x0101) (vendor 0x194f prod 0x0202)
// but we don't have a handle to the underlying USB device here.
- _channel_off = _plugin_off = _parameter_off = 0;
+ memset (_channel_off, 0, sizeof (_channel_off));
+ _plugin_off = _parameter_off = 0;
_blink_onoff = false;
_shift_lock = false;
_shift_pressed = 0;
tx_midi3 (0x90, 0x46, 0x00);
send_session_state ();
- assign_strips (true);
+ assign_strips ();
Glib::RefPtr<Glib::TimeoutSource> blink_timer =
Glib::TimeoutSource::create (200);
node.set_property (X_("clock-mode"), _clock_mode);
node.set_property (X_("scribble-mode"), _scribble_mode);
+ node.set_property (X_("two-line-text"), _two_line_text);
for (UserActionMap::const_iterator i = _user_action_map.begin (); i != _user_action_map.end (); ++i) {
if (i->second.empty()) {
node.get_property (X_("clock-mode"), _clock_mode);
node.get_property (X_("scribble-mode"), _scribble_mode);
+ node.get_property (X_("two-line-text"), _two_line_text);
_user_action_map.clear ();
// TODO: When re-loading state w/o surface re-init becomes possible,
}
int n_strips = strips.size();
- _channel_off = std::min (_channel_off, n_strips - 8);
- _channel_off = std::max (0, _channel_off);
+ int channel_off = get_channel_off (_ctrls.mix_mode ());
+ channel_off = std::min (channel_off, n_strips - 8);
+ channel_off = std::max (0, channel_off);
+ set_channel_off (_ctrls.mix_mode (), channel_off);
uint8_t id = 0;
- int skip = _channel_off;
+ int skip = channel_off;
for (StripableList::const_iterator s = strips.begin(); s != strips.end(); ++s) {
if (skip > 0) {
--skip;
*/
void
-FaderPort8::assign_strips (bool reset_bank)
+FaderPort8::assign_strips ()
{
- if (reset_bank) {
- _channel_off = 0;
- }
-
assigned_stripable_connections.drop_connections ();
_assigned_strips.clear ();
return;
}
#if 1 /* single exclusive selection by default, toggle via shift */
+
+# if 1 /* selecting a selected strip -> move fader to unity */
+ if (s == first_selected_stripable () && !shift_mod ()) {
+ if (_ctrls.fader_mode () == ModeTrack) {
+ boost::shared_ptr<AutomationControl> ac = s->gain_control ();
+ ac->start_touch (ac->session().transport_frame());
+ ac->set_value (ac->normal (), PBD::Controllable::UseGroup);
+ }
+ return;
+ }
+# endif
+
if (shift_mod ()) {
ToggleStripableSelection (s);
} else {
ARMButtonChange (false);
break;
}
- assign_strips (false);
+ assign_strips ();
notify_automation_mode_changed ();
}
* - Properties::hidden
* - Properties::order
*/
- assign_strips (false);
+ assign_strips ();
}
/* called from static PresentationInfo::Change */
}
int off = std::distance (strips.begin(), it);
- if (_channel_off <= off && off < _channel_off + 8) {
+ int channel_off = get_channel_off (_ctrls.mix_mode ());
+ if (channel_off <= off && off < channel_off + 8) {
return;
}
- if (_channel_off > off) {
- _channel_off = off;
+ if (channel_off > off) {
+ channel_off = off;
} else {
- _channel_off = off - 7;
+ channel_off = off - 7;
}
- assign_strips (false);
+ set_channel_off (_ctrls.mix_mode (), channel_off);
+ assign_strips ();
}
void
if (down) {
dt *= -1;
}
- _channel_off += dt;
- assign_strips (false);
+ set_channel_off (_ctrls.mix_mode (), get_channel_off (_ctrls.mix_mode ()) + dt);
+ assign_strips ();
}
void