summaryrefslogtreecommitdiff
path: root/libs/ardour/session_state.cc
AgeCommit message (Collapse)Author
2020-05-19There is no need to save after region cleanupRobin Gareus
2020-05-19Don't save the session when creating bussesRobin Gareus
Most calls to new_audio_route() used save = false, only directly creating busses saved the session. Probably for historical reasons.
2020-05-19NO-OP: replace `save_state("")` with `save_state()`Robin Gareus
2020-05-07Change LTC Generator from IO to PortRobin Gareus
This is done in order to set the TransportGenerator flag
2020-04-18Consistent Lua script error and print() output 1/2Robin Gareus
2020-04-17Fix two more typosRobin Gareus
2020-04-02Don't issue VersionMismatch when creating a new sessionJohannes Mueller
When we create a new session and are using a template from an old version of Ardour, we should not issue the VersionMismatch dialog and not make a copy of the session file for the old version. We need to extend the signature of Session::load_state() to tell it if we are creating a session from a template. Session::_is_new cannot be used for it because it has a the semantics if to auto connect the the master bus.
2020-03-25if user chooses not to delete a scratch session, removed the file that ↵Paul Davis
identifies it as unnamed This way they will not be asked again if they reload and then quit the session
2020-03-24when saving an unnamed session, rename itPaul Davis
Note that this is done at the GUI level, might need to double check if there are other paths into a "save" that should be covered. Control surfaces use the action, but Lua comes to mind
2020-03-24a better approach to the name of the "unnamed" indicator file; remove file ↵Paul Davis
after successful save
2020-03-24introduce the idea of an "unnamed" sessionPaul Davis
2020-03-21NO-OP: remove unused #includesRobin Gareus
2020-03-17remove destructive/tape mode tracksPaul Davis
2020-03-15Fix cleanup report #7891Robin Gareus
Direct call to Session::cleanup_sources() from ARDOUR_UI::cleanup() didn't zero initialize size. This centralizes initialization, so cleanup_trash_sources() does not need to explicitly clear it.
2020-03-15Add/use default argument for track creationRobin Gareus
2020-03-15Fix loading playlists of old sessionsRobin Gareus
Previously when loading Ardour v2, v3-5 sessions, tracks were created with a dummy name "toBeResetFroXML". In v6, Track::init() creates a playlist when the track name is not empty. Later Track::set_state() calls set_name(). When a playlist exists, the playlist's name is set to match the track's name. When loading v6 sessions none of this happens. A previously loaded playlist will be assigned by ID. Older versions identified Playlists by name and by the time the playlist is assigned, there may be ambiguities. With the default (track-name = playlist-name) two playlists with the same name exist: (1) the playlist loaded from the session file (2) the playlist created by Track::init() Playlists are stored in an ordered std::set<shared_ptr<Playlist>>, and name-lookup iterates over the set. When loading an old session after starting Ardour, it is very likely to always lookup the playlist (1), because new, later allocations from (2) are on top of the heap and ordered last. The session seemingly loads correctly, except for lingering, unused empty playlists "toBeResetFroXML" renamed to "Track name" that were never deleted. However when loading an old session from a running instance, ordering is mostly random, and many tracks end up with using the empty playlist (2) instead of the correct playlist (1).
2020-02-28Ensure that regions have sources when savingRobin Gareus
Otherwise this will lead to a corrupt state: ERROR: Session: XMLNode describing a AudioRegion references an unknown source id ERROR: Session: cannot create Region from XML description. Can not load state for region ERROR: Playlist: cannot create region from XML and a track without playlist is created, resulting in a later crash. Eventually SessionPlaylists::load() needs to handle this gracefully, but this should help catch cases causing the actual issue.
2020-02-27Prevent concurrent loop and punch recording (backend)Robin Gareus
This also prevents switching between punch-in/out record and looping without transport-stop.
2020-02-25Fix cleanup, lock source-list, emit SourceRemovedRobin Gareus
This fixes various cases where SessionHandleRef shared_ptr<> were kept when sources were removed.
2020-02-25Remove history file when it's emptyRobin Gareus
Various operations clear the history (e.g. cleanup). In that case the GUI correctly had an empty Undo/Redo history, but the file on disk was left in place. Next session load restored the old, incorrect Undo/Redo history.
2020-02-25Prefer const iteratorsRobin Gareus
2020-02-24Zero x-run count after session-load and engine restartRobin Gareus
2020-02-24Consolidate startup `state = Clean;` callsRobin Gareus
This also emits DirtyChanged() only if needed.
2020-02-14Fix potential deadlock (session-template with latent procs)Robin Gareus
2020-01-30Fix assert() when removing track(s)Robin Gareus
ARDOUR::Session::remove_routes() explicitly calls save_state (_current_snapshot_name) Update assert() to treat an empty name equivalently as explicitly specified _current_snapshot_name
2020-01-30Fix recursive locks during undo/redo due to state saveRobin Gareus
undo may restore locations, which may trigger a state-save. This can result in a deadlock: Location::set_state () -> Locations::get_state() both acquire a the same lock: #2 0x000055a8421836d0 in Glib::Threads::Mutex::Lock::Lock(Glib::Threads::Mutex&) (this=0x7ffe38dcad40, mutex=...) at /usr/include/glibmm-2.4/glibmm/threads.h:687 #3 0x00007fc637731e9c in ARDOUR::Locations::get_state() (this=0x55a8466d4740) at ../libs/ardour/location.cc:1075 #4 0x00007fc637bf14b7 in ARDOUR::Session::state(bool, ARDOUR::Session::snapshot_t, bool) (this=0x55a846d0f050, save_template=false, snapshot_type=ARDOUR::Session::NormalSave, only_used_assets=false) at ../libs/ardour/session_state.cc:1406 #5 0x00007fc637bed2c8 in ARDOUR::Session::save_state(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, bool, bool, bool, bool) (this=0x55a846d0f050, snapshot_name="", pending=true, switch_to_snapshot=false, template_only=false, for_archive=false, only_used_assets=false) at ../libs/ardour/session_state.cc:815 #6 0x00007fc637b4d967 in ARDOUR::Session::auto_punch_start_changed(ARDOUR::Location*) (this=0x55a846d0f050, location=0x55a848fe11d0) at ../libs/ardour/session.cc:1395 #7 0x00007fc637b4da21 in ARDOUR::Session::auto_punch_end_changed(ARDOUR::Location*) (this=0x7fc637b4da21 <ARDOUR::Session::auto_punch_end_changed(ARDOUR::Location*)+67>, location=0x7ffe38dcbf10) at ../libs/ardour/session.cc:1403 [..] #14 0x00007fc637730a2a in ARDOUR::Location::set_state(XMLNode const&, int) (this=0x55a848fe11d0, node=..., version=6000) at ../libs/ardour/location.cc:715 #15 0x00007fc637732428 in ARDOUR::Locations::set_state(XMLNode const&, int) (this=0x55a8466d4740, node=..., version=6000) at ../libs/ardour/location.cc:1130 #16 0x000055a842388dd7 in MementoCommand<ARDOUR::Locations>::undo() (this=0x55a84d1e5f10) at ../libs/pbd/pbd/memento_command.h:141 #17 0x00007fc635b50707 in UndoTransaction::undo() (this=0x55a84d513b80) at ../libs/pbd/undo.cc:128 #18 0x00007fc635b50e1c in UndoHistory::undo(unsigned int) (this=0x55a846d11338, n=0) at ../libs/pbd/undo.cc:267 #19 0x00007fc637c0dfff in ARDOUR::Session::undo(unsigned int) (this=0x55a846d0f050, n=1) at ../libs/ardour/session_state.cc:5577
2020-01-30Allow StateProtector to save pending filesRobin Gareus
This is in preparation for saving state while the session is record-arm'ed. Most notably config changes and undo/redo. In case both normal and pending save happens, pending must be last and is required to recover from crashes during recording.
2020-01-30Add some sanity checks for Session::save parametersRobin Gareus
2020-01-20fix API and use of Session::force_locate()Paul Davis
Because of the addition of LocateTransportDisposition, this call was unconditionally forcing a roll during startup
2020-01-11Fix AFL positionRobin Gareus
* update AFL position when preference changes * "after post-fader processors (before pan)" is before the main-out (not at the end). * Fix "immediately post-fader": The amp, when added was the last element. ++after_end then made the iterator point to .end() This likely worked in the past when the monitor send was added immediately after adding the fader/amp before any other processors.
2020-01-05move MidiPatchManager initialization into ARDOUR "global" scope, rather than ↵Paul Davis
per session
2019-12-23basics of threaded MIDNAM loadingPaul Davis
2019-12-17Cont'd work on Playlists import from old 2.x sessionsRobin Gareus
v2.0.0 sessions don't save empty playlists. So missing playlists for a give diskstream are fine. Just use a default empty one.
2019-12-17Convert Disksteam & Playlists from old 2.x sessionsRobin Gareus
2019-12-16reinstate missing latency initialization codePaul Davis
Removed (mistakenly) during work on transportFSM
2019-12-16Parse v2 session-informationRobin Gareus
2019-11-23remove debug outputPaul Davis
2019-11-23more tweaks to correctly (or more correctly) reload disk reader buffers when ↵Paul Davis
loop fade choice changes
2019-11-21Use new boost::optional APIRobin Gareus
get_value_or() has been deprecated since boost 1.56
2019-11-15improve initial coordinate with JACK transport statePaul Davis
2019-11-02rename all Evoral source from .(hpp|cpp)$ to .(h|cc)Paul Davis
2019-10-28fix thinkoPaul Davis
2019-10-28provide a mechanism to decide if Session::update_latency_compensation() is ↵Paul Davis
being called as part of a callback from the backend. If it is, do not call AudioEngine::update_latencies() to avoid JACK1-style deadlock
2019-10-26Fix latency compensation race-conditionRobin Gareus
Remove need for explicit `initialize_latencies` call that used to be called from GUI-thread post_engine_init(), as well as Session::engine_running(). Further reduce calls, `graph_reordered` implies a latency-update and fix ordering issue. update_latency_compensation() must be called *after* resort_routes().
2019-10-10make BusProfile argument to new Session constructor be const (and in ↵Paul Davis
associated call tree)
2019-09-25goodbye Profile->...trxPaul Davis
2019-09-18don't bother following playhead priority during session loadingPaul Davis
2019-09-18NO-OP: fix some Wimplicit-fallthroughRobin Gareus
gcc can recognize various regexps in comments. Since C++17 provides [[fallthrough]], using /* fallthrough */ consistently seems appropriate until we switch to C++17. see also https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2019-09-17add finite state machine to control/manage transport statePaul Davis
2019-09-16Clarify splash-screen boot messagesRobin Gareus
Parsing MIDNAM is what takes the most time. "Reset Remote Controls" message is misleading (it means MMC), not control-surfaces, which a user may have none.