summaryrefslogtreecommitdiff
path: root/libs/ardour/session.cc
AgeCommit message (Collapse)Author
2020-04-18Consistent Lua script error and print() output 1/2Robin Gareus
2020-04-12Fix loop range changes while playing - #8001Robin Gareus
Since ead883302fe800ae, it is no longer possible to use a null pointer SessionEvent::track as flag to indicate overriding all buffers.
2020-04-07Add option to reset x-run count on record-startRobin Gareus
2020-04-07API change: LatencyUpdated(), indicate playback/captureRobin Gareus
2020-04-05Fix crash when adding tracks from a5 route templatesJohannes Mueller
Ardour5 route templates seem not to have a in the root node playlist property. Ardour generally relies on that Track::playlist() always returns a valid playlist. Thus we need to create a playlist even if we don't have a playlist property in the route template's root node.
2020-04-03Allow to disable input auto-connect when creating tracksRobin Gareus
Auto-connect is handled in a background thread, so newly created tracks are not immediately connected. This causes a race-condition when fan-out directly disconnects and re-connects ports after track/bus creation.
2020-04-02Revert "move the point of adding a new MIDI track until *after* the ↵Robin Gareus
instrument is added" This reverts commit fac8d84786f420f91b68ce2e444579ea2162cb8d. This fixes fan-out. The track should be created before any tracks or busses are created that are fed by the MIDI track. The apparent motivation for fac8d847 was MIDNAM related (there was code in the GUI that needed the instrument, which was called from within ::add_routes). This should no longer be the case, the GUI needs to pick up instrument changes after track creation via processors changed; besides MIDI busses were still created before the instrument.
2020-04-02Re-save templates if they have been loaded from an older version of ArdourJohannes Mueller
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-29Set thread-names (libs)Robin Gareus
2020-03-24introduce the idea of an "unnamed" sessionPaul Davis
2020-03-23fix error in multiple calls to SourceFactory::createWritable()Paul Davis
removal of tape tracks removed an intermediate argument in the argument list; presence of default args for the last two arguments and implicit conversion from int->bool prevented the compiler from complaining about any existing calls. This supplements/extends a54b000a70
2020-03-23add in timing for disk buffer reload after locate, to replace hard-coded ↵Paul Davis
0.05 seconds per track Leave debug output in place for now to get some numbers from any testers
2020-03-17provide mechanism to report on destructive tracks presence in a sessionPaul Davis
2020-03-17remove destructive/tape mode tracksPaul Davis
2020-03-06Fix export alignment (#7916)Robin Gareus
Ardour's playback is aligned to master-out: "When the playback clock reads 01:00:00:00, the sample corresponding to 01:00:00:00 is audible at the speaker(s)" When exporting, and grabbing data from output ports, the signal is offset by the master-bus physical playback latency. This was compensated for, but lead to initial silence in the exported file. New approach is to start capturing export data during pre-roll, at the time when playback is written to the output buffers. To also shaves off a common offset to make this work with realtime export. Effectively this emulates processing with disconnected master-output port, while still keeping any latency of effects on the master-bus itself. Last but not least: jack updates latencies when freewheeling, (setting HW latency to zero). The callback arrives asynchronously some time after enabling freewheeling, but after Export Ports have been configured. Those callbacks are ignored.
2020-02-27Add signals to indicate Punch/Loop constraintsRobin Gareus
This is in preparation for GUI sensitivity of Loop and Punch actions.
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-26Consolidate loop en/disable callsRobin Gareus
2020-02-26Fix Conditional jump or move depends on uninitialised value(s)Robin Gareus
(valgrind trace, line-numbers from mixbus+6.0-190-g0ec6bc35a) This may happen initially for unconnected graph nodes, e.g. Foldback Busses from ARDOUR::Session::post_engine_init(). ==29797== Conditional jump or move depends on uninitialised value(s) ==29797== at 0x6167D3F: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174) ==29797== by 0x6167D99: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174) ==29797== by 0x6167D99: trace_terminal(boost::shared_ptr<ARDOUR::Route>, boost::shared_ptr<ARDOUR::Route>, bool) (session.cc:2174) ==29797== by 0x616890D: ARDOUR::Session::resort_routes_using(boost::shared_ptr<std::__cxx11::list<boost::shared_ptr<ARDOUR::Route>, std::allocator<boost::shared_ptr<ARDOUR::Route> > > >) (session.cc:2289)
2020-02-26Fix potential memory corruption at session closeRobin Gareus
(valgrind trace, line-numbers from mixbus+6.0-190-g0ec6bc35a) ==29797== Invalid write of size 4 ==29797== at 0x619BB3F: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::do_reset() (dynamic_bitset.hpp:120) ==29797== by 0x6196002: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::do_assign(bool) (dynamic_bitset.hpp:122) ==29797== by 0x618F670: boost::dynamic_bitset<unsigned int, std::allocator<unsigned int> >::reference::operator=(bool) (dynamic_bitset.hpp:107) ==29797== by 0x617E426: ARDOUR::Session::unmark_send_id(unsigned int) (session.cc:5633) ==29797== by 0x6156714: ARDOUR::Send::~Send() (send.cc:125) ==29797== by 0x5CE12A7: ARDOUR::InternalSend::~InternalSend() (internal_send.cc:71) ==29797== by 0x5CE1319: ARDOUR::InternalSend::~InternalSend() (internal_send.cc:76) ==29797== by 0x1556128: void boost::checked_delete<ARDOUR::InternalSend>(ARDOUR::InternalSend*) (checked_delete.hpp:34) ==29797== by 0x155E689: boost::detail::sp_counted_impl_p<ARDOUR::InternalSend>::dispose() (sp_counted_impl.hpp:92) ==29797== by 0xCC0E30: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110) ==29797== by 0xCC0EA6: boost::detail::shared_count::~shared_count() (shared_count.hpp:426) ==29797== by 0x134BD15: boost::shared_ptr<ARDOUR::InternalSend>::~shared_ptr() (shared_ptr.hpp:366) ==29797== by 0x60FACC1: ARDOUR::Route::~Route() (route.cc:498) ==29797== by 0x60FAF4D: ARDOUR::Route::~Route() (route.cc:517) ==29797== by 0x166144C: void boost::checked_delete<ARDOUR::Route>(ARDOUR::Route*) (checked_delete.hpp:34) ==29797== by 0x166338F: boost::detail::sp_counted_impl_p<ARDOUR::Route>::dispose() (sp_counted_impl.hpp:92) ==29797== by 0xCC0E30: boost::detail::sp_counted_base::release() (sp_counted_base_std_atomic.hpp:110) ==29797== by 0xCC0EA6: boost::detail::shared_count::~shared_count() (shared_count.hpp:426) ==29797== by 0xCD2385: boost::shared_ptr<ARDOUR::Route>::~shared_ptr() (shared_ptr.hpp:366) ==29797== by 0x615D0E5: ARDOUR::Session::~Session() (session.cc:455) ==29797== by 0x615D4A3: ARDOUR::Session::~Session() (session.cc:461)
2020-02-25Prefer const iteratorsRobin Gareus
2020-02-20change transport API, session API, transportFSM API to move reverse ↵Paul Davis
management and motion state (partially) into TFSM
2020-02-18Replace missing .mid files with silenceRobin Gareus
This fixes a crash: missing playlist due to missing .mid, and retains regions for missing MIDI files. As opposed to missing Audio, we cannot use a SilentFileSource, because MIDI files are destructive. This also adds an API to query missing files that have been replaced with silence to report them to the user.
2020-02-11move the point of adding a new MIDI track until *after* the instrument is addedPaul Davis
This seems ripe with all kinds of subtle breakage potential. Sigh.
2020-02-03Initialize uninitialized variable (Session StateProtector)Robin Gareus
2020-01-30Cont'd work on loading old route templatesRobin Gareus
This builds on top of 51d2bb: * v6 routes templates/states have a version per <Route> * older route-states are assumed to be from ardour-5 Stateful::loading_state_version 3002, unless specified otherwise
2020-01-29Reduce overhead of Lua session-scriptsRobin Gareus
2020-01-26Fix the ability to set Session Start&End Range on a new, empty sessionBen Loftis
set_session_extents had a bug; it wasn't calling locations->add() on the newly created location. The correct implementation was in set_session_range_location, but this was only called from one place. This function was removed, and set_session_extents will be used in its place. set_session_extents will create a session location if one no longer exists, so there is no need for set_session_range_location.
2020-01-18rename DoTheRightThing to RollIfAppropriatePaul Davis
2020-01-18Session::request_locate() takes a tri-valued second argument for ↵Paul Davis
"roll-after-locate" This allows callers to defer logic about auto-play/current rolling state and more to TransportFSM where it can be cnentralized and is less ambiguous
2020-01-05remove the (unused) concept of a MIDI patchfile folder per sessionPaul Davis
2019-12-27remove unused memberPaul Davis
Note: there is no global state for "the" transport master, since we have several at all times now
2019-12-25Use weak-ptr for source added/removed signals (1/2)Robin Gareus
This might fix a "SessionHandleRef exists across session deletion", when the shared_ptr was be pushed onto a x-thread pool, and not invalidated in time before the session was closed.
2019-12-25Prevent copy-construction of sources to be destroyed listRobin Gareus
destroy_sources () is only called from Session::remove_last_capture (). The list of sources to be destroyed is the local scope of that method and will hold a reference to the object. copy-construct the list and removing elements one by one from the copy is only unnecessary overhead.
2019-12-16reinstate missing latency initialization codePaul Davis
Removed (mistakenly) during work on transportFSM
2019-12-16expand DEBUG_TRACE outputPaul Davis
2019-12-11Remove hardcoded session-state versionsRobin Gareus
2019-12-10revert to single buffer for disk playback, and 5.x-style overwritePaul Davis
Also address issues with MIDI and also atomicity of _pending_overwrite
2019-12-08avoid a locate-to-loop-start from cancelling loopingPaul Davis
2019-12-05changes to use overwrite-buffers when loop is disabled or loop range changedPaul Davis
2019-11-23fix startup crash if no loop range is definedPaul Davis
2019-11-23more tweaks to correctly (or more correctly) reload disk reader buffers when ↵Paul Davis
loop fade choice changes
2019-11-22redesign of declicking and fades around loop boundariesPaul Davis
2019-11-15improve initial coordinate with JACK transport statePaul Davis
2019-11-02comment updatePaul Davis
2019-11-01fix the way Session::auto_loop_changed() works to put back various things ↵Paul Davis
removed since 5.x
2019-11-01remove seamless looping as an option (it's now the only kind of looping we ↵Paul Davis
support)
2019-10-28improve debug outputPaul 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