NO-OP: Use API to set/test state-of-the-state
This commit is contained in:
parent
bd9d848058
commit
4706201425
@ -213,16 +213,21 @@ public:
|
|||||||
bool path_is_within_session (const std::string&);
|
bool path_is_within_session (const std::string&);
|
||||||
|
|
||||||
bool writable() const { return _writable; }
|
bool writable() const { return _writable; }
|
||||||
void set_dirty ();
|
void set_clean (); // == Clean and emit DirtyChanged IFF session was Dirty
|
||||||
void set_clean ();
|
void set_dirty (); // |= Dirty and emit DirtyChanged (unless already dirty or Loading, Deletion)
|
||||||
bool dirty() const { return _state_of_the_state & Dirty; }
|
void unset_dirty (bool emit_dirty_changed = false); // &= ~Dirty
|
||||||
void set_deletion_in_progress ();
|
void set_deletion_in_progress (); // |= Deletion
|
||||||
void clear_deletion_in_progress ();
|
void clear_deletion_in_progress (); // &= ~Deletion
|
||||||
bool reconnection_in_progress() const { return _reconnecting_routes_in_progress; }
|
|
||||||
bool deletion_in_progress() const { return _state_of_the_state & Deletion; }
|
bool reconnection_in_progress () const { return _reconnecting_routes_in_progress; }
|
||||||
bool routes_deletion_in_progress() const { return _route_deletion_in_progress; }
|
bool routes_deletion_in_progress () const { return _route_deletion_in_progress; }
|
||||||
bool peaks_cleanup_in_progres() const { return _state_of_the_state & PeakCleanup; }
|
bool dirty () const { return _state_of_the_state & Dirty; }
|
||||||
bool loading () const { return _state_of_the_state & Loading; }
|
bool deletion_in_progress () const { return _state_of_the_state & Deletion; }
|
||||||
|
bool peaks_cleanup_in_progres () const { return _state_of_the_state & PeakCleanup; }
|
||||||
|
bool loading () const { return _state_of_the_state & Loading; }
|
||||||
|
bool cannot_save () const { return _state_of_the_state & CannotSave; }
|
||||||
|
bool in_cleanup () const { return _state_of_the_state & InCleanup; }
|
||||||
|
bool inital_connect_or_deletion_in_progress () { return _state_of_the_state & (InitialConnecting | Deletion); }
|
||||||
|
|
||||||
PBD::Signal0<void> DirtyChanged;
|
PBD::Signal0<void> DirtyChanged;
|
||||||
|
|
||||||
@ -583,8 +588,6 @@ public:
|
|||||||
PeakCleanup = 0x40
|
PeakCleanup = 0x40
|
||||||
};
|
};
|
||||||
|
|
||||||
StateOfTheState state_of_the_state() const { return _state_of_the_state; }
|
|
||||||
|
|
||||||
class StateProtector {
|
class StateProtector {
|
||||||
public:
|
public:
|
||||||
StateProtector (Session* s) : _session (s) {
|
StateProtector (Session* s) : _session (s) {
|
||||||
|
@ -152,7 +152,7 @@ AudioTrack::set_state (const XMLNode& node, int version)
|
|||||||
|
|
||||||
pending_state = const_cast<XMLNode*> (&node);
|
pending_state = const_cast<XMLNode*> (&node);
|
||||||
|
|
||||||
if (_session.state_of_the_state() & Session::Loading) {
|
if (_session.loading ()) {
|
||||||
_session.StateReady.connect_same_thread (*this, boost::bind (&AudioTrack::set_state_part_two, this));
|
_session.StateReady.connect_same_thread (*this, boost::bind (&AudioTrack::set_state_part_two, this));
|
||||||
} else {
|
} else {
|
||||||
set_state_part_two ();
|
set_state_part_two ();
|
||||||
|
@ -985,9 +985,7 @@ AudioEngine::stop (bool for_latency)
|
|||||||
_running = false;
|
_running = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_session && was_running_will_stop &&
|
if (_session && was_running_will_stop && !_session->loading() && !_session->deletion_in_progress()) {
|
||||||
(_session->state_of_the_state() & Session::Loading) == 0 &&
|
|
||||||
(_session->state_of_the_state() & Session::Deletion) == 0) {
|
|
||||||
// it's not a halt, but should be handled the same way:
|
// it's not a halt, but should be handled the same way:
|
||||||
// disable record, stop transport and I/O processign but save the data.
|
// disable record, stop transport and I/O processign but save the data.
|
||||||
_session->engine_halted ();
|
_session->engine_halted ();
|
||||||
|
@ -105,7 +105,7 @@ IO::~IO ()
|
|||||||
void
|
void
|
||||||
IO::disconnect_check (boost::shared_ptr<Port> a, boost::shared_ptr<Port> b)
|
IO::disconnect_check (boost::shared_ptr<Port> a, boost::shared_ptr<Port> b)
|
||||||
{
|
{
|
||||||
if (_session.state_of_the_state () & Session::Deletion) {
|
if (_session.deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* this could be called from within our own ::disconnect() method(s)
|
/* this could be called from within our own ::disconnect() method(s)
|
||||||
|
@ -184,7 +184,7 @@ MidiTrack::set_state (const XMLNode& node, int version)
|
|||||||
|
|
||||||
pending_state = const_cast<XMLNode*> (&node);
|
pending_state = const_cast<XMLNode*> (&node);
|
||||||
|
|
||||||
if (_session.state_of_the_state() & Session::Loading) {
|
if (_session.loading ()) {
|
||||||
_session.StateReady.connect_same_thread (
|
_session.StateReady.connect_same_thread (
|
||||||
*this, boost::bind (&MidiTrack::set_state_part_two, this));
|
*this, boost::bind (&MidiTrack::set_state_part_two, this));
|
||||||
} else {
|
} else {
|
||||||
|
@ -229,7 +229,7 @@ Session::Session (AudioEngine &eng,
|
|||||||
, _current_snapshot_name (snapshot_name)
|
, _current_snapshot_name (snapshot_name)
|
||||||
, state_tree (0)
|
, state_tree (0)
|
||||||
, state_was_pending (false)
|
, state_was_pending (false)
|
||||||
, _state_of_the_state (StateOfTheState(CannotSave|InitialConnecting|Loading))
|
, _state_of_the_state (StateOfTheState (CannotSave | InitialConnecting | Loading))
|
||||||
, _suspend_save (0)
|
, _suspend_save (0)
|
||||||
, _save_queued (false)
|
, _save_queued (false)
|
||||||
, _last_roll_location (0)
|
, _last_roll_location (0)
|
||||||
@ -434,8 +434,7 @@ Session::Session (AudioEngine &eng,
|
|||||||
store_recent_sessions (_name, _path);
|
store_recent_sessions (_name, _path);
|
||||||
|
|
||||||
bool was_dirty = dirty();
|
bool was_dirty = dirty();
|
||||||
|
unset_dirty ();
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
|
|
||||||
|
|
||||||
PresentationInfo::Change.connect_same_thread (*this, boost::bind (&Session::notify_presentation_info_change, this));
|
PresentationInfo::Change.connect_same_thread (*this, boost::bind (&Session::notify_presentation_info_change, this));
|
||||||
|
|
||||||
@ -641,7 +640,7 @@ Session::destroy ()
|
|||||||
|
|
||||||
Analyser::flush ();
|
Analyser::flush ();
|
||||||
|
|
||||||
_state_of_the_state = StateOfTheState (CannotSave|Deletion);
|
_state_of_the_state = StateOfTheState (CannotSave | Deletion);
|
||||||
|
|
||||||
{
|
{
|
||||||
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
|
Glib::Threads::Mutex::Lock lm (AudioEngine::instance()->process_lock ());
|
||||||
@ -1160,7 +1159,7 @@ Session::remove_monitor_section ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* allow deletion when session is unloaded */
|
/* allow deletion when session is unloaded */
|
||||||
if (!_engine.running() && !(_state_of_the_state & Deletion)) {
|
if (!_engine.running() && !deletion_in_progress ()) {
|
||||||
error << _("Cannot remove monitor section while the engine is offline.") << endmsg;
|
error << _("Cannot remove monitor section while the engine is offline.") << endmsg;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2307,7 +2306,7 @@ Session::resort_routes ()
|
|||||||
are being destroyed.
|
are being destroyed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (_state_of_the_state & (InitialConnecting | Deletion)) {
|
if (inital_connect_or_deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3820,7 +3819,7 @@ Session::remove_routes (boost::shared_ptr<RouteList> routes_to_remove)
|
|||||||
resort_routes ();
|
resort_routes ();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (_process_graph && !(_state_of_the_state & Deletion) && _engine.running()) {
|
if (_process_graph && !deletion_in_progress() && _engine.running()) {
|
||||||
_process_graph->clear_other_chain ();
|
_process_graph->clear_other_chain ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4630,7 +4629,7 @@ Session::playlist_region_added (boost::weak_ptr<Region> w)
|
|||||||
void
|
void
|
||||||
Session::maybe_update_session_range (samplepos_t a, samplepos_t b)
|
Session::maybe_update_session_range (samplepos_t a, samplepos_t b)
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & Loading) {
|
if (loading ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4815,7 +4814,7 @@ Session::add_source (boost::shared_ptr<Source> source)
|
|||||||
void
|
void
|
||||||
Session::remove_source (boost::weak_ptr<Source> src)
|
Session::remove_source (boost::weak_ptr<Source> src)
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & Deletion) {
|
if (deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4834,11 +4833,11 @@ Session::remove_source (boost::weak_ptr<Source> src)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(_state_of_the_state & StateOfTheState (InCleanup|Loading))) {
|
if (!in_cleanup () && !loading ()) {
|
||||||
|
|
||||||
/* save state so we don't end up with a session file
|
/* save state so we don't end up with a session file
|
||||||
referring to non-existent sources.
|
* referring to non-existent sources.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
save_state (_current_snapshot_name);
|
save_state (_current_snapshot_name);
|
||||||
}
|
}
|
||||||
@ -5341,7 +5340,7 @@ Session::add_playlist (boost::shared_ptr<Playlist> playlist, bool unused)
|
|||||||
void
|
void
|
||||||
Session::remove_playlist (boost::weak_ptr<Playlist> weak_playlist)
|
Session::remove_playlist (boost::weak_ptr<Playlist> weak_playlist)
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & Deletion) {
|
if (deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5660,7 +5659,7 @@ Session::graph_reordered ()
|
|||||||
from a set_state() call or creating new tracks. Ditto for deletion.
|
from a set_state() call or creating new tracks. Ditto for deletion.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((_state_of_the_state & (InitialConnecting|Deletion)) || _adding_routes_in_progress || _reconnecting_routes_in_progress || _route_deletion_in_progress) {
|
if (inital_connect_or_deletion_in_progress () || _adding_routes_in_progress || _reconnecting_routes_in_progress || _route_deletion_in_progress) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5953,7 +5952,9 @@ Session::unmark_aux_send_id (uint32_t id)
|
|||||||
void
|
void
|
||||||
Session::unmark_return_id (uint32_t id)
|
Session::unmark_return_id (uint32_t id)
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & Deletion) { return; }
|
if (deletion_in_progress ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (id < return_bitset.size()) {
|
if (id < return_bitset.size()) {
|
||||||
return_bitset[id] = false;
|
return_bitset[id] = false;
|
||||||
}
|
}
|
||||||
@ -5975,9 +5976,8 @@ Session::reset_native_file_format ()
|
|||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||||
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
/* don't save state as we do this, there's no point
|
/* don't save state as we do this, there's no point */
|
||||||
*/
|
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state|InCleanup);
|
|
||||||
tr->reset_write_sources (false);
|
tr->reset_write_sources (false);
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
|
||||||
}
|
}
|
||||||
@ -6874,7 +6874,7 @@ Session::update_latency (bool playback)
|
|||||||
{
|
{
|
||||||
DEBUG_TRACE (DEBUG::Latency, string_compose ("JACK latency callback: %1\n", (playback ? "PLAYBACK" : "CAPTURE")));
|
DEBUG_TRACE (DEBUG::Latency, string_compose ("JACK latency callback: %1\n", (playback ? "PLAYBACK" : "CAPTURE")));
|
||||||
|
|
||||||
if ((_state_of_the_state & (InitialConnecting|Deletion)) || _adding_routes_in_progress || _route_deletion_in_progress) {
|
if (inital_connect_or_deletion_in_progress () || _adding_routes_in_progress || _route_deletion_in_progress) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!_engine.running()) {
|
if (!_engine.running()) {
|
||||||
@ -6929,7 +6929,7 @@ Session::set_worst_io_latencies ()
|
|||||||
void
|
void
|
||||||
Session::set_worst_output_latency ()
|
Session::set_worst_output_latency ()
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & (InitialConnecting|Deletion)) {
|
if (inital_connect_or_deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6953,7 +6953,7 @@ Session::set_worst_output_latency ()
|
|||||||
void
|
void
|
||||||
Session::set_worst_input_latency ()
|
Session::set_worst_input_latency ()
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & (InitialConnecting|Deletion)) {
|
if (inital_connect_or_deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6975,7 +6975,7 @@ Session::set_worst_input_latency ()
|
|||||||
void
|
void
|
||||||
Session::update_latency_compensation (bool force_whole_graph)
|
Session::update_latency_compensation (bool force_whole_graph)
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & (InitialConnecting|Deletion)) {
|
if (inital_connect_or_deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* this lock is not usually contended, but under certain conditions,
|
/* this lock is not usually contended, but under certain conditions,
|
||||||
|
@ -843,9 +843,9 @@ Session::maybe_sync_start (pframes_t & nframes)
|
|||||||
void
|
void
|
||||||
Session::queue_event (SessionEvent* ev)
|
Session::queue_event (SessionEvent* ev)
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & Deletion) {
|
if (deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
} else if (_state_of_the_state & Loading) {
|
} else if (loading ()) {
|
||||||
merge_event (ev);
|
merge_event (ev);
|
||||||
} else {
|
} else {
|
||||||
Glib::Threads::Mutex::Lock lm (rb_write_lock);
|
Glib::Threads::Mutex::Lock lm (rb_write_lock);
|
||||||
|
@ -364,7 +364,7 @@ Session::post_engine_init ()
|
|||||||
auto_connect_master_bus ();
|
auto_connect_master_bus ();
|
||||||
}
|
}
|
||||||
|
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~(CannotSave|Dirty));
|
_state_of_the_state = StateOfTheState (_state_of_the_state & ~(CannotSave | Dirty));
|
||||||
|
|
||||||
/* update latencies */
|
/* update latencies */
|
||||||
|
|
||||||
@ -784,7 +784,7 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
|
|||||||
lx.acquire ();
|
lx.acquire ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_writable || (_state_of_the_state & CannotSave)) {
|
if (!_writable || cannot_save()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -920,13 +920,7 @@ Session::save_state (string snapshot_name, bool pending, bool switch_to_snapshot
|
|||||||
save_history (snapshot_name);
|
save_history (snapshot_name);
|
||||||
|
|
||||||
if (mark_as_clean) {
|
if (mark_as_clean) {
|
||||||
bool was_dirty = dirty();
|
unset_dirty (/* EMIT SIGNAL */ true);
|
||||||
|
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
|
|
||||||
|
|
||||||
if (was_dirty) {
|
|
||||||
DirtyChanged (); /* EMIT SIGNAL */
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StateSaved (snapshot_name); /* EMIT SIGNAL */
|
StateSaved (snapshot_name); /* EMIT SIGNAL */
|
||||||
@ -1445,7 +1439,7 @@ Session::state (bool save_template, snapshot_t snapshot_type, bool only_used_ass
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!was_dirty) {
|
if (!was_dirty) {
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
|
unset_dirty ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1544,7 +1538,7 @@ Session::set_state (const XMLNode& node, int version)
|
|||||||
XMLNode* child;
|
XMLNode* child;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state|CannotSave);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | CannotSave);
|
||||||
|
|
||||||
if (node.name() != X_("Session")) {
|
if (node.name() != X_("Session")) {
|
||||||
fatal << _("programming error: Session: incorrect XML node sent to set_state()") << endmsg;
|
fatal << _("programming error: Session: incorrect XML node sent to set_state()") << endmsg;
|
||||||
@ -2320,7 +2314,7 @@ Session::reset_write_sources (bool mark_write_complete, bool force)
|
|||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||||
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
boost::shared_ptr<Track> tr = boost::dynamic_pointer_cast<Track> (*i);
|
||||||
if (tr) {
|
if (tr) {
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state|InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
||||||
tr->reset_write_sources(mark_write_complete, force);
|
tr->reset_write_sources(mark_write_complete, force);
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
|
||||||
}
|
}
|
||||||
@ -2488,7 +2482,7 @@ Session::XMLSourceFactory (const XMLNode& node)
|
|||||||
int
|
int
|
||||||
Session::save_template (const string& template_name, const string& description, bool replace_existing)
|
Session::save_template (const string& template_name, const string& description, bool replace_existing)
|
||||||
{
|
{
|
||||||
if ((_state_of_the_state & CannotSave) || template_name.empty ()) {
|
if (cannot_save () || template_name.empty ()) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3293,7 +3287,7 @@ Session::can_cleanup_peakfiles () const
|
|||||||
if (deletion_in_progress()) {
|
if (deletion_in_progress()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!_writable || (_state_of_the_state & CannotSave)) {
|
if (!_writable || cannot_save ()) {
|
||||||
warning << _("Cannot cleanup peak-files for read-only session.") << endmsg;
|
warning << _("Cannot cleanup peak-files for read-only session.") << endmsg;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -3366,7 +3360,7 @@ Session::cleanup_sources (CleanupReport& rep)
|
|||||||
Searchpath msp;
|
Searchpath msp;
|
||||||
set<boost::shared_ptr<Source> > sources_used_by_this_snapshot;
|
set<boost::shared_ptr<Source> > sources_used_by_this_snapshot;
|
||||||
|
|
||||||
_state_of_the_state = (StateOfTheState) (_state_of_the_state | InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
||||||
|
|
||||||
/* this is mostly for windows which doesn't allow file
|
/* this is mostly for windows which doesn't allow file
|
||||||
* renaming if the file is in use. But we don't special
|
* renaming if the file is in use. But we don't special
|
||||||
@ -3650,7 +3644,7 @@ Session::cleanup_sources (CleanupReport& rep)
|
|||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
_state_of_the_state = (StateOfTheState) (_state_of_the_state & ~InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -3685,7 +3679,7 @@ Session::set_dirty ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* never mark session dirty during loading */
|
/* never mark session dirty during loading */
|
||||||
if (_state_of_the_state & (Loading | Deletion)) {
|
if (loading () || deletion_in_progress ()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3705,6 +3699,18 @@ Session::set_clean ()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Session::unset_dirty (bool emit_dirty_changed)
|
||||||
|
{
|
||||||
|
bool was_dirty = dirty();
|
||||||
|
|
||||||
|
_state_of_the_state = StateOfTheState (_state_of_the_state & (~Dirty));
|
||||||
|
|
||||||
|
if (was_dirty && emit_dirty_changed) {
|
||||||
|
DirtyChanged (); /* EMIT SIGNAL */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Session::set_deletion_in_progress ()
|
Session::set_deletion_in_progress ()
|
||||||
{
|
{
|
||||||
@ -3735,7 +3741,7 @@ struct null_deleter { void operator()(void const *) const {} };
|
|||||||
void
|
void
|
||||||
Session::remove_controllable (Controllable* c)
|
Session::remove_controllable (Controllable* c)
|
||||||
{
|
{
|
||||||
if (_state_of_the_state & Deletion) {
|
if (deletion_in_progress()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4274,7 +4280,7 @@ Session::rename (const std::string& new_name)
|
|||||||
|
|
||||||
string const old_sources_root = _session_dir->sources_root();
|
string const old_sources_root = _session_dir->sources_root();
|
||||||
|
|
||||||
if (!_writable || (_state_of_the_state & CannotSave)) {
|
if (!_writable || cannot_save ()) {
|
||||||
error << _("Cannot rename read-only session.") << endmsg;
|
error << _("Cannot rename read-only session.") << endmsg;
|
||||||
return 0; // don't show "messed up" warning
|
return 0; // don't show "messed up" warning
|
||||||
}
|
}
|
||||||
@ -5125,7 +5131,7 @@ Session::save_as (SaveAs& saveas)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (!saveas.include_media) {
|
if (!saveas.include_media) {
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state & ~Dirty);
|
unset_dirty ();
|
||||||
}
|
}
|
||||||
|
|
||||||
save_state ("", false, false, !saveas.include_media);
|
save_state ("", false, false, !saveas.include_media);
|
||||||
|
@ -1533,7 +1533,7 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished)
|
|||||||
if (abort && did_record) {
|
if (abort && did_record) {
|
||||||
/* no reason to save the session file when we remove sources
|
/* no reason to save the session file when we remove sources
|
||||||
*/
|
*/
|
||||||
_state_of_the_state = StateOfTheState (_state_of_the_state|InCleanup);
|
_state_of_the_state = StateOfTheState (_state_of_the_state | InCleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
for (RouteList::iterator i = rl->begin(); i != rl->end(); ++i) {
|
||||||
|
Loading…
Reference in New Issue
Block a user