Rename ControlProtocol::session to ControlProtocol::_session

To match ARDOUR_UI, towards finally sharing code here.
This commit is contained in:
David Robillard 2021-06-17 10:57:07 -04:00
parent 927c7328cc
commit 56fe5b47ae
26 changed files with 419 additions and 419 deletions

View file

@ -105,13 +105,13 @@ CC121::CC121 (Session& s)
_input_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (inp->name())
_session->engine().make_port_name_non_relative (inp->name())
);
_output_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (outp->name())
_session->engine().make_port_name_non_relative (outp->name())
);
@ -309,7 +309,7 @@ CC121::button_press_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
if (_current_stripable) {
boost::shared_ptr<AutomationControl> gain = _current_stripable->gain_control ();
if (gain) {
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
gain->start_touch (now);
}
}
@ -356,7 +356,7 @@ CC121::button_release_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
if (_current_stripable) {
boost::shared_ptr<AutomationControl> gain = _current_stripable->gain_control ();
if (gain) {
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
gain->stop_touch (now);
}
}
@ -642,7 +642,7 @@ CC121::map_recenable_state ()
bool onoff;
switch (session->record_status()) {
switch (_session->record_status()) {
case Session::Disabled:
onoff = false;
break;
@ -650,7 +650,7 @@ CC121::map_recenable_state ()
onoff = blink_state;
break;
case Session::Recording:
if (session->have_rec_enabled_track ()) {
if (_session->have_rec_enabled_track ()) {
onoff = true;
} else {
onoff = blink_state;
@ -667,7 +667,7 @@ CC121::map_recenable_state ()
void
CC121::map_transport_state ()
{
get_button (Loop).set_led_state (_output_port, session->get_play_loop());
get_button (Loop).set_led_state (_output_port, _session->get_play_loop());
float ts = get_transport_speed();
@ -689,8 +689,8 @@ CC121::map_transport_state ()
void
CC121::connect_session_signals()
{
session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&CC121::map_recenable_state, this), this);
session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&CC121::map_transport_state, this), this);
_session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&CC121::map_recenable_state, this), this);
_session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&CC121::map_transport_state, this), this);
}
bool
@ -706,7 +706,7 @@ CC121::midi_input_handler (Glib::IOCondition ioc, boost::shared_ptr<ARDOUR::Asyn
port->clear ();
DEBUG_TRACE (DEBUG::CC121, string_compose ("data available on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
port->parse (now);
}
@ -1053,8 +1053,8 @@ void
CC121::drop_current_stripable ()
{
if (_current_stripable) {
if (_current_stripable == session->monitor_out()) {
set_current_stripable (session->master_out());
if (_current_stripable == _session->monitor_out()) {
set_current_stripable (_session->master_out());
} else {
set_current_stripable (boost::shared_ptr<Stripable>());
}
@ -1256,7 +1256,7 @@ CC121::map_stripable_state ()
map_auto ();
map_monitoring ();
if (_current_stripable == session->monitor_out()) {
if (_current_stripable == _session->monitor_out()) {
map_cut ();
} else {
map_mute ();

View file

@ -157,7 +157,7 @@ CC121::mute ()
return;
}
if (_current_stripable == session->monitor_out()) {
if (_current_stripable == _session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mp = _current_stripable->monitor_control();
mp->set_cut_all (!mp->cut_all());
return;
@ -194,7 +194,7 @@ CC121::rec_enable ()
void
CC121::use_master ()
{
boost::shared_ptr<Stripable> r = session->master_out();
boost::shared_ptr<Stripable> r = _session->master_out();
if (r) {
if (_current_stripable == r) {
r = pre_master_stripable.lock();
@ -202,7 +202,7 @@ CC121::use_master ()
get_button(Output).set_led_state (_output_port, false);
blinkers.remove (Output);
} else {
if (_current_stripable != session->master_out() && _current_stripable != session->monitor_out()) {
if (_current_stripable != _session->master_out() && _current_stripable != _session->monitor_out()) {
pre_master_stripable = boost::weak_ptr<Stripable> (_current_stripable);
}
set_current_stripable (r);
@ -215,7 +215,7 @@ CC121::use_master ()
void
CC121::use_monitor ()
{
boost::shared_ptr<Stripable> r = session->monitor_out();
boost::shared_ptr<Stripable> r = _session->monitor_out();
if (r) {
if (_current_stripable == r) {
@ -224,7 +224,7 @@ CC121::use_monitor ()
get_button(Output).set_led_state (_output_port, false);
blinkers.remove (Output);
} else {
if (_current_stripable != session->master_out() && _current_stripable != session->monitor_out()) {
if (_current_stripable != _session->master_out() && _current_stripable != _session->monitor_out()) {
pre_monitor_stripable = boost::weak_ptr<Stripable> (_current_stripable);
}
set_current_stripable (r);

View file

@ -41,7 +41,7 @@ using namespace ARDOUR;
PBD::Signal2<void,std::string,std::string> BasicUI::AccessAction;
BasicUI::BasicUI (Session& s)
: session (&s)
: _session (&s)
{
}
@ -72,21 +72,21 @@ BasicUI::access_action ( std::string action_path )
void
BasicUI::loop_toggle ()
{
if (!session) {
if (!_session) {
return;
}
Location * looploc = session->locations()->auto_loop_location();
Location * looploc = _session->locations()->auto_loop_location();
if (!looploc) {
return;
}
if (session->get_play_loop()) {
if (_session->get_play_loop()) {
/* looping enabled, our job is to disable it */
session->request_play_loop (false);
_session->request_play_loop (false);
} else {
@ -97,9 +97,9 @@ BasicUI::loop_toggle ()
does not start transport.
*/
if (Config->get_loop_is_mode()) {
session->request_play_loop (true, false);
_session->request_play_loop (true, false);
} else {
session->request_play_loop (true, true);
_session->request_play_loop (true, true);
}
}
@ -111,10 +111,10 @@ void
BasicUI::loop_location (samplepos_t start, samplepos_t end)
{
Location* tll;
if ((tll = session->locations()->auto_loop_location()) == 0) {
Location* loc = new Location (*session, start, end, _("Loop"), Location::IsAutoLoop);
session->locations()->add (loc, true);
session->set_auto_loop_location (loc);
if ((tll = _session->locations()->auto_loop_location()) == 0) {
Location* loc = new Location (*_session, start, end, _("Loop"), Location::IsAutoLoop);
_session->locations()->add (loc, true);
_session->set_auto_loop_location (loc);
} else {
tll->set_hidden (false, this);
tll->set (start, end);
@ -124,58 +124,58 @@ BasicUI::loop_location (samplepos_t start, samplepos_t end)
void
BasicUI::goto_start (bool and_roll)
{
session->goto_start (and_roll);
_session->goto_start (and_roll);
}
void
BasicUI::goto_zero ()
{
session->request_locate (0);
_session->request_locate (0);
}
void
BasicUI::goto_end ()
{
session->goto_end ();
_session->goto_end ();
}
void
BasicUI::add_marker (const std::string& markername)
{
samplepos_t where = session->audible_sample();
Location *location = new Location (*session, where, where, markername, Location::IsMark);
session->begin_reversible_command (_("add marker"));
XMLNode &before = session->locations()->get_state();
session->locations()->add (location, true);
XMLNode &after = session->locations()->get_state();
session->add_command (new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
samplepos_t where = _session->audible_sample();
Location *location = new Location (*_session, where, where, markername, Location::IsMark);
_session->begin_reversible_command (_("add marker"));
XMLNode &before = _session->locations()->get_state();
_session->locations()->add (location, true);
XMLNode &after = _session->locations()->get_state();
_session->add_command (new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
}
void
BasicUI::remove_marker_at_playhead ()
{
if (session) {
if (_session) {
//set up for undo
XMLNode &before = session->locations()->get_state();
XMLNode &before = _session->locations()->get_state();
bool removed = false;
//find location(s) at this time
Locations::LocationList locs;
session->locations()->find_all_between (session->audible_sample(), session->audible_sample()+1, locs, Location::Flags(0));
_session->locations()->find_all_between (_session->audible_sample(), _session->audible_sample()+1, locs, Location::Flags(0));
for (Locations::LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if ((*i)->is_mark()) {
session->locations()->remove (*i);
_session->locations()->remove (*i);
removed = true;
}
}
//store undo
if (removed) {
session->begin_reversible_command (_("remove marker"));
XMLNode &after = session->locations()->get_state();
session->add_command(new MementoCommand<Locations>(*(session->locations()), &before, &after));
session->commit_reversible_command ();
_session->begin_reversible_command (_("remove marker"));
XMLNode &after = _session->locations()->get_state();
_session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
}
}
}
@ -195,14 +195,14 @@ BasicUI::button_varispeed (bool fwd)
if (fwd) {
if (transport_speed <= 0) {
session->request_transport_speed (1.0, false);
session->request_roll (TRS_UI);
_session->request_transport_speed (1.0, false);
_session->request_roll (TRS_UI);
return;
}
} else {
if (transport_speed >= 0) {
session->request_transport_speed (-1.0, false);
session->request_roll (TRS_UI);
_session->request_transport_speed (-1.0, false);
_session->request_roll (TRS_UI);
return;
}
}
@ -216,13 +216,13 @@ BasicUI::button_varispeed (bool fwd)
if (fwd) {
if (transport_speed <= 0) {
session->request_transport_speed (1.0, false);
session->request_roll (TRS_UI);
_session->request_transport_speed (1.0, false);
_session->request_roll (TRS_UI);
}
} else {
if (transport_speed >= 0) {
session->request_transport_speed (-1.0, false);
session->request_roll (TRS_UI);
_session->request_transport_speed (-1.0, false);
_session->request_roll (TRS_UI);
}
}
@ -267,8 +267,8 @@ BasicUI::button_varispeed (bool fwd)
speed = semitone_ratio * transport_speed;
speed = std::max (-maxspeed, std::min (maxspeed, speed));
session->request_transport_speed (speed, false);
session->request_roll (TRS_UI);
_session->request_transport_speed (speed, false);
_session->request_roll (TRS_UI);
}
void
@ -286,13 +286,13 @@ BasicUI::ffwd ()
void
BasicUI::transport_stop ()
{
session->request_stop ();
_session->request_stop ();
}
bool
BasicUI::stop_button_onoff () const
{
return session->transport_stopped_or_stopping ();
return _session->transport_stopped_or_stopping ();
}
bool
@ -316,7 +316,7 @@ BasicUI::rewind_button_onoff () const
bool
BasicUI::loop_button_onoff () const
{
return session->get_play_loop();
return _session->get_play_loop();
}
void
@ -324,17 +324,17 @@ BasicUI::transport_play (bool from_last_start)
{
/* ::toggle_roll() is smarter and preferred */
if (!session) {
if (!_session) {
return;
}
if (session->is_auditioning()) {
if (_session->is_auditioning()) {
return;
}
bool rolling = transport_rolling();
if (session->get_play_loop()) {
if (_session->get_play_loop()) {
/* If loop playback is not a mode, then we should cancel
it when this action is requested. If it is a mode
@ -347,99 +347,99 @@ BasicUI::transport_play (bool from_last_start)
*/
if (rolling) {
/* stop loop playback but keep rolling */
session->request_play_loop (false, false);
_session->request_play_loop (false, false);
}
}
} else if (session->get_play_range () ) {
} else if (_session->get_play_range () ) {
/* stop playing a range if we currently are */
session->request_play_range (0, true);
_session->request_play_range (0, true);
}
if (rolling) {
session->request_transport_speed (1.0, false, TRS_UI);
_session->request_transport_speed (1.0, false, TRS_UI);
} else {
session->request_roll ();
_session->request_roll ();
}
}
void
BasicUI::rec_enable_toggle ()
{
switch (session->record_status()) {
switch (_session->record_status()) {
case Session::Disabled:
if (session->ntracks() == 0) {
if (_session->ntracks() == 0) {
// string txt = _("Please create 1 or more track\nbefore trying to record.\nCheck the Session menu.");
// MessageDialog msg (*editor, txt);
// msg.run ();
return;
}
session->maybe_enable_record ();
_session->maybe_enable_record ();
break;
case Session::Recording:
case Session::Enabled:
session->disable_record (false, true);
_session->disable_record (false, true);
}
}
void
BasicUI::all_tracks_rec_in ()
{
session->set_all_tracks_record_enabled (true);
_session->set_all_tracks_record_enabled (true);
}
void
BasicUI::all_tracks_rec_out ()
{
session->set_all_tracks_record_enabled (false);
_session->set_all_tracks_record_enabled (false);
}
void
BasicUI::save_state ()
{
session->save_state ("");
_session->save_state ("");
}
void
BasicUI::prev_marker ()
{
samplepos_t pos = session->locations()->first_mark_before (session->transport_sample());
samplepos_t pos = _session->locations()->first_mark_before (_session->transport_sample());
if (pos >= 0) {
session->request_locate (pos);
_session->request_locate (pos);
} else {
session->goto_start ();
_session->goto_start ();
}
}
void
BasicUI::next_marker ()
{
samplepos_t pos = session->locations()->first_mark_after (session->transport_sample());
samplepos_t pos = _session->locations()->first_mark_after (_session->transport_sample());
if (pos >= 0) {
session->request_locate (pos);
_session->request_locate (pos);
} else {
session->goto_end();
_session->goto_end();
}
}
void
BasicUI::set_transport_speed (double speed)
{
session->request_transport_speed (speed);
_session->request_transport_speed (speed);
}
double
BasicUI::get_transport_speed () const
{
return session->actual_speed ();
return _session->actual_speed ();
}
double
BasicUI::transport_rolling () const
{
return !session->transport_stopped_or_stopping ();
return !_session->transport_stopped_or_stopping ();
}
void
@ -457,79 +457,79 @@ BasicUI::redo ()
void
BasicUI::toggle_all_rec_enables ()
{
if (session->get_record_enabled()) {
// session->record_disenable_all ();
if (_session->get_record_enabled()) {
// _session->record_disenable_all ();
} else {
// session->record_enable_all ();
// _session->record_enable_all ();
}
}
void
BasicUI::toggle_punch_in ()
{
session->config.set_punch_in (!session->config.get_punch_in());
_session->config.set_punch_in (!_session->config.get_punch_in());
}
void
BasicUI::toggle_punch_out ()
{
session->config.set_punch_out (!session->config.get_punch_out());
_session->config.set_punch_out (!_session->config.get_punch_out());
}
bool
BasicUI::get_record_enabled ()
{
return session->get_record_enabled();
return _session->get_record_enabled();
}
void
BasicUI::set_record_enable (bool yn)
{
if (yn) {
session->maybe_enable_record ();
_session->maybe_enable_record ();
} else {
session->disable_record (false, true);
_session->disable_record (false, true);
}
}
samplepos_t
BasicUI::transport_sample ()
{
return session->transport_sample();
return _session->transport_sample();
}
void
BasicUI::locate (samplepos_t where, LocateTransportDisposition ltd)
{
session->request_locate (where, ltd);
_session->request_locate (where, ltd);
}
void
BasicUI::locate (samplepos_t where, bool roll)
{
session->request_locate (where, roll ? MustRoll : RollIfAppropriate);
_session->request_locate (where, roll ? MustRoll : RollIfAppropriate);
}
void
BasicUI::jump_by_seconds (double secs, LocateTransportDisposition ltd)
{
samplepos_t current = session->transport_sample();
double s = (double) current / (double) session->nominal_sample_rate();
samplepos_t current = _session->transport_sample();
double s = (double) current / (double) _session->nominal_sample_rate();
s+= secs;
if (s < 0) {
s = 0;
}
s = s * session->nominal_sample_rate();
s = s * _session->nominal_sample_rate();
session->request_locate (floor(s), ltd);
_session->request_locate (floor(s), ltd);
}
void
BasicUI::jump_by_bars (double bars, LocateTransportDisposition ltd)
{
TempoMap& tmap (session->tempo_map());
Timecode::BBT_Time bbt (tmap.bbt_at_sample (session->transport_sample()));
TempoMap& tmap (_session->tempo_map());
Timecode::BBT_Time bbt (tmap.bbt_at_sample (_session->transport_sample()));
bars += bbt.bars;
if (bars < 0) {
@ -540,25 +540,25 @@ BasicUI::jump_by_bars (double bars, LocateTransportDisposition ltd)
any.type = AnyTime::BBT;
any.bbt.bars = bars;
session->request_locate (session->convert_to_samples (any), ltd);
_session->request_locate (_session->convert_to_samples (any), ltd);
}
void
BasicUI::jump_by_beats (double beats, LocateTransportDisposition ltd)
{
TempoMap& tmap (session->tempo_map ());
double qn_goal = tmap.quarter_note_at_sample (session->transport_sample ()) + beats;
TempoMap& tmap (_session->tempo_map ());
double qn_goal = tmap.quarter_note_at_sample (_session->transport_sample ()) + beats;
if (qn_goal < 0.0) {
qn_goal = 0.0;
}
session->request_locate (tmap.sample_at_quarter_note (qn_goal), ltd);
_session->request_locate (tmap.sample_at_quarter_note (qn_goal), ltd);
}
void
BasicUI::toggle_monitor_mute ()
{
if (session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
if (_session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = _session->monitor_out()->monitor_control();
if (mon->cut_all ()) {
mon->set_cut_all (false);
} else {
@ -570,8 +570,8 @@ BasicUI::toggle_monitor_mute ()
void
BasicUI::toggle_monitor_dim ()
{
if (session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
if (_session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = _session->monitor_out()->monitor_control();
if (mon->dim_all ()) {
mon->set_dim_all (false);
} else {
@ -583,8 +583,8 @@ BasicUI::toggle_monitor_dim ()
void
BasicUI::toggle_monitor_mono ()
{
if (session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
if (_session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mon = _session->monitor_out()->monitor_control();
if (mon->mono()) {
mon->set_mono (false);
} else {
@ -596,7 +596,7 @@ BasicUI::toggle_monitor_mono ()
void
BasicUI::midi_panic ()
{
session->midi_panic ();
_session->midi_panic ();
}
void
@ -611,16 +611,16 @@ BasicUI::toggle_roll (bool roll_out_of_bounded_mode)
{
/* TO BE KEPT IN SYNC WITH ARDOUR_UI::toggle_roll() */
if (!session) {
if (!_session) {
return;
}
if (session->is_auditioning()) {
session->cancel_audition ();
if (_session->is_auditioning()) {
_session->cancel_audition ();
return;
}
if (session->config.get_external_sync()) {
if (_session->config.get_external_sync()) {
switch (TransportMasterManager::instance().current()->type()) {
case Engine:
break;
@ -637,34 +637,34 @@ BasicUI::toggle_roll (bool roll_out_of_bounded_mode)
if (roll_out_of_bounded_mode) {
/* drop out of loop/range playback but leave transport rolling */
if (session->get_play_loop()) {
if (_session->get_play_loop()) {
if (session->actively_recording()) {
if (_session->actively_recording()) {
/* actually stop transport because
otherwise the captured data will make
no sense.
*/
session->request_play_loop (false, true);
_session->request_play_loop (false, true);
} else {
session->request_play_loop (false, false);
_session->request_play_loop (false, false);
}
} else if (session->get_play_range ()) {
} else if (_session->get_play_range ()) {
session->request_cancel_play_range ();
_session->request_cancel_play_range ();
}
} else {
session->request_stop (true, true);
_session->request_stop (true, true);
}
} else { /* not rolling */
if (session->get_play_loop() && Config->get_loop_is_mode()) {
session->request_locate (session->locations()->auto_loop_location()->start(), MustRoll);
if (_session->get_play_loop() && Config->get_loop_is_mode()) {
_session->request_locate (_session->locations()->auto_loop_location()->start(), MustRoll);
} else {
session->request_roll (TRS_UI);
_session->request_roll (TRS_UI);
}
}
}
@ -672,7 +672,7 @@ BasicUI::toggle_roll (bool roll_out_of_bounded_mode)
void
BasicUI::stop_forget ()
{
session->request_stop (true, true);
_session->request_stop (true, true);
}
void BasicUI::mark_in () { access_action("Common/start-range-from-playhead"); }
@ -713,26 +713,26 @@ void BasicUI::scroll_dn_1_page() { access_action("Editor/scroll-tracks-down"); }
bool
BasicUI::locating ()
{
return session->locate_pending();
return _session->locate_pending();
}
bool
BasicUI::locked ()
{
return session->transport_locked ();
return _session->transport_locked ();
}
void
BasicUI::timecode_time (samplepos_t where, Timecode::Time& timecode)
{
session->timecode_time (where, *((Timecode::Time *) &timecode));
_session->timecode_time (where, *((Timecode::Time *) &timecode));
}
void
BasicUI::cancel_all_solo ()
{
if (session) {
session->cancel_all_solo ();
if (_session) {
_session->cancel_all_solo ();
}
}
@ -745,11 +745,11 @@ struct SortLocationsByPosition {
void
BasicUI::goto_nth_marker (int n)
{
if (!session) {
if (!_session) {
return;
}
const Locations::LocationList& l (session->locations()->list());
const Locations::LocationList& l (_session->locations()->list());
Locations::LocationList ordered;
ordered = l;
@ -759,7 +759,7 @@ BasicUI::goto_nth_marker (int n)
for (Locations::LocationList::iterator i = ordered.begin(); n >= 0 && i != ordered.end(); ++i) {
if ((*i)->is_mark() && !(*i)->is_hidden() && !(*i)->is_session_range()) {
if (n == 0) {
session->request_locate ((*i)->start());
_session->request_locate ((*i)->start());
break;
}
--n;

View file

@ -278,7 +278,7 @@ ControlProtocol::route_set_soloed (uint32_t table_index, bool yn)
boost::shared_ptr<Route> r = route_table[table_index];
if (r != 0) {
session->set_control (r->solo_control(), yn ? 1.0 : 0.0, Controllable::UseGroup);
_session->set_control (r->solo_control(), yn ? 1.0 : 0.0, Controllable::UseGroup);
}
}
@ -329,37 +329,37 @@ ControlProtocol::set_state (XMLNode const & node, int /* version */)
boost::shared_ptr<Stripable>
ControlProtocol::first_selected_stripable () const
{
return session->selection().first_selected_stripable ();
return _session->selection().first_selected_stripable ();
}
void
ControlProtocol::add_stripable_to_selection (boost::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().add (s, boost::shared_ptr<AutomationControl>());
_session->selection().add (s, boost::shared_ptr<AutomationControl>());
}
void
ControlProtocol::set_stripable_selection (boost::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().select_stripable_and_maybe_group (s, true, true, 0);
_session->selection().select_stripable_and_maybe_group (s, true, true, 0);
}
void
ControlProtocol::toggle_stripable_selection (boost::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().toggle (s, boost::shared_ptr<AutomationControl>());
_session->selection().toggle (s, boost::shared_ptr<AutomationControl>());
}
void
ControlProtocol::remove_stripable_from_selection (boost::shared_ptr<ARDOUR::Stripable> s)
{
session->selection().remove (s, boost::shared_ptr<AutomationControl>());
_session->selection().remove (s, boost::shared_ptr<AutomationControl>());
}
void
ControlProtocol::clear_stripable_selection ()
{
session->selection().clear_stripables ();
_session->selection().clear_stripables ();
}
void

View file

@ -150,7 +150,7 @@ class LIBCONTROLCP_API BasicUI {
bool loop_button_onoff() const;
protected:
ARDOUR::Session* session;
ARDOUR::Session* _session;
};
#endif /* __ardour_basic_ui_h__ */

View file

@ -99,13 +99,13 @@ FaderPort::FaderPort (Session& s)
_input_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (inp->name())
_session->engine().make_port_name_non_relative (inp->name())
);
_output_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (outp->name())
_session->engine().make_port_name_non_relative (outp->name())
);
/* Catch port connections and disconnections */
@ -367,7 +367,7 @@ FaderPort::button_handler (MIDI::Parser &, MIDI::EventTwoBytes* tb)
if (_current_stripable) {
boost::shared_ptr<AutomationControl> gain = _current_stripable->gain_control ();
if (gain) {
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
if (tb->value) {
gain->start_touch (now);
} else {
@ -659,7 +659,7 @@ FaderPort::map_recenable_state ()
bool onoff;
switch (session->record_status()) {
switch (_session->record_status()) {
case Session::Disabled:
onoff = false;
break;
@ -667,7 +667,7 @@ FaderPort::map_recenable_state ()
onoff = blink_state;
break;
case Session::Recording:
if (session->have_rec_enabled_track ()) {
if (_session->have_rec_enabled_track ()) {
onoff = true;
} else {
onoff = blink_state;
@ -684,7 +684,7 @@ FaderPort::map_recenable_state ()
void
FaderPort::map_transport_state ()
{
get_button (Loop).set_led_state (_output_port, session->get_play_loop());
get_button (Loop).set_led_state (_output_port, _session->get_play_loop());
float ts = get_transport_speed();
@ -706,8 +706,8 @@ void
FaderPort::parameter_changed (string what)
{
if (what == "punch-in" || what == "punch-out") {
bool in = session->config.get_punch_in ();
bool out = session->config.get_punch_out ();
bool in = _session->config.get_punch_in ();
bool out = _session->config.get_punch_out ();
if (in && out) {
get_button (Punch).set_led_state (_output_port, true);
blinkers.remove (Punch);
@ -722,10 +722,10 @@ FaderPort::parameter_changed (string what)
void
FaderPort::connect_session_signals()
{
session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_recenable_state, this), this);
session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_transport_state, this), this);
_session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_recenable_state, this), this);
_session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::map_transport_state, this), this);
/* not session, but treat it similarly */
session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::parameter_changed, this, _1), this);
_session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort::parameter_changed, this, _1), this);
}
bool
@ -747,7 +747,7 @@ FaderPort::midi_input_handler (Glib::IOCondition ioc, boost::weak_ptr<ARDOUR::As
port->clear ();
DEBUG_TRACE (DEBUG::FaderPort, string_compose ("data available on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
port->parse (now);
}
@ -1097,8 +1097,8 @@ void
FaderPort::drop_current_stripable ()
{
if (_current_stripable) {
if (_current_stripable == session->monitor_out()) {
set_current_stripable (session->master_out());
if (_current_stripable == _session->monitor_out()) {
set_current_stripable (_session->master_out());
} else {
set_current_stripable (boost::shared_ptr<Stripable>());
}
@ -1300,7 +1300,7 @@ FaderPort::map_stripable_state ()
map_gain ();
map_auto ();
if (_current_stripable == session->monitor_out()) {
if (_current_stripable == _session->monitor_out()) {
map_cut ();
} else {
map_mute ();

View file

@ -124,7 +124,7 @@ FaderPort::mute ()
return;
}
if (_current_stripable == session->monitor_out()) {
if (_current_stripable == _session->monitor_out()) {
boost::shared_ptr<MonitorProcessor> mp = _current_stripable->monitor_control();
mp->set_cut_all (!mp->cut_all());
return;
@ -140,7 +140,7 @@ FaderPort::solo ()
return;
}
session->set_control (_current_stripable->solo_control(), !_current_stripable->solo_control()->self_soloed(), PBD::Controllable::UseGroup);
_session->set_control (_current_stripable->solo_control(), !_current_stripable->solo_control()->self_soloed(), PBD::Controllable::UseGroup);
}
void
@ -162,7 +162,7 @@ FaderPort::rec_enable ()
void
FaderPort::use_master ()
{
boost::shared_ptr<Stripable> r = session->master_out();
boost::shared_ptr<Stripable> r = _session->master_out();
if (r) {
if (_current_stripable == r) {
r = pre_master_stripable.lock();
@ -170,7 +170,7 @@ FaderPort::use_master ()
get_button(Output).set_led_state (_output_port, false);
blinkers.remove (Output);
} else {
if (_current_stripable != session->master_out() && _current_stripable != session->monitor_out()) {
if (_current_stripable != _session->master_out() && _current_stripable != _session->monitor_out()) {
pre_master_stripable = boost::weak_ptr<Stripable> (_current_stripable);
}
set_current_stripable (r);
@ -183,7 +183,7 @@ FaderPort::use_master ()
void
FaderPort::use_monitor ()
{
boost::shared_ptr<Stripable> r = session->monitor_out();
boost::shared_ptr<Stripable> r = _session->monitor_out();
if (r) {
if (_current_stripable == r) {
@ -192,7 +192,7 @@ FaderPort::use_monitor ()
get_button(Output).set_led_state (_output_port, false);
blinkers.remove (Output);
} else {
if (_current_stripable != session->master_out() && _current_stripable != session->monitor_out()) {
if (_current_stripable != _session->master_out() && _current_stripable != _session->monitor_out()) {
pre_monitor_stripable = boost::weak_ptr<Stripable> (_current_stripable);
}
set_current_stripable (r);

View file

@ -137,7 +137,7 @@ FaderPort8::button_play ()
{
if (transport_rolling ()) {
if (get_transport_speed() != 1.0) {
session->request_roll (TRS_UI);
_session->request_roll (TRS_UI);
} else {
transport_stop ();
}
@ -274,7 +274,7 @@ FaderPort8::button_automation (ARDOUR::AutoState as)
// apply to all selected tracks
StripableList all;
session->get_stripables (all);
_session->get_stripables (all);
for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) {
if ((*i)->is_master() || (*i)->is_monitor()) {
continue;
@ -309,7 +309,7 @@ FaderPort8::button_varispeed (bool ffw)
// stop key-repeat
dynamic_cast<FP8RepeatButton*>(&b_ffw)->stop_repeat();
dynamic_cast<FP8RepeatButton*>(&b_rew)->stop_repeat();
session->request_locate (0, MustStop);
_session->request_locate (0, MustStop);
return;
}
@ -320,13 +320,13 @@ FaderPort8::button_varispeed (bool ffw)
void
FaderPort8::button_solo_clear ()
{
bool soloing = session->soloing() || session->listening();
bool soloing = _session->soloing() || _session->listening();
#ifdef MIXBUS
soloing |= session->mixbus_soloed();
soloing |= _session->mixbus_soloed();
#endif
if (soloing) {
StripableList all;
session->get_stripables (all);
_session->get_stripables (all);
for (StripableList::const_iterator i = all.begin(); i != all.end(); ++i) {
if ((*i)->is_master() || (*i)->is_auditioner() || (*i)->is_monitor()) {
continue;
@ -349,7 +349,7 @@ FaderPort8::button_solo_clear ()
cl->push_back (ac);
}
if (!cl->empty()) {
session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
_session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
}
}
}
@ -359,8 +359,8 @@ void
FaderPort8::button_mute_clear ()
{
#ifdef FP8_MUTESOLO_UNDO
if (session->muted ()) {
_mute_state = session->cancel_all_mute ();
if (_session->muted ()) {
_mute_state = _session->cancel_all_mute ();
} else {
/* restore mute */
boost::shared_ptr<ControlList> cl (new ControlList);
@ -373,11 +373,11 @@ FaderPort8::button_mute_clear ()
ac->start_touch (ac->session().transport_sample());
}
if (!cl->empty()) {
session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
_session->set_controls (cl, 1.0, PBD::Controllable::NoGroup);
}
}
#else
session->cancel_all_mute ();
_session->cancel_all_mute ();
#endif
}
@ -548,10 +548,10 @@ FaderPort8::button_encoder ()
{
/* master || monitor level -- reset to 0dB */
boost::shared_ptr<AutomationControl> ac;
if (session->monitor_active() && !_ctrls.button (FP8Controls::BtnMaster).is_pressed ()) {
ac = session->monitor_out()->gain_control ();
} else if (session->master_out()) {
ac = session->master_out()->gain_control ();
if (_session->monitor_active() && !_ctrls.button (FP8Controls::BtnMaster).is_pressed ()) {
ac = _session->monitor_out()->gain_control ();
} else if (_session->master_out()) {
ac = _session->master_out()->gain_control ();
}
if (ac) {
ac->start_touch (ac->session().transport_sample());
@ -570,12 +570,12 @@ FaderPort8::button_encoder ()
/* Don't add another mark if one exists within 1/100th of a second of
* the current position and we're not rolling.
*/
samplepos_t where = session->audible_sample();
if (session->transport_stopped_or_stopping() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) {
samplepos_t where = _session->audible_sample();
if (_session->transport_stopped_or_stopping() && _session->locations()->mark_at (where, _session->sample_rate() / 100.0)) {
return;
}
session->locations()->next_available_name (markername,"mark");
_session->locations()->next_available_name (markername,"mark");
add_marker (markername);
}
break;
@ -628,10 +628,10 @@ FaderPort8::encoder_navigate (bool neg, int steps)
{
/* master || monitor level */
boost::shared_ptr<AutomationControl> ac;
if (session->monitor_active() && !_ctrls.button (FP8Controls::BtnMaster).is_pressed ()) {
ac = session->monitor_out()->gain_control ();
} else if (session->master_out()) {
ac = session->master_out()->gain_control ();
if (_session->monitor_active() && !_ctrls.button (FP8Controls::BtnMaster).is_pressed ()) {
ac = _session->monitor_out()->gain_control ();
} else if (_session->master_out()) {
ac = _session->master_out()->gain_control ();
}
if (ac) {
double v = ac->internal_to_interface (ac->get_value());

View file

@ -38,20 +38,20 @@ using namespace ArdourSurface::FP_NAMESPACE::FP8Types;
void
FaderPort8::connect_session_signals ()
{
session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_stripable_added_or_removed, this), this);
_session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_stripable_added_or_removed, this), this);
PresentationInfo::Change.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_pi_property_changed, this, _1), this);
Config->ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_parameter_changed, this, _1), this);
session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_parameter_changed, this, _1), this);
_session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_parameter_changed, this, _1), this);
session->TransportStateChange.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_transport_state_changed, this), this);
session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_loop_state_changed, this), this);
session->RecordStateChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_record_state_changed, this), this);
_session->TransportStateChange.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_transport_state_changed, this), this);
_session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_loop_state_changed, this), this);
_session->RecordStateChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_record_state_changed, this), this);
session->DirtyChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_session_dirty_changed, this), this);
session->SoloChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_solo_changed, this), this);
session->MuteChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_mute_changed, this), this);
session->history().Changed.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_history_changed, this), this);
_session->DirtyChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_session_dirty_changed, this), this);
_session->SoloChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_solo_changed, this), this);
_session->MuteChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_mute_changed, this), this);
_session->history().Changed.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::notify_history_changed, this), this);
}
void
@ -148,7 +148,7 @@ FaderPort8::notify_transport_state_changed ()
void
FaderPort8::notify_record_state_changed ()
{
switch (session->record_status ()) {
switch (_session->record_status ()) {
case Session::Disabled:
_ctrls.button (FP8Controls::BtnRecord).set_active (0);
_ctrls.button (FP8Controls::BtnRecord).set_blinking (false);
@ -168,8 +168,8 @@ void
FaderPort8::notify_loop_state_changed ()
{
bool looping = false;
Location* looploc = session->locations ()->auto_loop_location ();
if (looploc && session->get_play_loop ()) {
Location* looploc = _session->locations ()->auto_loop_location ();
if (looploc && _session->get_play_loop ()) {
looping = true;
}
_ctrls.button (FP8Controls::BtnLoop).set_active (looping);
@ -178,7 +178,7 @@ FaderPort8::notify_loop_state_changed ()
void
FaderPort8::notify_session_dirty_changed ()
{
const bool is_dirty = session->dirty ();
const bool is_dirty = _session->dirty ();
_ctrls.button (FP8Controls::BtnSave).set_active (is_dirty);
_ctrls.button (FP8Controls::BtnSave).set_color (is_dirty ? 0xff0000ff : 0x00ff00ff);
}
@ -186,16 +186,16 @@ FaderPort8::notify_session_dirty_changed ()
void
FaderPort8::notify_history_changed ()
{
_ctrls.button (FP8Controls::BtnRedo).set_active (session->redo_depth() > 0);
_ctrls.button (FP8Controls::BtnUndo).set_active (session->undo_depth() > 0);
_ctrls.button (FP8Controls::BtnRedo).set_active (_session->redo_depth() > 0);
_ctrls.button (FP8Controls::BtnUndo).set_active (_session->undo_depth() > 0);
}
void
FaderPort8::notify_solo_changed ()
{
bool soloing = session->soloing() || session->listening();
bool soloing = _session->soloing() || _session->listening();
#ifdef MIXBUS
soloing |= session->mixbus_soloed();
soloing |= _session->mixbus_soloed();
#endif
_ctrls.button (FP8Controls::BtnSoloClear).set_active (soloing);
#ifdef FP8_MUTESOLO_UNDO
@ -208,7 +208,7 @@ FaderPort8::notify_solo_changed ()
void
FaderPort8::notify_mute_changed ()
{
bool muted = session->muted ();
bool muted = _session->muted ();
#ifdef FP8_MUTESOLO_UNDO
if (muted) {
_mute_state.clear ();

View file

@ -162,13 +162,13 @@ FaderPort8::FaderPort8 (Session& s)
_input_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (inp->name())
_session->engine().make_port_name_non_relative (inp->name())
);
_output_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (outp->name())
_session->engine().make_port_name_non_relative (outp->name())
);
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connections, MISSING_INVALIDATOR, boost::bind (&FaderPort8::connection_handler, this, _2, _4), this);
@ -264,11 +264,11 @@ FaderPort8::periodic ()
*/
if (_ctrls.display_timecode () && clock_mode ()) {
Timecode::Time TC;
session->timecode_time (TC);
_session->timecode_time (TC);
_timecode = Timecode::timecode_format_time(TC);
char buf[16];
Timecode::BBT_Time BBT = session->tempo_map ().bbt_at_sample (session->transport_sample ());
Timecode::BBT_Time BBT = _session->tempo_map ().bbt_at_sample (_session->transport_sample ());
snprintf (buf, sizeof (buf),
" %02" PRIu32 "|%02" PRIu32 "|%02" PRIu32 "|%02" PRIu32,
BBT.bars % 100, BBT.beats %100,
@ -526,7 +526,7 @@ FaderPort8::midi_input_handler (Glib::IOCondition ioc, boost::weak_ptr<ARDOUR::A
#ifdef VERBOSE_DEBUG
DEBUG_TRACE (DEBUG::FaderPort8, string_compose ("data available on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
#endif
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
port->parse (now);
}
@ -985,7 +985,7 @@ FaderPort8::filter_stripables (StripableList& strips) const
}
StripableList all;
session->get_stripables (all);
_session->get_stripables (all);
for (StripableList::const_iterator s = all.begin(); s != all.end(); ++s) {
if ((*s)->is_auditioner ()) { continue; }
@ -1792,7 +1792,7 @@ FaderPort8::notify_stripable_added_or_removed ()
{
/* called by
* - DropReferences
* - session->RouteAdded
* - _session->RouteAdded
* - PresentationInfo::Change
* - Properties::hidden
* - Properties::order

View file

@ -99,16 +99,16 @@ GenericMidiControlProtocol::GenericMidiControlProtocol (Session& s)
_input_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (inp->name())
_session->engine().make_port_name_non_relative (inp->name())
);
_output_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (outp->name())
_session->engine().make_port_name_non_relative (outp->name())
);
session->BundleAddedOrRemoved ();
_session->BundleAddedOrRemoved ();
do_feedback = false;
_feedback_interval = 10000; // microseconds
@ -1006,7 +1006,7 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("lookup controllable from \"%1\"\n", str));
if (!session) {
if (!_session) {
DEBUG_TRACE (DEBUG::GenericMidi, "no session\n");
return c;
}
@ -1109,50 +1109,50 @@ GenericMidiControlProtocol::lookup_controllable (const string & str) const
switch (type) {
case PresentationOrder:
s = session->get_remote_nth_stripable (id, PresentationInfo::Route);
s = _session->get_remote_nth_stripable (id, PresentationInfo::Route);
break;
case Named:
/* name */
name = rest[0];
if (name == "Master" || name == X_("master")) {
s = session->master_out();
s = _session->master_out();
} else if (name == X_("control") || name == X_("listen") || name == X_("monitor") || name == "Monitor") {
s = session->monitor_out();
s = _session->monitor_out();
} else if (name == X_("auditioner")) {
s = session->the_auditioner();
s = _session->the_auditioner();
} else {
s = session->route_by_name (name);
s = _session->route_by_name (name);
}
break;
case Selection:
s = session->route_by_selected_count (id);
s = _session->route_by_selected_count (id);
break;
}
} else if (path[0] == X_("vca")) {
s = session->get_remote_nth_stripable (id, PresentationInfo::VCA);
s = _session->get_remote_nth_stripable (id, PresentationInfo::VCA);
} else if (path[0] == X_("bus")) {
switch (type) {
case Named:
s = session->route_by_name (name);
s = _session->route_by_name (name);
break;
default:
s = session->get_remote_nth_stripable (id, PresentationInfo::Bus);
s = _session->get_remote_nth_stripable (id, PresentationInfo::Bus);
}
} else if (path[0] == X_("track")) {
switch (type) {
case Named:
s = session->route_by_name (name);
s = _session->route_by_name (name);
break;
default:
s = session->get_remote_nth_stripable (id, PresentationInfo::Track);
s = _session->get_remote_nth_stripable (id, PresentationInfo::Track);
}
}
@ -1611,7 +1611,7 @@ GenericMidiControlProtocol::maybe_start_touch (boost::shared_ptr<Controllable> c
{
boost::shared_ptr<AutomationControl> actl = boost::dynamic_pointer_cast<AutomationControl> (controllable);
if (actl) {
actl->start_touch (session->audible_sample ());
actl->start_touch (_session->audible_sample ());
}
}
@ -1657,7 +1657,7 @@ GenericMidiControlProtocol::midi_input_handler (Glib::IOCondition ioc, boost::we
port->clear ();
DEBUG_TRACE (DEBUG::GenericMidi, string_compose ("data available on %1\n", boost::shared_ptr<MIDI::Port>(port)->name()));
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
port->parse (now);
}

View file

@ -932,7 +932,7 @@ LaunchControlXL::button_press_track_control(uint8_t n) {
boost::shared_ptr<AutomationControl> ac = get_ac_by_state(n);
if (ac) {
session->set_control (ac, !ac->get_value(), PBD::Controllable::UseGroup);
_session->set_control (ac, !ac->get_value(), PBD::Controllable::UseGroup);
}
}
@ -1012,7 +1012,7 @@ LaunchControlXL::button_mute()
void
LaunchControlXL::button_mute_long_press()
{
session->cancel_all_mute();
_session->cancel_all_mute();
}
void

View file

@ -94,7 +94,7 @@ LaunchControlXL::LaunchControlXL (ARDOUR::Session& s)
/* we're going to need this */
/* master cannot be removed, so no need to connect to going-away signal */
master = session->master_out ();
master = _session->master_out ();
run_event_loop ();
@ -105,8 +105,8 @@ LaunchControlXL::LaunchControlXL (ARDOUR::Session& s)
/* Catch port connections and disconnections */
ARDOUR::AudioEngine::instance()->PortConnectedOrDisconnected.connect (port_connection, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::connection_handler, this, _1, _2, _3, _4, _5), this);
session->RouteAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
session->vca_manager().VCAAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
_session->RouteAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
_session->vca_manager().VCAAdded.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::stripables_added, this), lcxl);
}
LaunchControlXL::~LaunchControlXL ()
@ -214,7 +214,7 @@ LaunchControlXL::ports_acquire ()
_input_port = boost::dynamic_pointer_cast<AsyncMIDIPort>(_async_in).get();
_output_port = boost::dynamic_pointer_cast<AsyncMIDIPort>(_async_out).get();
session->BundleAddedOrRemoved ();
_session->BundleAddedOrRemoved ();
connect_to_parser ();
@ -695,16 +695,16 @@ void
LaunchControlXL::connect_session_signals()
{
// receive transport state changed
session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_transport_state_changed, this), this);
session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_loop_state_changed, this), this);
_session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_transport_state_changed, this), this);
_session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_loop_state_changed, this), this);
// receive punch-in and punch-out
Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_parameter_changed, this, _1), this);
session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_parameter_changed, this, _1), this);
_session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_parameter_changed, this, _1), this);
// receive rude solo changed
//session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_solo_active_changed, this, _1), this);
//_session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_solo_active_changed, this, _1), this);
// receive record state toggled
//session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_record_state_changed, this), this);
//_session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&LaunchControlXL::notify_record_state_changed, this), this);
}
@ -714,7 +714,7 @@ LaunchControlXL::notify_transport_state_changed ()
{ /*
Button* b = id_button_map[Play];
if (session->transport_rolling()) {
if (_session->transport_rolling()) {
b->set_state (LED::OneShot24th);
b->set_color (LED::GreenFull);
} else {
@ -1053,7 +1053,7 @@ LaunchControlXL::filter_stripables(StripableList& strips) const
}
StripableList all;
session->get_stripables (all);
_session->get_stripables (all);
for (StripableList::const_iterator s = all.begin(); s != all.end(); ++s) {
if ((*s)->is_auditioner ()) { continue; }

View file

@ -272,7 +272,7 @@ MackieControlProtocol::get_sorted_stripables()
// fetch all stripables
StripableList stripables;
session->get_stripables (stripables);
_session->get_stripables (stripables);
// sort in presentation order, and exclude master, control and hidden stripables
// and any stripables that are already set.
@ -441,7 +441,7 @@ MackieControlProtocol::switch_banks (uint32_t initial, bool force)
}
/* current bank has not been saved */
session->set_dirty();
_session->set_dirty();
return 0;
}
@ -713,20 +713,20 @@ void
MackieControlProtocol::connect_session_signals()
{
// receive routes added
session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_routes_added, this, _1), this);
_session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_routes_added, this, _1), this);
// receive VCAs added
session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_vca_added, this, _1), this);
_session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_vca_added, this, _1), this);
// receive record state toggled
session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_record_state_changed, this), this);
_session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_record_state_changed, this), this);
// receive transport state changed
session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_transport_state_changed, this), this);
session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_loop_state_changed, this), this);
_session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_transport_state_changed, this), this);
_session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_loop_state_changed, this), this);
// receive punch-in and punch-out
Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1), this);
session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1), this);
_session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_parameter_changed, this, _1), this);
// receive rude solo changed
session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_solo_active_changed, this, _1), this);
_session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_solo_active_changed, this, _1), this);
// make sure remote id changed signals reach here
// see also notify_stripable_added
@ -899,13 +899,13 @@ MackieControlProtocol::create_surfaces ()
_input_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (surface->port().input_port().name())
_session->engine().make_port_name_non_relative (surface->port().input_port().name())
);
_output_bundle->add_channel (
"",
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (surface->port().output_port().name())
_session->engine().make_port_name_non_relative (surface->port().output_port().name())
);
}
@ -961,7 +961,7 @@ MackieControlProtocol::create_surfaces ()
}
}
session->BundleAddedOrRemoved ();
_session->BundleAddedOrRemoved ();
assert (_master_surface);
@ -1127,7 +1127,7 @@ MackieControlProtocol::format_bbt_timecode (samplepos_t now_sample)
{
Timecode::BBT_Time bbt_time;
session->bbt_time (now_sample, bbt_time);
_session->bbt_time (now_sample, bbt_time);
// The Mackie protocol spec is built around a BBT time display of
//
@ -1153,7 +1153,7 @@ string
MackieControlProtocol::format_timecode_timecode (samplepos_t now_sample)
{
Timecode::Time timecode;
session->timecode_time (now_sample, timecode);
_session->timecode_time (now_sample, timecode);
// According to the Logic docs
// digits: 888/88/88/888
@ -1185,10 +1185,10 @@ MackieControlProtocol::update_timecode_display()
}
// do assignment here so current_sample is fixed
samplepos_t current_sample = session->transport_sample();
samplepos_t current_sample = _session->transport_sample();
string timecode;
// For large jumps in play head possition do full reset
int moved = (current_sample - _sample_last) / session->sample_rate ();
int moved = (current_sample - _sample_last) / _session->sample_rate ();
if (moved) {
DEBUG_TRACE (DEBUG::MackieControl, "Timecode reset\n");
_timecode_last = string (10, ' ');
@ -1221,9 +1221,9 @@ MackieControlProtocol::update_timecode_display()
void MackieControlProtocol::notify_parameter_changed (std::string const & p)
{
if (p == "punch-in") {
update_global_button (Button::Drop, session->config.get_punch_in() ? flashing : off);
update_global_button (Button::Drop, _session->config.get_punch_in() ? flashing : off);
} else if (p == "punch-out") {
update_global_button (Button::Replace, session->config.get_punch_out() ? flashing : off);
update_global_button (Button::Replace, _session->config.get_punch_out() ? flashing : off);
} else if (p == "clicking") {
update_global_button (Button::Click, Config->get_clicking());
} else if (p == "follow-edits") {
@ -1233,9 +1233,9 @@ void MackieControlProtocol::notify_parameter_changed (std::string const & p)
* this button (if there is one) won't reflect the setting.
*/
//update_global_button (Button::Enter, session->config.get_follow_edits() ? on : off);
//update_global_button (Button::Enter, _session->config.get_follow_edits() ? on : off);
} else if (p == "external-sync") {
update_global_button (Button::Cancel, session->config.get_external_sync() ? on : off);
update_global_button (Button::Cancel, _session->config.get_external_sync() ? on : off);
} else {
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("parameter changed: %1\n", p));
}
@ -1339,7 +1339,7 @@ MackieControlProtocol::notify_presentation_info_changed (PBD::PropertyChange con
void
MackieControlProtocol::notify_loop_state_changed()
{
update_global_button (Button::Loop, session->get_play_loop());
update_global_button (Button::Loop, _session->get_play_loop());
}
void
@ -1397,7 +1397,7 @@ MackieControlProtocol::notify_record_state_changed ()
if (rec) {
LedState ls;
switch (session->record_status()) {
switch (_session->record_status()) {
case Session::Disabled:
DEBUG_TRACE (DEBUG::MackieControl, "record state changed to disabled, LED off\n");
ls = off;
@ -1679,7 +1679,7 @@ MackieControlProtocol::midi_input_handler (IOCondition ioc, MIDI::Port* port)
}
// DEBUG_TRACE (DEBUG::MackieControl, string_compose ("data available on %1\n", port->name()));
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
port->parse (now);
}
@ -1824,13 +1824,13 @@ MackieControlProtocol::set_flip_mode (FlipMode fm)
void
MackieControlProtocol::set_master_on_surface_strip (uint32_t surface, uint32_t strip_number)
{
force_special_stripable_to_strip (session->master_out(), surface, strip_number);
force_special_stripable_to_strip (_session->master_out(), surface, strip_number);
}
void
MackieControlProtocol::set_monitor_on_surface_strip (uint32_t surface, uint32_t strip_number)
{
force_special_stripable_to_strip (session->monitor_out(), surface, strip_number);
force_special_stripable_to_strip (_session->monitor_out(), surface, strip_number);
}
void
@ -1846,7 +1846,7 @@ MackieControlProtocol::force_special_stripable_to_strip (boost::shared_ptr<Strip
if ((*s)->number() == surface) {
Strip* strip = (*s)->nth_strip (strip_number);
if (strip) {
strip->set_stripable (session->master_out());
strip->set_stripable (_session->master_out());
strip->lock_controls ();
}
}
@ -1940,7 +1940,7 @@ MackieControlProtocol::update_fader_automation_state ()
samplepos_t
MackieControlProtocol::transport_sample() const
{
return session->transport_sample();
return _session->transport_sample();
}
void
@ -2157,7 +2157,7 @@ MackieControlProtocol::set_ipmidi_base (int16_t portnum)
{
/* this will not be saved without a session save, so .. */
session->set_dirty ();
_session->set_dirty ();
_ipmidi_base = portnum;

View file

@ -215,7 +215,7 @@ class MackieControlProtocol
void update_global_button (int id, Mackie::LedState);
void update_global_led (int id, Mackie::LedState);
ARDOUR::Session & get_session() { return *session; }
ARDOUR::Session & get_session() { return *_session; }
samplepos_t transport_sample() const;
int modifier_state() const { return _modifier_state; }

View file

@ -483,13 +483,13 @@ MackieControlProtocol::marker_release (Button &)
* the current position and we're not rolling.
*/
samplepos_t where = session->audible_sample();
samplepos_t where = _session->audible_sample();
if (session->transport_stopped_or_stopping() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) {
if (_session->transport_stopped_or_stopping() && _session->locations()->mark_at (where, _session->sample_rate() / 100.0)) {
return off;
}
session->locations()->next_available_name (markername,"mark");
_session->locations()->next_available_name (markername,"mark");
add_marker (markername);
return off;
@ -505,7 +505,7 @@ MackieControlProtocol::stop_press (Button &)
transport_stop ();
if (main_modifier_state() == MODIFIER_SHIFT) {
session->midi_panic();
_session->midi_panic();
}
return on;
@ -514,7 +514,7 @@ MackieControlProtocol::stop_press (Button &)
LedState
MackieControlProtocol::stop_release (Button &)
{
return session->transport_stopped_or_stopping();
return _session->transport_stopped_or_stopping();
}
LedState
@ -596,7 +596,7 @@ MackieControlProtocol::loop_press (Button &)
access_action ("Editor/set-loop-from-edit-range");
return off;
} else {
bool was_on = session->get_play_loop();
bool was_on = _session->get_play_loop();
loop_toggle ();
return was_on ? off : on;
}
@ -927,7 +927,7 @@ MackieControlProtocol::clearsolo_press (Mackie::Button&)
Mackie::LedState
MackieControlProtocol::clearsolo_release (Mackie::Button&)
{
//return session->soloing();
//return _session->soloing();
return none;
}

View file

@ -40,13 +40,13 @@ Maschine2::connect_signals ()
// TODO: use some convenience macros here
/* Signals */
session->TransportStateChange.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_transport_state_changed, this), this);
session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_loop_state_changed, this), this);
session->RecordStateChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_record_state_changed, this), this);
_session->TransportStateChange.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_transport_state_changed, this), this);
_session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_loop_state_changed, this), this);
_session->RecordStateChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_record_state_changed, this), this);
Config->ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_parameter_changed, this, _1), this);
session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_parameter_changed, this, _1), this);
session->DirtyChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_session_dirty_changed, this), this);
session->history().Changed.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_history_changed, this), this);
_session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_parameter_changed, this, _1), this);
_session->DirtyChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_session_dirty_changed, this), this);
_session->history().Changed.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Maschine2::notify_history_changed, this), this);
/* Actions */
Glib::RefPtr<Gtk::ToggleAction> tact;
@ -108,7 +108,7 @@ Maschine2::connect_signals ()
void
Maschine2::notify_record_state_changed ()
{
switch (session->record_status ()) {
switch (_session->record_status ()) {
case Session::Disabled:
_ctrl->button (M2Contols::Rec)->set_color (0);
_ctrl->button (M2Contols::Rec)->set_blinking (false);
@ -139,8 +139,8 @@ void
Maschine2::notify_loop_state_changed ()
{
bool looping = false;
Location* looploc = session->locations ()->auto_loop_location ();
if (looploc && session->get_play_loop ()) {
Location* looploc = _session->locations ()->auto_loop_location ();
if (looploc && _session->get_play_loop ()) {
looping = true;
}
_ctrl->button (M2Contols::Loop)->set_color (looping ? COLOR_GRAY : 0);
@ -182,7 +182,7 @@ Maschine2::notify_snap_change ()
void
Maschine2::notify_session_dirty_changed ()
{
bool is_dirty = session->dirty ();
bool is_dirty = _session->dirty ();
_ctrl->button (M2Contols::Save)->set_color (is_dirty ? COLOR_WHITE : COLOR_BLACK);
_ctrl->button (M2Contols::Save)->set_blinking (is_dirty);
}
@ -190,8 +190,8 @@ Maschine2::notify_session_dirty_changed ()
void
Maschine2::notify_history_changed ()
{
_ctrl->button (M2Contols::Redo)->set_color (session->redo_depth() > 0 ? COLOR_WHITE : COLOR_BLACK);
_ctrl->button (M2Contols::Undo)->set_color (session->undo_depth() > 0 ? COLOR_WHITE : COLOR_BLACK);
_ctrl->button (M2Contols::Redo)->set_color (_session->redo_depth() > 0 ? COLOR_WHITE : COLOR_BLACK);
_ctrl->button (M2Contols::Undo)->set_color (_session->undo_depth() > 0 ? COLOR_WHITE : COLOR_BLACK);
}
@ -362,7 +362,7 @@ Maschine2::encoder_master (int delta)
break;
case MST_VOLUME:
{
boost::shared_ptr<Route> master = session->master_out ();
boost::shared_ptr<Route> master = _session->master_out ();
if (master) {
// TODO consider _ctrl->button (M2Contols::EncoderWheel)->is_pressed() for fine grained
const double factor = _ctrl->button (M2Contols::BtnShift, M2Contols::ModNone)->active () ? 256. : 32.;

View file

@ -254,7 +254,7 @@ Maschine2::start ()
read_timeout->attach (main_loop ()->get_context());
#if 1 // TEST
tl = new TestLayout (*this, *session, "test");
tl = new TestLayout (*this, *_session, "test");
tl->get_menu ()->set_control (_ctrl->encoder (1));
tl->get_knob ()->set_control (_ctrl->encoder (2));
#endif

View file

@ -122,7 +122,7 @@ OSC::OSC (Session& s, uint32_t port)
{
_instance = this;
session->Exported.connect (*this, MISSING_INVALIDATOR, boost::bind (&OSC::session_exported, this, _1, _2), this);
_session->Exported.connect (*this, MISSING_INVALIDATOR, boost::bind (&OSC::session_exported, this, _1, _2), this);
}
OSC::~OSC()
@ -250,7 +250,7 @@ OSC::start ()
observer_busy = false;
register_callbacks();
session_loaded (*session);
session_loaded (*_session);
// lo_server_thread_add_method(_sthread, NULL, NULL, OSC::_dummy_handler, this);
@ -266,15 +266,15 @@ OSC::start ()
// catch track reordering
// receive routes added
session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::notify_routes_added, this, _1), this);
_session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::notify_routes_added, this, _1), this);
// receive VCAs added
session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::notify_vca_added, this, _1), this);
_session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::notify_vca_added, this, _1), this);
// order changed
PresentationInfo::Change.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&OSC::recalcbanks, this), this);
_select = ControlProtocol::first_selected_stripable();
if(!_select) {
_select = session->master_out ();
_select = _session->master_out ();
}
return 0;
@ -664,7 +664,7 @@ OSC::get_unix_server_url()
void
OSC::gui_changed ()
{
session->set_dirty();
_session->set_dirty();
}
void
@ -694,7 +694,7 @@ OSC::send_current_value (const char* path, lo_arg** argv, int argc, lo_message m
lo_message_add_string (reply, "bad syntax");
} else {
id = argv[0]->i;
r = session->get_remote_nth_route (id);
r = _session->get_remote_nth_route (id);
if (!r) {
lo_message_add_string (reply, "not found");
@ -990,37 +990,37 @@ OSC::current_value (const char */*path*/, const char */*types*/, lo_arg **/*argv
if (strcmp (argv[0]->s, X_("transport_frame")) == 0) {
if (session) {
lo_send (addr, retpath, "i", session->transport_sample());
lo_send (addr, retpath, "i", _session->transport_sample());
}
} else if (strcmp (argv[0]->s, X_("transport_speed")) == 0) {
if (session) {
lo_send (addr, retpath, "i", session->transport_sample());
lo_send (addr, retpath, "i", _session->transport_sample());
}
} else if (strcmp (argv[0]->s, X_("transport_locked")) == 0) {
if (session) {
lo_send (addr, retpath, "i", session->transport_sample());
lo_send (addr, retpath, "i", _session->transport_sample());
}
} else if (strcmp (argv[0]->s, X_("punch_in")) == 0) {
if (session) {
lo_send (addr, retpath, "i", session->transport_sample());
lo_send (addr, retpath, "i", _session->transport_sample());
}
} else if (strcmp (argv[0]->s, X_("punch_out")) == 0) {
if (session) {
lo_send (addr, retpath, "i", session->transport_sample());
lo_send (addr, retpath, "i", _session->transport_sample());
}
} else if (strcmp (argv[0]->s, X_("rec_enable")) == 0) {
if (session) {
lo_send (addr, retpath, "i", session->transport_sample());
lo_send (addr, retpath, "i", _session->transport_sample());
}
} else {
@ -1105,9 +1105,9 @@ OSC::routes_list (lo_message msg)
lo_message reply = lo_message_new ();
lo_message_add_string (reply, X_("end_route_list"));
lo_message_add_int64 (reply, session->sample_rate());
lo_message_add_int64 (reply, session->current_end_sample());
if (session->monitor_out()) {
lo_message_add_int64 (reply, _session->sample_rate());
lo_message_add_int64 (reply, _session->current_end_sample());
if (_session->monitor_out()) {
// this session has a monitor section
lo_message_add_int32 (reply, 1);
} else {
@ -1267,27 +1267,27 @@ OSC::_custom_mode (uint32_t state, lo_address addr)
int
OSC::cancel_all_solos ()
{
session->cancel_all_solo ();
_session->cancel_all_solo ();
return 0;
}
int
OSC::osc_toggle_roll (bool ret2strt)
{
if (session->is_auditioning()) {
session->cancel_audition ();
if (_session->is_auditioning()) {
_session->cancel_audition ();
return 0;
}
bool rolling = transport_rolling();
if (rolling) {
session->request_stop (ret2strt, true);
_session->request_stop (ret2strt, true);
} else {
if (session->get_play_loop() && Config->get_loop_is_mode()) {
session->request_locate (session->locations()->auto_loop_location()->start(), MustRoll);
if (_session->get_play_loop() && Config->get_loop_is_mode()) {
_session->request_locate (_session->locations()->auto_loop_location()->start(), MustRoll);
} else {
session->request_roll (TRS_UI);
_session->request_roll (TRS_UI);
}
}
return 0;
@ -2073,7 +2073,7 @@ OSC::global_feedback (OSCSurface* sur)
if (sur->feedback[4] || sur->feedback[3] || sur->feedback[5] || sur->feedback[6]) {
// create a new Global Observer for this surface
OSCGlobalObserver* o = new OSCGlobalObserver (*this, *session, sur);
OSCGlobalObserver* o = new OSCGlobalObserver (*this, *_session, sur);
sur->global_obs = o;
o->jog_mode (sur->jogmode);
}
@ -2222,7 +2222,7 @@ OSC::set_bank (uint32_t bank_start, lo_message msg)
int
OSC::_set_bank (uint32_t bank_start, lo_address addr)
{
if (!session->nroutes()) {
if (!_session->nroutes()) {
return -1;
}
@ -2549,7 +2549,7 @@ boost::shared_ptr<VCA>
OSC::get_vca_by_name (std::string vname)
{
StripableList stripables;
session->get_stripables (stripables);
_session->get_stripables (stripables);
for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
boost::shared_ptr<Stripable> s = *it;
boost::shared_ptr<VCA> v = boost::dynamic_pointer_cast<VCA> (s);
@ -2584,7 +2584,7 @@ OSC::set_temp_mode (lo_address addr)
// check if this group feeds a bus or is slaved
boost::shared_ptr<Stripable> mstr = boost::shared_ptr<Stripable> ();
if (rg->has_control_master()) {
boost::shared_ptr<VCA> vca = session->vca_manager().vca_by_number (rg->group_master_number());
boost::shared_ptr<VCA> vca = _session->vca_manager().vca_by_number (rg->group_master_number());
if (vca) {
mstr = boost::dynamic_pointer_cast<Stripable> (vca);
}
@ -2607,7 +2607,7 @@ OSC::set_temp_mode (lo_address addr)
if (vca) {
sur->temp_strips.clear();
StripableList stripables;
session->get_stripables (stripables);
_session->get_stripables (stripables);
for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
boost::shared_ptr<Stripable> st = *it;
if (st->slaved_to (vca)) {
@ -2626,7 +2626,7 @@ OSC::set_temp_mode (lo_address addr)
// this is a bus, but not master, monitor or audition
sur->temp_strips.clear();
StripableList stripables;
session->get_stripables (stripables, PresentationInfo::AllStripables);
_session->get_stripables (stripables, PresentationInfo::AllStripables);
for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
boost::shared_ptr<Stripable> st = *it;
boost::shared_ptr<Route> ri = boost::dynamic_pointer_cast<Route> (st);
@ -2687,7 +2687,7 @@ OSC::name_session (char *n, lo_message msg)
"session names may not contain a '%1' character"), illegal)) << endmsg;
return -1;
}
switch (session->rename (new_name)) {
switch (_session->rename (new_name)) {
case -1:
PBD::warning << (_("That name is already in use by another directory/folder. Please try again.")) << endmsg;
break;
@ -2901,7 +2901,7 @@ void
OSC::transport_sample (lo_message msg)
{
check_surface (msg);
samplepos_t pos = session->transport_sample ();
samplepos_t pos = _session->transport_sample ();
lo_message reply = lo_message_new ();
lo_message_add_int64 (reply, pos);
@ -2929,7 +2929,7 @@ void
OSC::record_enabled (lo_message msg)
{
check_surface (msg);
int re = (int)session->get_record_enabled ();
int re = (int)_session->get_record_enabled ();
lo_message reply = lo_message_new ();
lo_message_add_int32 (reply, re);
@ -2944,7 +2944,7 @@ OSC::scrub (float delta, lo_message msg)
{
check_surface (msg);
scrub_place = session->transport_sample ();
scrub_place = _session->transport_sample ();
float speed;
@ -2968,18 +2968,18 @@ OSC::scrub (float delta, lo_message msg)
if (speed > 0) {
if (speed == 1) {
session->request_transport_speed (.5);
_session->request_transport_speed (.5);
} else {
session->request_transport_speed (9.9);
_session->request_transport_speed (9.9);
}
} else if (speed < 0) {
if (speed == -1) {
session->request_transport_speed (-.5);
_session->request_transport_speed (-.5);
} else {
session->request_transport_speed (-1);
_session->request_transport_speed (-1);
}
} else {
session->request_stop ();
_session->request_stop ();
}
return 0;
@ -3084,7 +3084,7 @@ OSC::set_marker (const char* types, lo_arg **argv, int argc, lo_message msg)
PBD::warning << "Wrong number of parameters, one only." << endmsg;
return -1;
}
const Locations::LocationList& ll (session->locations ()->list ());
const Locations::LocationList& ll (_session->locations ()->list ());
uint32_t marker = 0;
switch (types[0]) {
@ -3094,9 +3094,9 @@ OSC::set_marker (const char* types, lo_arg **argv, int argc, lo_message msg)
for (Locations::LocationList::const_iterator l = ll.begin(); l != ll.end(); ++l) {
if ((*l)->is_mark ()) {
if (strcmp (&argv[0]->s, (*l)->name().c_str()) == 0) {
session->request_locate ((*l)->start (), MustStop);
_session->request_locate ((*l)->start (), MustStop);
return 0;
} else if ((*l)->start () == session->transport_sample()) {
} else if ((*l)->start () == _session->transport_sample()) {
cur_mark = (*l);
}
}
@ -3131,7 +3131,7 @@ OSC::set_marker (const char* types, lo_arg **argv, int argc, lo_message msg)
std::sort (lm.begin(), lm.end(), location_marker_sort);
// go there
if (marker < lm.size()) {
session->request_locate (lm[marker].when, MustStop);
_session->request_locate (lm[marker].when, MustStop);
return 0;
}
// we were unable to deal with things
@ -3152,7 +3152,7 @@ OSC::send_group_list (lo_address addr)
lo_message_add_string (reply, X_("none"));
std::list<RouteGroup*> groups = session->route_groups ();
std::list<RouteGroup*> groups = _session->route_groups ();
for (std::list<RouteGroup *>::iterator i = groups.begin(); i != groups.end(); ++i) {
RouteGroup *rg = *i;
lo_message_add_string (reply, rg->name().c_str());
@ -3165,8 +3165,8 @@ OSC::send_group_list (lo_address addr)
int
OSC::click_level (float position)
{
if (session->click_gain()->gain_control()) {
session->click_gain()->gain_control()->set_value (session->click_gain()->gain_control()->interface_to_internal (position), PBD::Controllable::NoGroup);
if (_session->click_gain()->gain_control()) {
_session->click_gain()->gain_control()->set_value (_session->click_gain()->gain_control()->interface_to_internal (position), PBD::Controllable::NoGroup);
}
return 0;
}
@ -3236,7 +3236,7 @@ OSC::route_get_receives(lo_message msg)
return -1;
}
boost::shared_ptr<RouteList> route_list = session->get_routes();
boost::shared_ptr<RouteList> route_list = _session->get_routes();
lo_message reply = lo_message_new();
lo_message_add_int32(reply, rid);
@ -3293,7 +3293,7 @@ OSC::master_parse (const char *path, const char* types, lo_arg **argv, int argc,
}
//OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s = session->master_out();
boost::shared_ptr<Stripable> s = _session->master_out();
if (s) {
ret = _strip_parse (path, sub_path, types, argv, argc, s, 0, false, msg);
} else {
@ -3316,9 +3316,9 @@ OSC::monitor_parse (const char *path, const char* types, lo_arg **argv, int argc
}
//OSCSurface *sur = get_surface(get_address (msg));
boost::shared_ptr<Stripable> s = session->monitor_out();
boost::shared_ptr<Stripable> s = _session->monitor_out();
if (s) {
boost::shared_ptr<MonitorProcessor> mon = session->monitor_out()->monitor_control();
boost::shared_ptr<MonitorProcessor> mon = _session->monitor_out()->monitor_control();
int state = 0;
if (types[0] == 'f') {
state = (uint32_t) argv[0]->f;
@ -3886,12 +3886,12 @@ OSC::_strip_parse (const char *path, const char *sub_path, const char* types, lo
strng = "none";
}
RouteGroup* new_rg = session->route_group_by_name (strng);
RouteGroup* new_rg = _session->route_group_by_name (strng);
if (rg) {
string old_group = rg->name();
if (strng == "none") {
if (rg->size () == 1) {
session->remove_route_group (*rg);
_session->remove_route_group (*rg);
} else {
rg->remove (rt);
}
@ -3900,7 +3900,7 @@ OSC::_strip_parse (const char *path, const char *sub_path, const char* types, lo
if (new_rg) {
// group exists switch to it
if (rg->size () == 1) {
session->remove_route_group (rg);
_session->remove_route_group (rg);
} else {
rg->remove (rt);
}
@ -3921,8 +3921,8 @@ OSC::_strip_parse (const char *path, const char *sub_path, const char* types, lo
ret = 0;
} else {
// create new group with this strip in it
RouteGroup* new_rg = new RouteGroup (*session, strng);
session->add_route_group (new_rg);
RouteGroup* new_rg = new RouteGroup (*_session, strng);
_session->add_route_group (new_rg);
new_rg->add (rt);
ret = 0;
}
@ -4011,7 +4011,7 @@ OSC::_strip_parse (const char *path, const char *sub_path, const char* types, lo
lo_message_add_int32 (rmsg, sid);
}
StripableList stripables;
session->get_stripables (stripables);
_session->get_stripables (stripables);
for (StripableList::iterator it = stripables.begin(); it != stripables.end(); ++it) {
boost::shared_ptr<Stripable> st = *it;
boost::shared_ptr<VCA> v = boost::dynamic_pointer_cast<VCA> (st);
@ -4546,18 +4546,18 @@ OSC::sel_new_personal_send (char *foldback, lo_message msg)
if (foldbackbus.find ("- FB") == string::npos) {
foldback_name = string_compose ("%1 - FB", foldbackbus);
}
boost::shared_ptr<Route> lsn_rt = session->route_by_name (foldback_name);
boost::shared_ptr<Route> lsn_rt = _session->route_by_name (foldback_name);
if (!lsn_rt) {
// doesn't exist but check if raw name does and is foldbackbus
boost::shared_ptr<Route> raw_rt = session->route_by_name (foldbackbus);
boost::shared_ptr<Route> raw_rt = _session->route_by_name (foldbackbus);
if (raw_rt && raw_rt->is_foldbackbus()) {
lsn_rt = raw_rt;
} else {
// create the foldbackbus
RouteList list = session->new_audio_route (1, 1, 0, 1, foldback_name, PresentationInfo::FoldbackBus, (uint32_t) -1);
RouteList list = _session->new_audio_route (1, 1, 0, 1, foldback_name, PresentationInfo::FoldbackBus, (uint32_t) -1);
lsn_rt = *(list.begin());
lsn_rt->presentation_info().set_hidden (true);
session->set_dirty();
_session->set_dirty();
}
}
if (lsn_rt) {
@ -4569,7 +4569,7 @@ OSC::sel_new_personal_send (char *foldback, lo_message msg)
// create send
rt->add_foldback_send (lsn_rt, false);
//boost::shared_ptr<Send> snd = rt->internal_send_for (aux);
session->dirty ();
_session->dirty ();
return 0;
} else {
PBD::warning << "OSC: new_send - duplicate send, ignored." << endmsg;
@ -4617,7 +4617,7 @@ OSC::_strip_select2 (boost::shared_ptr<Stripable> s, OSCSurface *sur, lo_address
if (ControlProtocol::first_selected_stripable()) {
s = ControlProtocol::first_selected_stripable();
} else {
s = session->master_out ();
s = _session->master_out ();
}
_select = s;
}
@ -4642,7 +4642,7 @@ OSC::_strip_select2 (boost::shared_ptr<Stripable> s, OSCSurface *sur, lo_address
if (so != 0) {
so->refresh_strip (s, nsends, sur->gainmode, true);
} else {
OSCSelectObserver* sel_fb = new OSCSelectObserver (*this, *session, sur);
OSCSelectObserver* sel_fb = new OSCSelectObserver (*this, *_session, sur);
sur->sel_obs = sel_fb;
}
sur->sel_obs->set_expand (sur->expand_enable);
@ -5804,7 +5804,7 @@ OSC::periodic (void)
if (diff > 120000) {
scrub_speed = 0;
// locate to the place PH was at last tick
session->request_locate (scrub_place, MustStop);
_session->request_locate (scrub_place, MustStop);
}
}
for (uint32_t it = 0; it < _surface.size(); it++) {
@ -5912,7 +5912,7 @@ OSC::get_sorted_stripables(std::bitset<32> types, bool cue, uint32_t custom, Sor
StripableList custom_list;
// fetch all stripables
session->get_stripables (stripables, PresentationInfo::AllStripables);
_session->get_stripables (stripables, PresentationInfo::AllStripables);
if (custom) {
uint32_t nstps = my_list.size ();
// check each custom strip to see if it still exists
@ -5995,13 +5995,13 @@ OSC::get_sorted_stripables(std::bitset<32> types, bool cue, uint32_t custom, Sor
if (!custom) {
// Master/Monitor might be anywhere... we put them at the end - Sorry ;)
if (types[5]) {
if (session->master_out()) {
sorted.push_back (session->master_out());
if (_session->master_out()) {
sorted.push_back (_session->master_out());
}
}
if (types[6]) {
if (session->monitor_out()) {
sorted.push_back (session->monitor_out());
if (_session->monitor_out()) {
sorted.push_back (_session->monitor_out());
}
}
}
@ -6187,7 +6187,7 @@ OSC::cue_new_aux (string name, string dest_1, string dest_2, uint32_t count, lo_
RouteList list;
boost::shared_ptr<Stripable> aux;
name = string_compose ("%1 - FB", name);
list = session->new_audio_route (count, count, 0, 1, name, PresentationInfo::FoldbackBus, (uint32_t) -1);
list = _session->new_audio_route (count, count, 0, 1, name, PresentationInfo::FoldbackBus, (uint32_t) -1);
aux = *(list.begin());
if (aux) {
boost::shared_ptr<Route> r = boost::dynamic_pointer_cast<Route>(aux);
@ -6207,7 +6207,7 @@ OSC::cue_new_aux (string name, string dest_1, string dest_2, uint32_t count, lo_
}
}
cue_set ((uint32_t) -1, msg);
session->set_dirty();
_session->set_dirty();
return 0;
}
return -1;
@ -6220,7 +6220,7 @@ OSC::cue_new_send (string rt_name, lo_message msg)
if (sur->cue) {
boost::shared_ptr<Route> aux = boost::dynamic_pointer_cast<Route> (get_strip (sur->aux, get_address(msg)));
if (aux) {
boost::shared_ptr<Route> rt_send = session->route_by_name (rt_name);
boost::shared_ptr<Route> rt_send = _session->route_by_name (rt_name);
if (rt_send && (aux != rt_send)) {
// make sure there isn't one already
bool s_only = true;
@ -6228,7 +6228,7 @@ OSC::cue_new_send (string rt_name, lo_message msg)
// create send
rt_send->add_foldback_send (aux, false);
boost::shared_ptr<Send> snd = rt_send->internal_send_for (aux);
session->dirty ();
_session->dirty ();
return 0;
} else {
PBD::warning << "OSC: new_send - duplicate send, ignored." << endmsg;
@ -6260,7 +6260,7 @@ OSC::cue_connect_aux (std::string dest, lo_message msg)
}
PortSet& ports = rt->output()->ports ();
rt->output ()->connect (*(ports.begin()), dest, this);
session->set_dirty();
_session->set_dirty();
ret = 0;
}
}

View file

@ -355,12 +355,12 @@ Push2::button_name_by_id (ButtonID id)
void
Push2::button_play ()
{
if (!session) {
if (!_session) {
return;
}
if (_modifier_state & ModShift) {
goto_start (session->transport_rolling());
goto_start (_session->transport_rolling());
return;
}
@ -375,7 +375,7 @@ Push2::button_play ()
return;
}
if (session->transport_rolling ()) {
if (_session->transport_rolling ()) {
transport_stop ();
} else {
transport_play ();
@ -739,7 +739,7 @@ Push2::button_mix_press ()
void
Push2::button_master ()
{
boost::shared_ptr<Stripable> main_out = session->master_out ();
boost::shared_ptr<Stripable> main_out = _session->master_out ();
if (!main_out) {
return;

View file

@ -108,15 +108,15 @@ Push2::Push2 (ARDOUR::Session& s)
fill_color_table ();
/* master cannot be removed, so no need to connect to going-away signal */
master = session->master_out ();
master = _session->master_out ();
/* allocate graphics layouts, even though we're not using them yet */
_canvas = new Push2Canvas (*this, 960, 160);
mix_layout = new MixLayout (*this, *session, "globalmix");
scale_layout = new ScaleLayout (*this, *session, "scale");
track_mix_layout = new TrackMixLayout (*this, *session, "trackmix");
splash_layout = new SplashLayout (*this, *session, "splash");
mix_layout = new MixLayout (*this, *_session, "globalmix");
scale_layout = new ScaleLayout (*this, *_session, "scale");
track_mix_layout = new TrackMixLayout (*this, *_session, "trackmix");
splash_layout = new SplashLayout (*this, *_session, "splash");
run_event_loop ();
@ -266,11 +266,11 @@ Push2::ports_acquire ()
_output_bundle->add_channel (
shadow_port->name(),
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (shadow_port->name())
_session->engine().make_port_name_non_relative (shadow_port->name())
);
}
session->BundleAddedOrRemoved ();
_session->BundleAddedOrRemoved ();
connect_to_parser ();
@ -862,20 +862,20 @@ void
Push2::connect_session_signals()
{
// receive routes added
//session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_routes_added, this, _1), this);
//_session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_routes_added, this, _1), this);
// receive VCAs added
//session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_vca_added, this, _1), this);
//_session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_vca_added, this, _1), this);
// receive record state toggled
session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_record_state_changed, this), this);
_session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_record_state_changed, this), this);
// receive transport state changed
session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_transport_state_changed, this), this);
session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_loop_state_changed, this), this);
_session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_transport_state_changed, this), this);
_session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_loop_state_changed, this), this);
// receive punch-in and punch-out
Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_parameter_changed, this, _1), this);
session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_parameter_changed, this, _1), this);
_session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_parameter_changed, this, _1), this);
// receive rude solo changed
session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_solo_active_changed, this, _1), this);
_session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&Push2::notify_solo_active_changed, this, _1), this);
}
void
@ -887,7 +887,7 @@ Push2::notify_record_state_changed ()
return;
}
switch (session->record_status ()) {
switch (_session->record_status ()) {
case Session::Disabled:
b->second->set_color (LED::White);
b->second->set_state (LED::NoTransition);
@ -910,7 +910,7 @@ Push2::notify_transport_state_changed ()
{
boost::shared_ptr<Button> b = id_button_map[Play];
if (session->transport_rolling()) {
if (_session->transport_rolling()) {
b->set_state (LED::OneShot24th);
b->set_color (LED::Green);
} else {
@ -1042,7 +1042,7 @@ Push2::other_vpot (int n, int delta)
break;
case 1:
/* metronome gain control */
click_gain = session->click_gain();
click_gain = _session->click_gain();
if (click_gain) {
boost::shared_ptr<AutomationControl> ac = click_gain->gain_control();
if (ac) {
@ -1079,9 +1079,9 @@ Push2::other_vpot_touch (int n, bool touching)
boost::shared_ptr<AutomationControl> ac = master->gain_control();
if (ac) {
if (touching) {
ac->start_touch (session->audible_sample());
ac->start_touch (_session->audible_sample());
} else {
ac->stop_touch (session->audible_sample());
ac->stop_touch (_session->audible_sample());
}
}
}

View file

@ -456,13 +456,13 @@ US2400Protocol::marker_release (Button &)
* the current position and we're not rolling.
*/
samplepos_t where = session->audible_sample();
samplepos_t where = _session->audible_sample();
if (session->transport_stopped_or_stopping() && session->locations()->mark_at (where, session->sample_rate() / 100.0)) {
if (_session->transport_stopped_or_stopping() && _session->locations()->mark_at (where, _session->sample_rate() / 100.0)) {
return off;
}
session->locations()->next_available_name (markername,"mark");
_session->locations()->next_available_name (markername,"mark");
add_marker (markername);
return off;
@ -478,7 +478,7 @@ US2400Protocol::stop_press (Button &)
transport_stop ();
if (main_modifier_state() == MODIFIER_SHIFT) {
session->midi_panic();
_session->midi_panic();
}
return on;
@ -487,7 +487,7 @@ US2400Protocol::stop_press (Button &)
LedState
US2400Protocol::stop_release (Button &)
{
return session->transport_stopped_or_stopping();
return _session->transport_stopped_or_stopping();
}
LedState
@ -569,7 +569,7 @@ US2400Protocol::loop_press (Button &)
access_action ("Editor/set-loop-from-edit-range");
return off;
} else {
bool was_on = session->get_play_loop();
bool was_on = _session->get_play_loop();
loop_toggle ();
return was_on ? off : on;
}
@ -772,7 +772,7 @@ LedState
US2400Protocol::mstr_press (Button &)
{
// access_action("Mixer/select-none");
set_stripable_selection( session->master_out() );
set_stripable_selection( _session->master_out() );
return on;
}
@ -906,7 +906,7 @@ US2400Protocol::clearsolo_press (US2400::Button&)
US2400::LedState
US2400Protocol::clearsolo_release (US2400::Button&)
{
//return session->soloing();
//return _session->soloing();
return none;
}

View file

@ -244,7 +244,7 @@ US2400Protocol::get_sorted_stripables()
// fetch all stripables
StripableList stripables;
session->get_stripables (stripables);
_session->get_stripables (stripables);
// sort in presentation order, and exclude master, control and hidden stripables
// and any stripables that are already set.
@ -382,7 +382,7 @@ US2400Protocol::switch_banks (uint32_t initial, bool force)
}
/* current bank has not been saved */
session->set_dirty();
_session->set_dirty();
return 0;
}
@ -606,20 +606,20 @@ void
US2400Protocol::connect_session_signals()
{
// receive routes added
session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_routes_added, this, _1), this);
_session->RouteAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_routes_added, this, _1), this);
// receive VCAs added
session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_vca_added, this, _1), this);
_session->vca_manager().VCAAdded.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_vca_added, this, _1), this);
// receive record state toggled
session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_record_state_changed, this), this);
_session->RecordStateChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_record_state_changed, this), this);
// receive transport state changed
session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_transport_state_changed, this), this);
session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_loop_state_changed, this), this);
_session->TransportStateChange.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_transport_state_changed, this), this);
_session->TransportLooped.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_loop_state_changed, this), this);
// receive punch-in and punch-out
Config->ParameterChanged.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_parameter_changed, this, _1), this);
session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_parameter_changed, this, _1), this);
_session->config.ParameterChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_parameter_changed, this, _1), this);
// receive rude solo changed
session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_solo_active_changed, this, _1), this);
_session->SoloActive.connect(session_connections, MISSING_INVALIDATOR, boost::bind (&US2400Protocol::notify_solo_active_changed, this, _1), this);
// make sure remote id changed signals reach here
// see also notify_stripable_added
@ -766,13 +766,13 @@ US2400Protocol::create_surfaces ()
_input_bundle->add_channel (
surface->port().input_port().name(),
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (surface->port().input_port().name())
_session->engine().make_port_name_non_relative (surface->port().input_port().name())
);
_output_bundle->add_channel (
surface->port().output_port().name(),
ARDOUR::DataType::MIDI,
session->engine().make_port_name_non_relative (surface->port().output_port().name())
_session->engine().make_port_name_non_relative (surface->port().output_port().name())
);
}
@ -794,7 +794,7 @@ US2400Protocol::create_surfaces ()
(*s)->port().reconnect ();
}
session->BundleAddedOrRemoved ();
_session->BundleAddedOrRemoved ();
assert (_master_surface);
@ -1109,7 +1109,7 @@ US2400Protocol::notify_record_state_changed ()
if (rec) {
LedState ls;
switch (session->record_status()) {
switch (_session->record_status()) {
case Session::Disabled:
DEBUG_TRACE (DEBUG::US2400, "record state changed to disabled, LED off\n");
ls = off;
@ -1323,7 +1323,7 @@ US2400Protocol::midi_input_handler (IOCondition ioc, MIDI::Port* port)
}
// DEBUG_TRACE (DEBUG::US2400, string_compose ("data available on %1\n", port->name()));
samplepos_t now = session->engine().sample_time();
samplepos_t now = _session->engine().sample_time();
port->parse (now);
}
@ -1469,13 +1469,13 @@ US2400Protocol::display_view_mode ()
void
US2400Protocol::set_master_on_surface_strip (uint32_t surface, uint32_t strip_number)
{
force_special_stripable_to_strip (session->master_out(), surface, strip_number);
force_special_stripable_to_strip (_session->master_out(), surface, strip_number);
}
void
US2400Protocol::set_monitor_on_surface_strip (uint32_t surface, uint32_t strip_number)
{
force_special_stripable_to_strip (session->monitor_out(), surface, strip_number);
force_special_stripable_to_strip (_session->monitor_out(), surface, strip_number);
}
void
@ -1491,7 +1491,7 @@ US2400Protocol::force_special_stripable_to_strip (boost::shared_ptr<Stripable> r
if ((*s)->number() == surface) {
Strip* strip = (*s)->nth_strip (strip_number);
if (strip) {
strip->set_stripable (session->master_out());
strip->set_stripable (_session->master_out());
strip->lock_controls ();
}
}
@ -1511,7 +1511,7 @@ US2400Protocol::update_fader_automation_state ()
samplepos_t
US2400Protocol::transport_sample() const
{
return session->transport_sample();
return _session->transport_sample();
}
void

View file

@ -198,7 +198,7 @@ class US2400Protocol
void update_global_button (int id, US2400::LedState);
void update_global_led (int id, US2400::LedState);
ARDOUR::Session & get_session() { return *session; }
ARDOUR::Session & get_session() { return *_session; }
samplepos_t transport_sample() const;
int modifier_state() const { return _modifier_state; }

View file

@ -63,7 +63,7 @@ public:
ARDOUR::Session& ardour_session ()
{
return *session;
return *_session;
}
ArdourMixer& mixer_component ()
{

View file

@ -118,8 +118,8 @@ WiimoteControlProtocol::start ()
DEBUG_TRACE (DEBUG::WiimoteControl, "WiimoteControlProtocol::start init\n");
// update LEDs whenever the transport or recording state changes
session->TransportStateChange.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&WiimoteControlProtocol::update_led_state, this), this);
session->RecordStateChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&WiimoteControlProtocol::update_led_state, this), this);
_session->TransportStateChange.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&WiimoteControlProtocol::update_led_state, this), this);
_session->RecordStateChanged.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&WiimoteControlProtocol::update_led_state, this), this);
// start the Wiimote control UI; it will run in its own thread context
BaseUI::run ();
@ -305,7 +305,7 @@ WiimoteControlProtocol::update_led_state ()
}
// enable LED4 if Ardour is recording
if (session->actively_recording ()) {
if (_session->actively_recording ()) {
DEBUG_TRACE (DEBUG::WiimoteControl, "WiimoteControlProtocol::update_led_state recording, activate LED4\n");
state |= CWIID_LED4_ON;
}