Commit graph

15463 commits

Author SHA1 Message Date
Robin Gareus
788d77fe5c
Initialize uninitialized variable (Session StateProtector) 2020-02-03 17:29:48 +01:00
Robin Gareus
d14d396967
Lua bindings for locations and locate disposition 2020-01-31 01:45:07 +01:00
Robin Gareus
d887f5965a
Fix assert() when removing track(s)
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-30 21:08:02 +01:00
Robin Gareus
cfea85b496
Use session-version when loading processor state
Stateful::loading_state_version vs.
Stateful::current_state_version

See also 0a5837ec71
2020-01-30 18:52:32 +01:00
Robin Gareus
6069c870f8
Fix recursive locks during undo/redo due to state save
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-30 04:16:19 +01:00
Robin Gareus
0d127813fb
Allow StateProtector to save pending files
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-30 04:12:19 +01:00
Robin Gareus
998fadda57
Add some sanity checks for Session::save parameters 2020-01-30 04:09:48 +01:00
Robin Gareus
6452f62d64
Cont'd work on loading old route templates
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-30 01:08:57 +01:00
Robin Gareus
51d2bb36ce
Save/Use state-version with route templates
Currently using Ardour-5 route templates (state version "3002")
with Ardour6 fails. As opposed to session-templates, Route
templates were not versioned.

This ensures future compatibility (and may allow to interpret
unversioned templates as "3002")
2020-01-29 23:20:37 +01:00
Nikolaus Gullotta
39dac5b20f Fix tests failing to build by adding LIB_FFTW3F 2020-01-29 10:12:04 -06:00
Robin Gareus
2731d494c2
Reduce overhead of Lua session-scripts 2020-01-29 16:51:14 +01:00
Robin Gareus
0ab46c342f
Fix MIDI loop capture alignment
Loop recording creates a single long source, regions have to be
"split" from this source, using "start" as offset.

Since MIDI uses absolute timestamps, offsetting this by accumulating
 buffer_position += (*ci)->samples;
like Track::use_captured_audio_sources() does, is not correct.

Furthermore, record_enabled() may be off when stopping recording,
MIDI needs to be flushed regardless.
2020-01-29 16:25:33 +01:00
Robin Gareus
ffe7fcd3b0
Allow to dis/engage rec-arm while looping 2020-01-29 05:35:36 +01:00
Robin Gareus
6bc4f69c5c
Fix loop recording alignment
DiskWriter::transport_looped() is called from the session
when engine loops. This does not take local disk-reader run()
latency offset into account.

finish_capture() needs to be postponed until the disk-writer
itself reaches the loop-position. This is achieved by
postponing loop() and calling it once loop-length of samples
has been captured.

This works because engaging loop always seeks to the loop-position
and first loop resets _capture_captured.
2020-01-29 01:32:06 +01:00
Robin Gareus
cb01a910d7
Micro optimization: query PI flags once
This also removes a Mixbus special case, explicit ->mixbus() tests
are no longer required.
2020-01-28 21:27:43 +01:00
Paul Davis
6b0a3cfffe fix previous commit, and another instance of the same (incorrect constructor) issue 2020-01-28 13:04:39 -07:00
Paul Davis
a5dbac0a9c fix assert-crash caused by not constructing a StopTransport event correctly 2020-01-28 12:54:04 -07:00
Paul Davis
5d99526406 correct location of resolved note-offs after region is rendered 2020-01-27 22:17:07 -07:00
Robin Gareus
8e5e902b5c
Fix sending MMC Start/Stop messages
Ardour 5.x slave check was incorrectly ported to A6's TMM:
In Ardour 5 the comparison tested for *not* MTC:
```
  if (!dynamic_cast<MTC_Slave*>(_slave)) { ..send MMC.. }
```

