[Summary] Fixed several issues which made session dirty when it's just loaded or created from scratch

This commit is contained in:
GZharun 2015-01-20 16:25:26 +02:00
parent b76231f0de
commit c25e35f2d4
5 changed files with 34 additions and 18 deletions

View file

@ -3042,6 +3042,8 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
*/
ARDOUR_COMMAND_LINE::session_name = "";
return ret;
}
}
@ -3165,10 +3167,6 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
goto_editor_window ();
if (_session) {
_session->set_clean ();
}
#ifdef WINDOWS_VST_SUPPORT
fst_stop_threading();
#endif
@ -3176,6 +3174,11 @@ ARDOUR_UI::load_session (const std::string& path, const std::string& snap_name,
#ifdef WINDOWS_VST_SUPPORT
fst_start_threading();
#endif
if (_session) {
_session->set_clean ();
}
retval = 0;
out:

View file

@ -395,6 +395,7 @@ void
ARDOUR_UI::toggle_meterbridge ()
{
show_meterbridge_view ();
set_session_dirty ();
}
void
@ -423,8 +424,6 @@ ARDOUR_UI::show_meterbridge_view ()
editor->get_container ("edit_pane").show ();
editor->get_container ("compact_meter_bridge_home").show ();
}
set_session_dirty ();
}
void

View file

@ -1260,6 +1260,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
int immediately_post_engine ();
void remove_empty_sounds ();
void session_loaded ();
void setup_midi_control ();
int midi_read (MIDI::Port *);

View file

@ -430,7 +430,7 @@ Session::Session (AudioEngine &eng,
_is_new = false;
SessionLoaded();
session_loaded ();
BootMessage (_("Session loading complete"));
}

View file

@ -344,23 +344,31 @@ Session::post_engine_init ()
ltc_tx_initialize();
/* initial program change will be delivered later; see ::config_changed() */
_state_of_the_state = Clean;
Port::set_connecting_blocked (false);
DirtyChanged (); /* EMIT SIGNAL */
if (_is_new) {
save_state ("");
} else if (state_was_pending) {
save_state ("");
remove_pending_capture_state ();
state_was_pending = false;
}
return 0;
}
void
Session::session_loaded ()
{
SessionLoaded();
_state_of_the_state = Clean;
DirtyChanged (); /* EMIT SIGNAL */
if (_is_new) {
save_state ("");
} else if (state_was_pending) {
save_state ("");
remove_pending_capture_state ();
state_was_pending = false;
}
}
string
Session::raid_path () const
{
@ -2995,6 +3003,10 @@ Session::set_dirty ()
if (_state_of_the_state & Loading) {
return;
}
if (_state_of_the_state & Deletion) {
return;
}
bool was_dirty = dirty();