Revert Monitor-Section to be per session
This partially reverts 639dff3a7c
. When loading a session,
the monitor-bus that was saved with the session is used.
This changes semantics of the monitor-section/config.
Config::set_use_monitor_bus(bool) is used to initiate a change!
Notification about the change is sent asynchronously by
Session::MonitorBusAddedOrRemoved
It is no longer possible to directly call add/remove_monitor_section()
and leave the session + config in an inconsistent state.
This commit is contained in:
parent
6064c75fd5
commit
1854a72b80
@ -873,15 +873,14 @@ public:
|
||||
PBD::Signal0<void> MuteChanged;
|
||||
PBD::Signal0<void> IsolatedChanged;
|
||||
PBD::Signal0<void> MonitorChanged;
|
||||
PBD::Signal0<void> MonitorBusAddedOrRemoved;
|
||||
|
||||
PBD::Signal0<void> session_routes_reconnected;
|
||||
|
||||
/* monitor/master out */
|
||||
int add_master_bus (ChanCount const&);
|
||||
|
||||
void add_monitor_section ();
|
||||
void reset_monitor_section ();
|
||||
void remove_monitor_section ();
|
||||
bool monitor_active() const { return (_monitor_out && _monitor_out->monitor_control () && _monitor_out->monitor_control ()->monitor_active()); }
|
||||
|
||||
boost::shared_ptr<Route> monitor_out() const { return _monitor_out; }
|
||||
@ -1276,6 +1275,9 @@ private:
|
||||
|
||||
std::string _missing_file_replacement;
|
||||
|
||||
void add_monitor_section ();
|
||||
void remove_monitor_section ();
|
||||
|
||||
void initialize_latencies ();
|
||||
void update_latency (bool playback);
|
||||
bool update_route_latency (bool reverse, bool apply_to_delayline);
|
||||
|
@ -2240,8 +2240,6 @@ LuaBindings::common (lua_State* L)
|
||||
.addFunction ("new_midi_route", &Session::new_midi_route)
|
||||
|
||||
.addFunction ("add_master_bus", &Session::add_master_bus)
|
||||
.addFunction ("add_monitor_section", &Session::add_monitor_section)
|
||||
.addFunction ("remove_monitor_section", &Session::remove_monitor_section)
|
||||
|
||||
.addFunction ("get_routes", &Session::get_routes)
|
||||
.addFunction ("get_tracks", &Session::get_tracks)
|
||||
|
@ -1213,7 +1213,7 @@ Session::remove_monitor_section ()
|
||||
auditioner->connect ();
|
||||
}
|
||||
|
||||
Config->ParameterChanged ("use-monitor-bus");
|
||||
MonitorBusAddedOrRemoved (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
@ -1369,7 +1369,8 @@ Session::add_monitor_section ()
|
||||
if (auditioner) {
|
||||
auditioner->connect ();
|
||||
}
|
||||
Config->ParameterChanged ("use-monitor-bus");
|
||||
|
||||
MonitorBusAddedOrRemoved (); /* EMIT SIGNAL */
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -4135,11 +4135,33 @@ Session::config_changed (std::string p, bool ours)
|
||||
} else if (p == "auto-return-target-list") {
|
||||
follow_playhead_priority ();
|
||||
} else if (p == "use-monitor-bus") {
|
||||
bool yn = Config->get_use_monitor_bus();
|
||||
if (yn && !_monitor_out) {
|
||||
add_monitor_section ();
|
||||
} else if (!yn && _monitor_out) {
|
||||
remove_monitor_section ();
|
||||
/* NB. This is always called when constructing a session,
|
||||
* after restoring session state (if any),
|
||||
* via post_engine_init() -> Config->map_parameters()
|
||||
*/
|
||||
bool want_ms = Config->get_use_monitor_bus();
|
||||
bool have_ms = _monitor_out ? true : false;
|
||||
if (loading ()) {
|
||||
/* When loading an existing session, the config "use-monitor-bus"
|
||||
* is ignored. Instead the sesion-state (xml) will have added the
|
||||
* "monitor-route" and restored its state (and connections)
|
||||
* if the session has a monitor-section.
|
||||
* Update the config to reflect this.
|
||||
*/
|
||||
if (want_ms != have_ms) {
|
||||
Config->set_use_monitor_bus (have_ms);
|
||||
}
|
||||
MonitorBusAddedOrRemoved (); /* EMIT SIGNAL */
|
||||
} else {
|
||||
/* Otherwise, Config::set_use_monitor_bus() does
|
||||
* control the the presence of the monitor-section
|
||||
* (new sessions, user initiated change)
|
||||
*/
|
||||
if (want_ms && !have_ms) {
|
||||
add_monitor_section ();
|
||||
} else if (!want_ms && have_ms) {
|
||||
remove_monitor_section ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user