Other MMC messages (Record, Locate) are sent unconditionally.
2020-01-27 21:49:53 +01:00
Robin Gareus
44440f9316
Add new requirements from AudioEngine::stop to ::drop_backend
This fixes an issue that after changing backends (::set_backend),
the session-transport was in inconsistent state. If it was rolling,
it continued to roll with "stop" being unavailable.
2020-01-27 20:26:06 +01:00
Robin Gareus
5c789547cb
Fix building unit-tests 2020-01-27 17:43:37 +01:00
Robin Gareus
f101a657f2
Fix two more clang static analysis warnings 2020-01-27 17:42:28 +01:00
Robin Gareus
f9cc630b10
Delete out-of-bounds metronome clicks 2020-01-27 03:35:28 +01:00
Robin Gareus
fc7dd5115d
Fix some clang-scan warnings 2020-01-27 03:31:49 +01:00
Ben Loftis
2d07e72d40
Fix the ability to set Session Start&End Range on a new, empty session
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-26 19:33:41 +01:00
Robin Gareus
db465b5b43
Fix Loop-length (no pre-roll on loop-iterations) 2020-01-26 05:15:24 +01:00
Paul Davis
83e4b9f7eb remove debug output 2020-01-25 14:25:30 -07:00
Robin Gareus
3b65b430aa
Remove midi-event by iterator, not key -- #7885
With concurrent events removing by key, allowed for invalid
iterators.
2020-01-25 22:15:37 +01:00
Robin Gareus
4fe3036495
Update waf2.x "subst" feature uses obj attributes 2020-01-25 06:20:28 +01:00
Robin Gareus
7c381dab6e
Downgrade "using all channels" warning to info - part 2 2020-01-25 04:17:53 +01:00
Robin Gareus
5a841ef462
Tweaks to build/package scripts for new waf
* Windows: delete waf installed .dll.a files
* Windows: override waf's conf.env.LIBDIR = conf.env.BINDIR
  with explicit --libdir
* Windows: fix asm (`x86_64-w64-mingw32-as` -D flag is for
  debug messages, -D defines are not available)
* Mac: override waf adding -install_name (and
  -Wl,-compatibility_version -Wl,-current_version)
  by moving -dynamiclib from linkflags to ldflags
* Mac: Allow libs with compat version number suffix
  (not needed anymore, but may help in the future)
2020-01-25 04:07:42 +01:00
Robin Gareus
06b2eb1c27
Explicitly use OSX
Previously this was inherited via PBD.

On MacOS/X,  this adds
  "-undefined dynamic_lookup -flat_namespace"
and various "-framework .." options to linkflags

Without this flag, .dylibs fail to link usually because
of missing `-lintl` (Undefined symbols: "_libintl_dgettext")

On other systems this is a NO-OP:
CFLAGS_OSX, CXXFLAGS_OSX and LINKFLAGS_OSX
are only set on the darwin platform.
2020-01-25 04:07:41 +01:00
David Runge
2e9ac80e99
Towards waf python 2+3 support 2020-01-25 04:07:37 +01:00
Robin Gareus
0db559c0ac
Special case checkbox border color in Treeview 2020-01-25 03:40:04 +01:00
Robin Gareus
f9e7f10695
Downgrade "using all channels" warning to info message 2020-01-24 21:16:40 +01:00
Robin Gareus
df8c0d949e
Engine: debug-print alignment 2020-01-24 19:15:21 +01:00
Paul Davis
72e385af46 tentative fix for stop-transport not working after a locate at loop end 2020-01-23 23:41:39 -07:00
Paul Davis
71ccca52a9 add more debug output 2020-01-23 14:25:38 -07:00
Paul Davis
7da3305a04 use Session::locate_initiated(), appropriately 2020-01-23 14:25:38 -07:00
Paul Davis
5949fec987 add Session::locate_initiated()
This differs from ::locate_pending() by covering either phase of a locate - declick or refill
2020-01-23 14:25:38 -07:00
Paul Davis
587631f1d9 add TransportFSM::declicking_for_locate() 2020-01-23 14:25:38 -07:00
Paul Davis
56d00ef32a extend DEBUG_TRACE output 2020-01-23 14:25:38 -07:00
Paul Davis
ef12a4f5a9 NOOP: whitespace/indent fixes from emacs 2020-01-23 14:25:38 -07:00
Paul Davis
87a5990e54 MIDI-region specific naming logic
plus slight cleanup of Region::set_name().

Note that issues with ARDOUR::legalize_for_path() not excluding colons still remain
2020-01-23 14:25:38 -07:00
Paul Davis
c3f7940f25 NOOP: remove blank line 2020-01-23 14:25:38 -07:00
Paul Davis
31db7e91d8 remove no-longer used PostTransportWork bits and renumber the rest 2020-01-23 14:25:38 -07:00
Paul Davis
9b7db16a0b after the butler has finished work, by definition there is nothing left to do 2020-01-23 14:25:38 -07:00
Paul Davis
3f4021c4ea variable not used without debug mode 2020-01-23 14:25:38 -07:00
Nikolaus Gullotta
85f27b28be
Only select all routes in a given group if the group is active 2020-01-23 12:58:59 -06:00
Paul Davis
61e7f3176b do not clear any PostTransportWork flags in butler thread
doing this was causing the TFSM to get stuck in "WaitingForButler"
2020-01-21 21:50:35 -07:00