13
0
Commit Graph

37803 Commits

Author SHA1 Message Date
4abdb09c00
Remove unused API 2023-06-10 03:33:50 +02:00
5965fd15e5
Fix tiny memory leak 2023-06-10 03:33:39 +02:00
9486b4e6cb
Fix port-disconnection label w/pipewire (#9355, #9364) 2023-06-09 19:19:41 +02:00
72850d456f implement time-stretch from left of region
Make click & drag in the left-hand half of a region with the Timestretch
tool stretch the region on its left, leaving the end position of the new
time-stretched region in the same place as the end of the original.
2023-06-09 17:57:52 +01:00
96eb7652c9 fix warning from fallthrough comment typo
Fix "warning: this statement may fall through [-Wimplicit-fallthrough=]",
caused by the misspelling of "fallthrough" as "fallthough" in
editor_ops.cc.

Note that if you use ccache, you'll need to clear its cache to actually
get rid of the warning, because the pre-processed file (with comments
removed) is identical before & after this change, and thus won't get
recompiled otherwise.

Fix the equivalent typos in marker.cc too, though in those cases there's
no actual warning, because presently all the fall-throughs are from empty
cases.
2023-06-09 16:45:31 +01:00
55afdc2aa4
amend 7c7bf6c88b, do not notify UI during cleanup
This fixes a rare crash where the signal causes a
cxa_pure_virtual in PBD::Signal1 during destruction.
2023-06-09 16:17:40 +02:00
ad49de022a
Too many drop-references handlers (#9363)
This fixes a random crash with stop-and-forget capture.

When aborting capture, the disk-writer can emit
 midi_write_source->drop_references ()
in the butler thread, which leads to a direct call to
Session::remove_source.

This can happen before or after Region::source_deleted
is called which is initiated from the same signal.

Furthermore it was possible that Region::source deleted
was called concurrently from the UI thread via SourceRemoved
for whole file regions, which lead to memory corruption.
2023-06-09 16:17:37 +02:00
03e0eea744
Playlist paste, always pastes on top 2023-06-09 00:48:42 +02:00
c61fc45689
Retain region layering for cut/copy/paste 2023-06-09 00:03:49 +02:00
586b109f9e
Remove unused variable, fix small memory leak 2023-06-08 23:14:33 +02:00
7c7bf6c88b
Fix TransportMasterManager crash at exit
TransportMasterManager::destroy () destroys any remaining
TransportMasters which in turn unregister their ports.
However the PortEngine was already destroyed.
2023-06-08 22:50:15 +02:00
a5946ba2e2
Fix heap-use-after-free at exit
Deleting _track_canvas_viewport automatically destroys
any child Items. The LocationMarker's group was already destroyed
when ~ArdourMarker() runs and calls `delete group`.

So first delete the marker, then the canvas
2023-06-08 22:50:15 +02:00
733d59c65b temporal: unit testing more like unit testing
But still not really.
2023-06-08 14:01:17 -06:00
01b8187cd3 temporal: add rudimentary paste test 2023-06-08 14:01:17 -06:00
1cf4f9293c temporal: paste needs to add to _points 2023-06-08 14:01:17 -06:00
24f6c51de6 temporal: more nuances for ::cut_copy() 2023-06-08 14:01:17 -06:00
a09a37049b temporal: get guard point values before altering the tempo map 2023-06-08 14:01:17 -06:00
6039cea3dc temporal: improve cut buffer slightly by using different meters 2023-06-08 14:01:17 -06:00
d0f5fdb224
Fix deadlock and remove debug message
get_extent() takes a RegionReadLock, but ::partition_internal
already holds a RegionWriteLock (use ::_get_extent)
2023-06-08 21:32:53 +02:00
49aa046824
Cut/Copy Section also needs to operate on unused playlists 2023-06-08 20:42:07 +02:00
61b41fd5d0
A user initiated locate cancels play-range (#9360) 2023-06-08 18:38:25 +02:00
6aa2ad26b5
Clear transport sub-state at RangeStop, disable play-range 2023-06-08 18:06:28 +02:00
cd2d0448a9
Fix Play Range (#9360)
When starting RangePlay while the transport is already rolling
the transport is now stopped (and de-clicked) before locating.

This should not clear the RangeStop event when it is caused
by a RangePlay request.
2023-06-08 16:51:24 +02:00
44a6069694
Allow nonsensical meter-types for by default for tracks #9341 2023-06-07 22:22:52 +02:00
b4d95eec57
Do play MIDI notes on selection/draw by default
Since 4ad1c19166 "select all" etc no longer plays
all notes, and possibility to get a  loud speaker-blasting
cacophony is greatly reduced.

We may still want to add some additional heuristics, or
special case drawing new notes/hits, but for now this it
is sensible to enable this by default.
2023-06-07 22:22:52 +02:00
d761ccb59b temporal: the second variant of shift() (untested) 2023-06-07 11:25:44 -06:00
e6b6340f3e temporal: more nuances for shift() 2023-06-07 11:25:44 -06:00
ad45778edc temporal: shift() with BBT must allow negative motion 2023-06-07 11:25:44 -06:00
a456a10cdf temporal: first guess at a TempoMap::shift() implementation 2023-06-07 11:25:44 -06:00
5e9d98dbf9
Debug Port reconnect 2023-06-07 18:13:27 +02:00
d2365daafe
Remove unused API, prefer Session::possible_states 2023-06-07 17:39:29 +02:00
91579608b2
Remove duplicate API to find session files (ignore ._ files)
Session::possible_states correctly filters files
and also directly returns sorted base-names.

We can remove the redundant `get_state_files_in_directory`
API now.

see also 193b35e885
2023-06-07 17:37:40 +02:00
04d50ab880
Fix mouse edit-point cursor when dragging
Editor::motion_handler() only updates the snap-cursor
when no drags are active. While dragging, Drag::motion is
responsible to set the cursor accordingly.

In many cases the snap-cursor simply remained stuck at
the most recent position. Since in many cases
(e.g. RubberbandSelectDrag) it makes no sense to show the
cursor, so Drag::start_grab now hides the cursor by default.

This also fixes cases where the cursor is shown, but
was displayed in the wrong location.
2023-06-07 02:38:39 +02:00
9d3ae4fc8d temporal: fix position of end guard points during map paste 2023-06-06 09:52:29 -06:00
9e4b1d59a7 temporal: do something when pasting the cut buffer guard points
Don't think this is quite right yet - we get guard points even when
they are not really necessary
2023-06-06 09:04:34 -06:00
6865615af8
Fix recursive lock introduced in fbfeff4168 (#9359) 2023-06-06 15:39:54 +02:00
3468ffddbb
Update GUI: add new section operations 2023-06-06 02:42:43 +02:00
4529a17617
Implement Section Delete/Insert 2023-06-06 02:42:43 +02:00
961c6ae8d7
Prepare UI for section cut/copy API update 2023-06-06 02:42:43 +02:00
f5f87f86d4 temporal: adjust cut buffer API to better deal with start/end "guard points" 2023-06-05 17:27:12 -06:00
7789df5b1c temporal: get cut/copy/paste test code slightly more useful 2023-06-05 16:35:17 -06:00
54fac9abac
Allow user to not be reminded about tempo-map not being pasted 2023-06-05 20:04:41 +02:00
522c8f9426
Improve port-engine debug messages
try to get to the bottom of "unregister_port: Failed to find port"
errors.
2023-06-05 19:10:10 +02:00
dc338b7e93
Downgrade error messages that users cannot do anything about
Besides, it can happen under normal circumstances that the
Editor window, or any other window with clocks (prefs) is
visible while no session is loaded.
2023-06-05 15:58:50 +02:00
e938d4936f
Further speed up Windows freewheel export 2023-06-05 01:42:24 +02:00
c24b456211
Windows: unconditionally request high timer resolution
Previously timeBeginPeriod() was only called when MIDI
system was set to WinMME. It was also possible that
it was never unset in case starting the engine failed.

This significantly speeds up freewheel export which uses
Glib::usleep(100) when MIDI is disabled.

see also: https://randomascii.wordpress.com/2020/10/04/windows-timer-resolution-the-great-rule-change/
2023-06-05 00:02:54 +02:00
fbfeff4168
Work around finish_capture() race
In rare cases DiskWriter::run() may call finish_capture()
concurrently with the butler thread from transport_stopped_wallclock,
this can lead to memory corruption (CaptureInfo).

Using a Mutex here is not great, but it is not usually contended
and better than crashing at rec-stop.

We should probably change DiskWrWiter::_was_recording into an
atomic bool, and use CAS to prevent concurrent calls.
2023-06-04 22:19:53 +02:00
464df06419
Fix signal emission order ambiguity (record regionview)
A rec-region is added to the streamview just like any other region
(::add_region_view_internal). This subscribes to region->DropReferences.

When the DropReferences is handled first by StreamView::remove_region_view
the corresponding RegionView is destroyed.

This can happen even while recording is still active, eg. when locating
(which stops the current recording).
MidiStreamView::setup_rec_box() is called and crashes in
`dynamic_cast<MidiRegionView*> (rec_regions.back().second);`
due to a use after free.

Strictly speaking this is a logic error in how ::setup_rec_box()
determines if to add or remove the rec-box. But due to the
asynchronous nature of signal emission and transport-state changes
the best solution is to destroy the rec-region at the same
when the RegionView is destroyed.

To reproduce:
 * create a session with a MIDI track
 * disconnect the input (empty MIDI regions are removed)
 * Preferences > Transport > *enable* latched-record-enable
 * use the Dummy backend's MIDI generator
 * connect Hardware > MIDI > MMC -> Ardour misc > MMC in
   OR use JACK-transport to locate while recording.
2023-06-04 21:42:02 +02:00
ad5d355fb5
Fix remove_source assert()
With empty MIDI regions it can happen that the GUI
still retains a reference (rec_regions)
2023-06-04 21:26:41 +02:00
1feb9b5e89
Streamview: NO-OP, consolidate code 2023-06-04 20:21:41 +02:00