diff --git a/libs/surfaces/cc121/cc121.cc b/libs/surfaces/cc121/cc121.cc index 76c7abe647..09ce011a43 100644 --- a/libs/surfaces/cc121/cc121.cc +++ b/libs/surfaces/cc121/cc121.cc @@ -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 gain = _current_stripable->gain_control (); if (gain) { - timepos_t now (session->engine().sample_time()); + timepos_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 gain = _current_stripable->gain_control (); if (gain) { - timepos_t now (session->engine().sample_time()); + timepos_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_ptrclear (); DEBUG_TRACE (DEBUG::CC121, string_compose ("data available on %1\n", boost::shared_ptr(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()); } @@ -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 (); diff --git a/libs/surfaces/cc121/operations.cc b/libs/surfaces/cc121/operations.cc index e77062e5d0..cc28480d1d 100644 --- a/libs/surfaces/cc121/operations.cc +++ b/libs/surfaces/cc121/operations.cc @@ -157,7 +157,7 @@ CC121::mute () return; } - if (_current_stripable == session->monitor_out()) { + if (_current_stripable == _session->monitor_out()) { boost::shared_ptr 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 r = session->master_out(); + boost::shared_ptr 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 (_current_stripable); } set_current_stripable (r); @@ -215,7 +215,7 @@ CC121::use_master () void CC121::use_monitor () { - boost::shared_ptr r = session->monitor_out(); + boost::shared_ptr 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 (_current_stripable); } set_current_stripable (r); diff --git a/libs/surfaces/contourdesign/contourdesign.cc b/libs/surfaces/contourdesign/contourdesign.cc index 5a8663a373..2895f58c3c 100644 --- a/libs/surfaces/contourdesign/contourdesign.cc +++ b/libs/surfaces/contourdesign/contourdesign.cc @@ -559,24 +559,24 @@ ContourDesignControlProtocol::handle_button_release (unsigned short btn) void ContourDesignControlProtocol::prev_marker_keep_rolling () { - timepos_t pos = session->locations()->first_mark_before (timepos_t (session->transport_sample())); + timepos_t pos = _session->locations()->first_mark_before (timepos_t (_session->transport_sample())); if (pos.positive() || pos.zero()) { - session->request_locate (pos.samples()); + _session->request_locate (pos.samples()); } else { - session->goto_start (); + _session->goto_start (); } } void ContourDesignControlProtocol::next_marker_keep_rolling () { - timepos_t pos = session->locations()->first_mark_after (timepos_t (session->transport_sample())); + timepos_t pos = _session->locations()->first_mark_after (timepos_t (_session->transport_sample())); if (pos.positive() || pos.zero()) { - session->request_locate (pos.samples()); + _session->request_locate (pos.samples()); } else { - session->goto_end(); + _session->goto_end(); } } diff --git a/libs/surfaces/control_protocol/basic_ui.cc b/libs/surfaces/control_protocol/basic_ui.cc index 5e2dc4409a..f394e4d7e3 100644 --- a/libs/surfaces/control_protocol/basic_ui.cc +++ b/libs/surfaces/control_protocol/basic_ui.cc @@ -44,12 +44,12 @@ using namespace Temporal; PBD::Signal2 BasicUI::AccessAction; BasicUI::BasicUI (Session& s) - : session (&s) + : _session (&s) { } BasicUI::BasicUI () - : session (0) + : _session (0) { } @@ -80,21 +80,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 { @@ -105,9 +105,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); } } @@ -119,10 +119,10 @@ void BasicUI::loop_location (timepos_t const & start, timepos_t const & 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); @@ -132,58 +132,58 @@ BasicUI::loop_location (timepos_t const & start, timepos_t const & 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) { - timepos_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(*(session->locations()), &before, &after)); - session->commit_reversible_command (); + timepos_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(*(_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 (timepos_t (session->audible_sample()), timepos_t (session->audible_sample()+1), locs, Location::Flags(0)); + _session->locations()->find_all_between (timepos_t (_session->audible_sample()), timepos_t (_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(*(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(*(_session->locations()), &before, &after)); + _session->commit_reversible_command (); } } } @@ -203,14 +203,14 @@ BasicUI::button_varispeed (bool fwd) if (fwd) { if (transport_speed <= 0) { - session->request_transport_speed (1.0); - session->request_roll (TRS_UI); + _session->request_transport_speed (1.0); + _session->request_roll (TRS_UI); return; } } else { if (transport_speed >= 0) { - session->request_transport_speed (-1.0); - session->request_roll (TRS_UI); + _session->request_transport_speed (-1.0); + _session->request_roll (TRS_UI); return; } } @@ -224,13 +224,13 @@ BasicUI::button_varispeed (bool fwd) if (fwd) { if (transport_speed <= 0) { - session->request_transport_speed (1.0); - session->request_roll (TRS_UI); + _session->request_transport_speed (1.0); + _session->request_roll (TRS_UI); } } else { if (transport_speed >= 0) { - session->request_transport_speed (-1.0); - session->request_roll (TRS_UI); + _session->request_transport_speed (-1.0); + _session->request_roll (TRS_UI); } } @@ -275,8 +275,8 @@ BasicUI::button_varispeed (bool fwd) speed = semitone_ratio * transport_speed; speed = std::max (-maxspeed, std::min (maxspeed, speed)); - session->request_transport_speed (speed); - session->request_roll (TRS_UI); + _session->request_transport_speed (speed); + _session->request_roll (TRS_UI); } void @@ -294,13 +294,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 @@ -324,7 +324,7 @@ BasicUI::rewind_button_onoff () const bool BasicUI::loop_button_onoff () const { - return session->get_play_loop(); + return _session->get_play_loop(); } void @@ -332,17 +332,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 @@ -355,99 +355,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, TRS_UI); + _session->request_transport_speed (1.0, 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 () { - timepos_t pos = session->locations()->first_mark_before (timepos_t (session->transport_sample())); + timepos_t pos = _session->locations()->first_mark_before (timepos_t (_session->transport_sample())); if (pos >= 0) { - session->request_locate (pos.samples()); + _session->request_locate (pos.samples()); } else { - session->goto_start (); + _session->goto_start (); } } void BasicUI::next_marker () { - timepos_t pos = session->locations()->first_mark_after (timepos_t (session->transport_sample())); + timepos_t pos = _session->locations()->first_mark_after (timepos_t (_session->transport_sample())); if (pos >= 0) { - session->request_locate (pos.samples()); + _session->request_locate (pos.samples()); } 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 @@ -465,79 +465,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 (int bars, LocateTransportDisposition ltd) { TempoMap::SharedPtr tmap (TempoMap::use()); - Temporal::BBT_Time bbt (tmap->bbt_at (timepos_t (session->transport_sample()))); + Temporal::BBT_Time bbt (tmap->bbt_at (timepos_t (_session->transport_sample()))); bars += bbt.bars; if (bars < 0) { @@ -548,25 +548,25 @@ BasicUI::jump_by_bars (int 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 (int beats, LocateTransportDisposition ltd) { - Beats qn_goal = timepos_t (session->transport_sample ()).beats() + Beats (beats, 0); + Beats qn_goal = timepos_t (_session->transport_sample ()).beats() + Beats (beats, 0); if (qn_goal < Beats()) { qn_goal = Beats(); } - session->request_locate (timepos_t (qn_goal).samples()); + _session->request_locate (timepos_t (qn_goal).samples()); } void BasicUI::toggle_monitor_mute () { - if (session->monitor_out()) { - boost::shared_ptr mon = session->monitor_out()->monitor_control(); + if (_session->monitor_out()) { + boost::shared_ptr mon = _session->monitor_out()->monitor_control(); if (mon->cut_all ()) { mon->set_cut_all (false); } else { @@ -578,8 +578,8 @@ BasicUI::toggle_monitor_mute () void BasicUI::toggle_monitor_dim () { - if (session->monitor_out()) { - boost::shared_ptr mon = session->monitor_out()->monitor_control(); + if (_session->monitor_out()) { + boost::shared_ptr mon = _session->monitor_out()->monitor_control(); if (mon->dim_all ()) { mon->set_dim_all (false); } else { @@ -591,8 +591,8 @@ BasicUI::toggle_monitor_dim () void BasicUI::toggle_monitor_mono () { - if (session->monitor_out()) { - boost::shared_ptr mon = session->monitor_out()->monitor_control(); + if (_session->monitor_out()) { + boost::shared_ptr mon = _session->monitor_out()->monitor_control(); if (mon->mono()) { mon->set_mono (false); } else { @@ -604,7 +604,7 @@ BasicUI::toggle_monitor_mono () void BasicUI::midi_panic () { - session->midi_panic (); + _session->midi_panic (); } void @@ -619,16 +619,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; @@ -645,34 +645,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().samples(), MustRoll); + if (_session->get_play_loop() && Config->get_loop_is_mode()) { + _session->request_locate (_session->locations()->auto_loop_location()->start().samples(), MustRoll); } else { - session->request_roll (TRS_UI); + _session->request_roll (TRS_UI); } } } @@ -680,7 +680,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"); } @@ -721,44 +721,44 @@ 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 (); } ARDOUR::samplecnt_t BasicUI::timecode_frames_per_hour () { - return session->timecode_frames_per_hour (); + return _session->timecode_frames_per_hour (); } 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::timecode_to_sample (Timecode::Time& timecode, samplepos_t & sample, bool use_offset, bool use_subframes) const { - session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_offset, use_subframes); + _session->timecode_to_sample (*((Timecode::Time*)&timecode), sample, use_offset, use_subframes); } void BasicUI::sample_to_timecode (samplepos_t sample, Timecode::Time& timecode, bool use_offset, bool use_subframes) const { - session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes); + _session->sample_to_timecode (sample, *((Timecode::Time*)&timecode), use_offset, use_subframes); } void BasicUI::cancel_all_solo () { - if (session) { - session->cancel_all_solo (); + if (_session) { + _session->cancel_all_solo (); } } @@ -771,11 +771,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; @@ -785,7 +785,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().samples()); + _session->request_locate ((*i)->start().samples()); break; } --n; diff --git a/libs/surfaces/control_protocol/control_protocol.cc b/libs/surfaces/control_protocol/control_protocol.cc index 34f380bf2d..d0cf8681af 100644 --- a/libs/surfaces/control_protocol/control_protocol.cc +++ b/libs/surfaces/control_protocol/control_protocol.cc @@ -281,7 +281,7 @@ ControlProtocol::route_set_soloed (uint32_t table_index, bool yn) boost::shared_ptr 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); } } @@ -332,37 +332,37 @@ ControlProtocol::set_state (XMLNode const & node, int /* version */) boost::shared_ptr 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 s) { - session->selection().add (s, boost::shared_ptr()); + _session->selection().add (s, boost::shared_ptr()); } void ControlProtocol::set_stripable_selection (boost::shared_ptr 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 s) { - session->selection().toggle (s, boost::shared_ptr()); + _session->selection().toggle (s, boost::shared_ptr()); } void ControlProtocol::remove_stripable_from_selection (boost::shared_ptr s) { - session->selection().remove (s, boost::shared_ptr()); + _session->selection().remove (s, boost::shared_ptr()); } void ControlProtocol::clear_stripable_selection () { - session->selection().clear_stripables (); + _session->selection().clear_stripables (); } void diff --git a/libs/surfaces/control_protocol/control_protocol/basic_ui.h b/libs/surfaces/control_protocol/control_protocol/basic_ui.h index 04da4f83e6..de70711067 100644 --- a/libs/surfaces/control_protocol/control_protocol/basic_ui.h +++ b/libs/surfaces/control_protocol/control_protocol/basic_ui.h @@ -156,7 +156,7 @@ class LIBCONTROLCP_API BasicUI { protected: BasicUI (); - ARDOUR::Session* session; + ARDOUR::Session* _session; }; #endif /* __ardour_basic_ui_h__ */ diff --git a/libs/surfaces/faderport/faderport.cc b/libs/surfaces/faderport/faderport.cc index f454f39c4b..cf5db2485e 100644 --- a/libs/surfaces/faderport/faderport.cc +++ b/libs/surfaces/faderport/faderport.cc @@ -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 gain = _current_stripable->gain_control (); if (gain) { - timepos_t now = timepos_t (session->engine().sample_time()); + timepos_t now = timepos_t (_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_ptrclear (); DEBUG_TRACE (DEBUG::FaderPort, string_compose ("data available on %1\n", boost::shared_ptr(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()); } @@ -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 (); diff --git a/libs/surfaces/faderport/operations.cc b/libs/surfaces/faderport/operations.cc index 29f6d977b1..7d7e8a0d86 100644 --- a/libs/surfaces/faderport/operations.cc +++ b/libs/surfaces/faderport/operations.cc @@ -124,7 +124,7 @@ FaderPort::mute () return; } - if (_current_stripable == session->monitor_out()) { + if (_current_stripable == _session->monitor_out()) { boost::shared_ptr 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 r = session->master_out(); + boost::shared_ptr 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 (_current_stripable); } set_current_stripable (r); @@ -183,7 +183,7 @@ FaderPort::use_master () void FaderPort::use_monitor () { - boost::shared_ptr r = session->monitor_out(); + boost::shared_ptr 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 (_current_stripable); } set_current_stripable (r); diff --git a/libs/surfaces/faderport8/actions.cc b/libs/surfaces/faderport8/actions.cc index 0c7641b5a4..a4ce4017a4 100644 --- a/libs/surfaces/faderport8/actions.cc +++ b/libs/surfaces/faderport8/actions.cc @@ -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(&b_ffw)->stop_repeat(); dynamic_cast(&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 cl (new ControlList); @@ -373,11 +373,11 @@ FaderPort8::button_mute_clear () ac->start_touch (timepos_t (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 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 (timepos_t (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 (timepos_t (where), timecnt_t (session->sample_rate() / 100.0))) { + samplepos_t where = _session->audible_sample(); + if (_session->transport_stopped_or_stopping() && _session->locations()->mark_at (timepos_t (where), timecnt_t (_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 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()); diff --git a/libs/surfaces/faderport8/callbacks.cc b/libs/surfaces/faderport8/callbacks.cc index aa38578fea..0a920ff67e 100644 --- a/libs/surfaces/faderport8/callbacks.cc +++ b/libs/surfaces/faderport8/callbacks.cc @@ -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 (); diff --git a/libs/surfaces/faderport8/faderport8.cc b/libs/surfaces/faderport8/faderport8.cc index c3f77f6e29..312708a72b 100644 --- a/libs/surfaces/faderport8/faderport8.cc +++ b/libs/surfaces/faderport8/faderport8.cc @@ -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]; - Temporal::BBT_Time BBT = Temporal::TempoMap::use()->bbt_at (timepos_t (session->transport_sample ())); + Temporal::BBT_Time BBT = Temporal::TempoMap::use()->bbt_at (timepos_t (_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(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 diff --git a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc index 0626359dbb..db991c8397 100644 --- a/libs/surfaces/generic_midi/generic_midi_control_protocol.cc +++ b/libs/surfaces/generic_midi/generic_midi_control_protocol.cc @@ -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 c { boost::shared_ptr actl = boost::dynamic_pointer_cast (controllable); if (actl) { - actl->start_touch (timepos_t (session->audible_sample ())); + actl->start_touch (timepos_t (_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(port)->name())); - samplepos_t now = session->engine().sample_time(); + samplepos_t now = _session->engine().sample_time(); port->parse (now); } diff --git a/libs/surfaces/launch_control_xl/controllers.cc b/libs/surfaces/launch_control_xl/controllers.cc index 21c5684a17..7e595156e4 100644 --- a/libs/surfaces/launch_control_xl/controllers.cc +++ b/libs/surfaces/launch_control_xl/controllers.cc @@ -932,7 +932,7 @@ LaunchControlXL::button_press_track_control(uint8_t n) { boost::shared_ptr 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 diff --git a/libs/surfaces/launch_control_xl/launch_control_xl.cc b/libs/surfaces/launch_control_xl/launch_control_xl.cc index 44a57e17ae..407ce85ba5 100644 --- a/libs/surfaces/launch_control_xl/launch_control_xl.cc +++ b/libs/surfaces/launch_control_xl/launch_control_xl.cc @@ -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(_async_in).get(); _output_port = boost::dynamic_pointer_cast(_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; } diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc index fed55dbb73..9db10be897 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.cc +++ b/libs/surfaces/mackie/mackie_control_protocol.cc @@ -279,7 +279,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. @@ -457,7 +457,7 @@ MackieControlProtocol::switch_banks (uint32_t initial, bool force) } /* current bank has not been saved */ - session->set_dirty(); + _session->set_dirty(); return 0; } @@ -740,22 +740,22 @@ 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); - session->MonitorBusAddedOrRemoved.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_monitor_added_or_removed, this), this); + _session->MonitorBusAddedOrRemoved.connect (session_connections, MISSING_INVALIDATOR, boost::bind (&MackieControlProtocol::notify_monitor_added_or_removed, this), this); // make sure remote id changed signals reach here // see also notify_stripable_added @@ -927,13 +927,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()) ); } @@ -989,7 +989,7 @@ MackieControlProtocol::create_surfaces () } } - session->BundleAddedOrRemoved (); + _session->BundleAddedOrRemoved (); assert (_master_surface); @@ -1155,7 +1155,7 @@ MackieControlProtocol::format_bbt_timecode (samplepos_t now_sample) { Temporal::BBT_Time bbt_time; - session->bbt_time (timepos_t (now_sample), bbt_time); + _session->bbt_time (timepos_t (now_sample), bbt_time); // The Mackie protocol spec is built around a BBT time display of // @@ -1181,7 +1181,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 @@ -1215,9 +1215,9 @@ MackieControlProtocol::update_timecode_display() string timecode; // do assignment here so current_sample is fixed - samplepos_t current_sample = session->transport_sample(); + samplepos_t current_sample = _session->transport_sample(); // 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, '\0'); @@ -1250,9 +1250,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") { @@ -1262,9 +1262,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)); } @@ -1359,7 +1359,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 @@ -1417,7 +1417,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; @@ -1699,7 +1699,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); } @@ -1844,13 +1844,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 @@ -1866,7 +1866,7 @@ MackieControlProtocol::force_special_stripable_to_strip (boost::shared_ptrnumber() == 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 (); } } @@ -1960,7 +1960,7 @@ MackieControlProtocol::update_fader_automation_state () samplepos_t MackieControlProtocol::transport_sample() const { - return session->transport_sample(); + return _session->transport_sample(); } void @@ -2177,7 +2177,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; diff --git a/libs/surfaces/mackie/mackie_control_protocol.h b/libs/surfaces/mackie/mackie_control_protocol.h index 086a86ecbb..aca88f298b 100644 --- a/libs/surfaces/mackie/mackie_control_protocol.h +++ b/libs/surfaces/mackie/mackie_control_protocol.h @@ -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; } diff --git a/libs/surfaces/mackie/mcp_buttons.cc b/libs/surfaces/mackie/mcp_buttons.cc index c2097d0423..3ac849443b 100644 --- a/libs/surfaces/mackie/mcp_buttons.cc +++ b/libs/surfaces/mackie/mcp_buttons.cc @@ -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 (timepos_t (where), timecnt_t (session->sample_rate() / 100.0))) { + if (_session->transport_stopped_or_stopping() && _session->locations()->mark_at (timepos_t (where), timecnt_t (_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; } @@ -926,7 +926,7 @@ MackieControlProtocol::clearsolo_press (Mackie::Button&) Mackie::LedState MackieControlProtocol::clearsolo_release (Mackie::Button&) { - //return session->soloing(); + //return _session->soloing(); return none; } diff --git a/libs/surfaces/maschine2/callbacks.cc b/libs/surfaces/maschine2/callbacks.cc index be4bde766a..c93d138cc5 100644 --- a/libs/surfaces/maschine2/callbacks.cc +++ b/libs/surfaces/maschine2/callbacks.cc @@ -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 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 master = session->master_out (); + boost::shared_ptr 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.; diff --git a/libs/surfaces/maschine2/maschine2.cc b/libs/surfaces/maschine2/maschine2.cc index 71163eeac4..d2008a8bad 100644 --- a/libs/surfaces/maschine2/maschine2.cc +++ b/libs/surfaces/maschine2/maschine2.cc @@ -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 diff --git a/libs/surfaces/osc/osc.cc b/libs/surfaces/osc/osc.cc index 44a0863c7e..2ddb020439 100644 --- a/libs/surfaces/osc/osc.cc +++ b/libs/surfaces/osc/osc.cc @@ -124,7 +124,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() @@ -252,7 +252,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); @@ -268,15 +268,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; @@ -666,7 +666,7 @@ OSC::get_unix_server_url() void OSC::gui_changed () { - session->set_dirty(); + _session->set_dirty(); } void @@ -686,7 +686,7 @@ OSC::current_value_query (const char* path, size_t len, lo_arg **argv, int argc, void OSC::send_current_value (const char* path, lo_arg** argv, int argc, lo_message msg) { - if (!session) { + if (!_session) { return; } @@ -700,7 +700,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"); @@ -996,37 +996,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 { @@ -1040,7 +1040,7 @@ OSC::current_value (const char */*path*/, const char */*types*/, lo_arg **/*argv void OSC::routes_list (lo_message msg) { - if (!session) { + if (!_session) { return; } OSCSurface *sur = get_surface(get_address (msg), true); @@ -1114,9 +1114,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 { @@ -1208,7 +1208,7 @@ OSC::get_surfaces () int OSC::custom_clear (lo_message msg) { - if (!session) { + if (!_session) { return 0; } OSCSurface *sur = get_surface(get_address (msg), true); @@ -1236,7 +1236,7 @@ OSC::custom_mode (float state, lo_message msg) int OSC::_custom_mode (uint32_t state, lo_address addr) { - if (!session) { + if (!_session) { return 0; } OSCSurface *sur = get_surface(addr, true); @@ -1282,32 +1282,32 @@ 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) { + if (!_session) { return 0; } - 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().samples(), MustRoll); + if (_session->get_play_loop() && Config->get_loop_is_mode()) { + _session->request_locate (_session->locations()->auto_loop_location()->start().samples(), MustRoll); } else { - session->request_roll (TRS_UI); + _session->request_roll (TRS_UI); } } return 0; @@ -2015,7 +2015,7 @@ OSC::set_surface_port (uint32_t po, lo_message msg) int OSC::check_surface (lo_message msg) { - if (!session) { + if (!_session) { return -1; } get_surface (get_address (msg)); @@ -2096,7 +2096,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); } @@ -2245,10 +2245,10 @@ OSC::set_bank (uint32_t bank_start, lo_message msg) int OSC::_set_bank (uint32_t bank_start, lo_address addr) { - if (!session) { + if (!_session) { return -1; } - if (!session->nroutes()) { + if (!_session->nroutes()) { return -1; } @@ -2390,7 +2390,7 @@ OSC::bank_up (lo_message msg) int OSC::bank_delta (float delta, lo_message msg) { - if (!session) { + if (!_session) { return -1; } // only do deltas of -1 0 or 1 @@ -2435,7 +2435,7 @@ OSC::bank_down (lo_message msg) int OSC::use_group (float value, lo_message msg) { - if (!session) { + if (!_session) { return -1; } OSCSurface *s = get_surface(get_address (msg)); @@ -2581,7 +2581,7 @@ boost::shared_ptr 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 s = *it; boost::shared_ptr v = boost::dynamic_pointer_cast (s); @@ -2616,7 +2616,7 @@ OSC::set_temp_mode (lo_address addr) // check if this group feeds a bus or is slaved boost::shared_ptr mstr = boost::shared_ptr (); if (rg->has_control_master()) { - boost::shared_ptr vca = session->vca_manager().vca_by_number (rg->group_master_number()); + boost::shared_ptr vca = _session->vca_manager().vca_by_number (rg->group_master_number()); if (vca) { mstr = boost::dynamic_pointer_cast (vca); } @@ -2639,7 +2639,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 st = *it; if (st->slaved_to (vca)) { @@ -2658,7 +2658,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 st = *it; boost::shared_ptr ri = boost::dynamic_pointer_cast (st); @@ -2711,7 +2711,7 @@ OSC::get_send (boost::shared_ptr st, lo_address addr) int OSC::name_session (char *n, lo_message msg) { - if (!session) { + if (!_session) { return -1; } string new_name = n; @@ -2722,7 +2722,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; @@ -2935,11 +2935,11 @@ OSC::_sel_plugin (int id, lo_address addr) void OSC::transport_sample (lo_message msg) { - if (!session) { + if (!_session) { return; } 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); @@ -2952,7 +2952,7 @@ OSC::transport_sample (lo_message msg) void OSC::transport_speed (lo_message msg) { - if (!session) { + if (!_session) { return; } check_surface (msg); @@ -2969,11 +2969,11 @@ OSC::transport_speed (lo_message msg) void OSC::record_enabled (lo_message msg) { - if (!session) { + if (!_session) { return; } 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); @@ -2986,10 +2986,12 @@ OSC::record_enabled (lo_message msg) int OSC::scrub (float delta, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } check_surface (msg); - scrub_place = session->transport_sample (); + scrub_place = _session->transport_sample (); float speed; @@ -3013,18 +3015,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; @@ -3033,7 +3035,9 @@ OSC::scrub (float delta, lo_message msg) int OSC::jog (float delta, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } OSCSurface *s = get_surface(get_address (msg)); @@ -3101,7 +3105,9 @@ OSC::jog (float delta, lo_message msg) int OSC::jog_mode (float mode, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } OSCSurface *s = get_surface(get_address (msg)); if (get_transport_speed () != 1.0) { @@ -3133,7 +3139,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]) { @@ -3143,9 +3149,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_sample (), MustStop); + _session->request_locate ((*l)->start_sample (), MustStop); return 0; - } else if ((*l)->start () == session->transport_sample()) { + } else if ((*l)->start () == _session->transport_sample()) { cur_mark = (*l); } } @@ -3180,7 +3186,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 @@ -3201,7 +3207,7 @@ OSC::send_group_list (lo_address addr) lo_message_add_string (reply, X_("none")); - std::list groups = session->route_groups (); + std::list groups = _session->route_groups (); for (std::list::iterator i = groups.begin(); i != groups.end(); ++i) { RouteGroup *rg = *i; lo_message_add_string (reply, rg->name().c_str()); @@ -3214,9 +3220,12 @@ OSC::send_group_list (lo_address addr) int OSC::click_level (float position) { - if (!session) return -1; - 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) { + return -1; + } + + 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; } @@ -3229,7 +3238,7 @@ OSC::loop_location (int start, int end) int OSC::route_get_sends(lo_message msg) { - if (!session) { + if (!_session) { return -1; } @@ -3279,7 +3288,7 @@ OSC::route_get_sends(lo_message msg) { int OSC::route_get_receives(lo_message msg) { - if (!session) { + if (!_session) { return -1; } @@ -3298,7 +3307,7 @@ OSC::route_get_receives(lo_message msg) { return -1; } - boost::shared_ptr route_list = session->get_routes(); + boost::shared_ptr route_list = _session->get_routes(); lo_message reply = lo_message_new(); lo_message_add_int32(reply, rid); @@ -3344,7 +3353,10 @@ OSC::route_get_receives(lo_message msg) { int OSC::master_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } + int ret = 1; // set sub_path to null string if path is /master const char* sub_path = &path[7]; @@ -3356,7 +3368,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 s = session->master_out(); + boost::shared_ptr s = _session->master_out(); if (s) { ret = _strip_parse (path, sub_path, types, argv, argc, s, 0, false, msg); } else { @@ -3368,7 +3380,10 @@ OSC::master_parse (const char *path, const char* types, lo_arg **argv, int argc, int OSC::monitor_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } + int ret = 1; // set sub_path to null string if path is /monitor const char* sub_path = &path[8]; @@ -3380,9 +3395,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 s = session->monitor_out(); + boost::shared_ptr s = _session->monitor_out(); if (s) { - boost::shared_ptr mon = session->monitor_out()->monitor_control(); + boost::shared_ptr mon = _session->monitor_out()->monitor_control(); int state = 0; if (types[0] == 'f') { state = (uint32_t) argv[0]->f; @@ -3420,7 +3435,10 @@ OSC::monitor_parse (const char *path, const char* types, lo_arg **argv, int argc int OSC::select_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } + int ret = 1; // set sub_path to null string if path is /select const char* sub_path = &path[7]; @@ -3511,7 +3529,10 @@ OSC::select_parse (const char *path, const char* types, lo_arg **argv, int argc, int OSC::strip_parse (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } + int ret = 1; int ssid = 0; int param_1 = 1; @@ -3951,12 +3972,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); } @@ -3965,7 +3986,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); } @@ -3986,8 +4007,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; } @@ -4076,7 +4097,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 st = *it; boost::shared_ptr v = boost::dynamic_pointer_cast (st); @@ -4236,7 +4257,9 @@ OSC::strip_list (lo_message msg) int OSC::set_automation (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } int ret = 1; OSCSurface *sur = get_surface(get_address (msg)); @@ -4362,7 +4385,9 @@ OSC::set_automation (const char *path, const char* types, lo_arg **argv, int arg int OSC::touch_detect (const char *path, const char* types, lo_arg **argv, int argc, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } int ret = 1; OSCSurface *sur = get_surface(get_address (msg)); @@ -4500,7 +4525,9 @@ OSC::spill (const char *path, const char* types, lo_arg **argv, int argc, lo_mes * /select/spill (may have i or f keypress/release) * /strip/spill i (may have keypress and i may be inline) */ - if (!session || argc > 1) return -1; + if (!_session || argc > 1) { + return -1; + } int ret = 1; OSCSurface *sur = get_surface(get_address (msg)); @@ -4613,18 +4640,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 lsn_rt = session->route_by_name (foldback_name); + boost::shared_ptr 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 raw_rt = session->route_by_name (foldbackbus); + boost::shared_ptr 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) { @@ -4636,7 +4663,7 @@ OSC::sel_new_personal_send (char *foldback, lo_message msg) // create send rt->add_foldback_send (lsn_rt, false); //boost::shared_ptr snd = rt->internal_send_for (aux); - session->dirty (); + _session->dirty (); return 0; } else { PBD::warning << "OSC: new_send - duplicate send, ignored." << endmsg; @@ -4654,7 +4681,7 @@ OSC::sel_new_personal_send (char *foldback, lo_message msg) int OSC::_strip_select (boost::shared_ptr s, lo_address addr) { - if (!session) { + if (!_session) { return -1; } OSCSurface *sur = get_surface(addr, true); @@ -4687,7 +4714,7 @@ OSC::_strip_select2 (boost::shared_ptr 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; } @@ -4712,7 +4739,7 @@ OSC::_strip_select2 (boost::shared_ptr 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); @@ -4845,7 +4872,7 @@ OSC::sel_delta (int delta, lo_message msg) int OSC::route_set_send_gain_dB (int ssid, int id, float val, lo_message msg) { - if (!session) { + if (!_session) { return -1; } boost::shared_ptr s = get_strip (ssid, get_address (msg)); @@ -4871,7 +4898,7 @@ OSC::route_set_send_gain_dB (int ssid, int id, float val, lo_message msg) int OSC::route_set_send_fader (int ssid, int id, float val, lo_message msg) { - if (!session) { + if (!_session) { return -1; } boost::shared_ptr s = get_strip (ssid, get_address (msg)); @@ -4955,7 +4982,7 @@ OSC::sel_sendfader (int id, float val, lo_message msg) int OSC::route_set_send_enable (int ssid, int sid, float val, lo_message msg) { - if (!session) { + if (!_session) { return -1; } boost::shared_ptr s = get_strip (ssid, get_address (msg)); @@ -5156,7 +5183,7 @@ OSC::select_plugin_parameter (const char *path, const char* types, lo_arg **argv int OSC::sel_plugin_activate (float state, lo_message msg) { - if (!session) { + if (!_session) { return -1; } OSCSurface *sur = get_surface(get_address (msg)); @@ -5187,7 +5214,7 @@ OSC::sel_plugin_activate (float state, lo_message msg) int OSC::route_plugin_list (int ssid, lo_message msg) { - if (!session) { + if (!_session) { return -1; } @@ -5231,7 +5258,7 @@ OSC::route_plugin_list (int ssid, lo_message msg) { int OSC::route_plugin_descriptor (int ssid, int piid, lo_message msg) { - if (!session) { + if (!_session) { return -1; } @@ -5359,7 +5386,7 @@ OSC::route_plugin_descriptor (int ssid, int piid, lo_message msg) { int OSC::route_plugin_reset (int ssid, int piid, lo_message msg) { - if (!session) { + if (!_session) { return -1; } @@ -5392,7 +5419,7 @@ OSC::route_plugin_reset (int ssid, int piid, lo_message msg) { int OSC::route_plugin_parameter (int ssid, int piid, int par, float val, lo_message msg) { - if (!session) + if (!_session) return -1; boost::shared_ptr s = get_strip (ssid, get_address (msg)); @@ -5452,7 +5479,7 @@ OSC::route_plugin_parameter (int ssid, int piid, int par, float val, lo_message int OSC::route_plugin_parameter_print (int ssid, int piid, int par, lo_message msg) { - if (!session) { + if (!_session) { return -1; } boost::shared_ptr s = get_strip (ssid, get_address (msg)); @@ -5505,8 +5532,10 @@ OSC::route_plugin_parameter_print (int ssid, int piid, int par, lo_message msg) int OSC::route_plugin_activate (int ssid, int piid, lo_message msg) { - if (!session) + if (!_session) { return -1; + } + boost::shared_ptr s = get_strip (ssid, lo_message_get_source (msg)); boost::shared_ptr r = boost::dynamic_pointer_cast (s); @@ -5539,8 +5568,10 @@ OSC::route_plugin_activate (int ssid, int piid, lo_message msg) int OSC::route_plugin_deactivate (int ssid, int piid, lo_message msg) { - if (!session) + if (!_session) { return -1; + } + boost::shared_ptr s = get_strip (ssid, lo_message_get_source (msg)); boost::shared_ptr r = boost::dynamic_pointer_cast (s); @@ -5904,7 +5935,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++) { @@ -6012,7 +6043,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 @@ -6095,13 +6126,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()); } } } @@ -6287,7 +6318,7 @@ OSC::cue_new_aux (string name, string dest_1, string dest_2, uint32_t count, lo_ RouteList list; boost::shared_ptr 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 r = boost::dynamic_pointer_cast(aux); @@ -6307,7 +6338,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; @@ -6320,7 +6351,7 @@ OSC::cue_new_send (string rt_name, lo_message msg) if (sur->cue) { boost::shared_ptr aux = boost::dynamic_pointer_cast (get_strip (sur->aux, get_address(msg))); if (aux) { - boost::shared_ptr rt_send = session->route_by_name (rt_name); + boost::shared_ptr 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; @@ -6328,7 +6359,7 @@ OSC::cue_new_send (string rt_name, lo_message msg) // create send rt_send->add_foldback_send (aux, false); boost::shared_ptr snd = rt_send->internal_send_for (aux); - session->dirty (); + _session->dirty (); return 0; } else { PBD::warning << "OSC: new_send - duplicate send, ignored." << endmsg; @@ -6360,7 +6391,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; } } @@ -6422,7 +6453,9 @@ OSC::cue_get_send (uint32_t id, lo_address addr) int OSC::cue_aux_fader (float position, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } OSCSurface *sur = get_surface(get_address (msg), true); if (sur->cue) { @@ -6444,7 +6477,9 @@ OSC::cue_aux_fader (float position, lo_message msg) int OSC::cue_aux_mute (float state, lo_message msg) { - if (!session) return -1; + if (!_session) { + return -1; + } OSCSurface *sur = get_surface(get_address (msg), true); if (sur->cue) { @@ -6465,7 +6500,7 @@ OSC::cue_aux_mute (float state, lo_message msg) int OSC::cue_send_fader (uint32_t id, float val, lo_message msg) { - if (!session) { + if (!_session) { return -1; } boost::shared_ptr s = cue_get_send (id, get_address (msg)); @@ -6482,8 +6517,10 @@ OSC::cue_send_fader (uint32_t id, float val, lo_message msg) int OSC::cue_send_enable (uint32_t id, float state, lo_message msg) { - if (!session) + if (!_session) { return -1; + } + boost::shared_ptr s = cue_get_send (id, get_address (msg)); if (s) { if (state) { diff --git a/libs/surfaces/push2/buttons.cc b/libs/surfaces/push2/buttons.cc index 0d2173691f..5e506cf83c 100644 --- a/libs/surfaces/push2/buttons.cc +++ b/libs/surfaces/push2/buttons.cc @@ -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 main_out = session->master_out (); + boost::shared_ptr main_out = _session->master_out (); if (!main_out) { return; diff --git a/libs/surfaces/push2/push2.cc b/libs/surfaces/push2/push2.cc index dc55e261d1..ca75f70a10 100644 --- a/libs/surfaces/push2/push2.cc +++ b/libs/surfaces/push2/push2.cc @@ -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