Commit Graph

236 Commits

Author SHA1 Message Date
Robin Gareus c7745ffd43
Double check our assumptions when merging MIDI 2023-10-04 15:12:31 +02:00
Paul Davis 06e9bf6ca4 domain swaps for MIDI CC and other controls 2023-08-16 09:06:10 -06:00
Paul Davis 076cb86912 next iteration of changes to handle time domain bounces as undoable 2023-08-14 23:42:08 -06:00
Paul Davis fa225846af new Temporal API to allow keeping MIDI notes in position after a map-tempo operation 2023-08-02 14:11:06 -06:00
Robin Gareus 7b1da19581
Sort events when merging MIDI regions (#9313)
Sequence<Time>::append() expects events to be sorted.

Previously this only worked for non-overlapping region,
or if all events in the later region(s) are after than the
last even in any earlier region.
2023-06-16 21:31:07 +02:00
Robin Gareus 4abdb09c00
Remove unused API 2023-06-10 03:33:50 +02:00
Paul Davis b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Robin Gareus a3fdb544ee
Fix copying MIDI regions w/automation
This fixes a bug introduced in d06a0d9c9d. The MIDI data
has to be written first, otherwise the CC-event do not exit
and MidiModel::source_interpolation_changed() crashes.
2022-12-02 21:44:22 +01:00
Robin Gareus d06a0d9c9d
Copy MIDI Source properties when cloning MIDI Regions 2022-11-27 01:58:58 +01:00
Paul Davis d93c8d64bc MIDI region combine: fix conceptual errors 2022-10-31 14:22:17 -06:00
Paul Davis efdc47bc74 fix MidiRegion::merge() to allow final events of a region to be part of the newly merged result 2022-10-27 17:35:56 -06:00
Paul Davis 63677347c9 change pingback URL and no longer send OS release or machine info 2022-10-19 20:26:39 -06:00
Robin Gareus e40f58c106 Inherit Region Properties
This also adds special cases when splitting or splicing locked regions.
2022-10-07 00:36:10 +02:00
Paul Davis 7428f13e15 MIDI: unlinked region copies get sources that are copies of the original
Previously, the copied source file only contained data within the initial region bounds. This
meant that you could not trim the (unlinked) copy to beyond its initial bounds. Seems wrong.
2022-09-24 15:38:45 -06:00
Robin Gareus 8b0ab38675
Copy region properties (1/2)
RegionFactory::create(Region&,..) copies all region properties.

There are however various operations that use a new Source
as intermediate to create a new Region from another Region.
Those operations should also inherit various region properties
(such as mute, opaque, locked, ..)
2022-09-19 22:49:39 +02:00
Robin Gareus b277244b12
Convert MIDI region transparency when loading old sessions 2022-09-14 02:44:49 +02:00
Robin Gareus 16ef3dd6b1
Fix `MR:render_range` debug output (nutempo) 2022-09-10 18:19:58 +02:00
Robin Gareus 94637272e1
Mark MIDI regons as transparent by default, and convert old sessions 2022-09-09 19:07:49 +02:00
Paul Davis 2f7f313f6d MIDI combine (basically operational)
May need some tweaks to address notes that are cut off by the end of the region
2022-08-18 07:45:05 -06:00
Paul Davis 7bf89ce109 Constification: make Stateful::get_state() const, with all other required const-ness added (libs) 2022-04-06 21:56:59 -06:00
Paul Davis bbfb1bd229 MidiRegion: take reader lock before cloning data into new source 2022-04-05 20:52:09 -06:00
Paul Davis bc38f8d424 MidiSource: change thread mutual exclusion object from Mutex to a RWLock
This allows two reader threads to proceed without blocking each other, as can
happen when the butler renders a MIDI track into an RT-safe buffer while the
GUI reads the same MidiModel/Source for visual display.
2022-04-05 20:52:09 -06:00
Paul Davis 1686db8b0c Change the type of reference held by a MidiModel to its MidiSource
This also requires a change in the type of reference held by
a MidiAutomationListBinder.

Both the MidiSource and MidiModel have a reference to each other, and it is
important that we avoid circular references to avoid problems with object
destruction. We had been accomplishing this by having the Model hold a
weak_ptr<MidiSource>. However, the lifetime of a MidiSource and its MidiModel
are coincident and there's really no need to use a smart ptr at all. A normal
reference is just fine. However, due to constructors that accept a serialized
state, we cannot use an actual reference (we cannot set the constructor in the
initializer list), so we use a bare ptr instead.

This forces a similar change in MidiAutomationListBinder, which also maintains
a reference to the Source. However, the only purpose of this object is to
ensure that if the Source is destroyed, relevant commands will be removed from
the undo/redo history, and so all that matters here is that the binder connects
to the Destroyed signal of the source, and arranges for its own destruction
when received.

Note that the previous construction of the binder, actually holding a
shared_ptr<MidiSource> would appear have prevented the Destroyed signal from
ever being emitted (from ~Destructible), and so this may also be a bug fix that
allows MidiSources to actually be deleted (the memory object, not the file).
2022-04-05 20:52:09 -06:00
Paul Davis 3454353aa3 remove concept of "note-mode" from Evoral::Sequence (and thus ARDOUR::MidiModel)
This note-mode had no effect on anything at all, at least as far back
as 5.12. There is a note-mode in the GUI which affects the duration of notes
added using the GUI, and that remains in place. It is not clear
if the _percussive member of Evoral::Sequence ever had any effect on
the actual MIDI event stream the Sequence could generate.
2022-04-05 20:52:09 -06:00
Paul Davis 1ab49bcc32 change MidiStateTracker to MidiNoteTracker
The old name will become a bigger class/object that tracks all MIDI state,
not just notes
2022-02-01 18:06:40 -07:00
Robin Gareus 01d964b176
Do not announce exported MIDI files
This would otherwise trigger ARDOUR::Session::add_source
which will add the external path to as session search location.
2022-01-29 16:22:33 +01:00
Robin Gareus ec6cd4539d
Implement Region::export()
This adds an abstract API, matching the exiting MIDIRegion::do_export(),
which allows to export multi-channel audio-files.
2022-01-28 01:58:37 +01:00
Paul Davis e1c874b299 manually reverse 948500bbc7 (final code is not identical to previous state) 2021-10-27 08:36:52 -06:00
Paul Davis 948500bbc7 further API changes to MIDIRegion::render() to allow for use by triggers 2021-10-26 17:32:36 -06:00
Paul Davis 787e5a2ea8 midiregion: remove internal_offset local variable
Even in 6.9, the logic of this conditional would always generate an
internal_offset value of zero samples.
2021-10-25 13:55:03 -06:00
Paul Davis 54f5c65f02 generalize MidiRegion::render() to provide MidiRegion::render_range() 2021-10-25 13:30:26 -06:00
Paul Davis 8fd25e15c0 triggerbox: cleanup parts of Trigger API and finish initial pass of MidiTrigger implementation 2021-10-24 09:27:14 -06:00
Paul Davis 600e0b21e8 fix a misleading comment 2021-10-21 11:16:55 -06:00
Paul Davis 2ed1bdd243 Remove PropertyTemplate::call() and replace with code that uses ::set()
This makes undo/redo work correctly.
2021-09-25 16:49:51 -06:00
Paul Davis 56cde042cd Region::_start should be a timepos_t not a timecnt_t
It is an offset from an *implicit* origin (the source zero), not from an explicit origin,
and this fits with the concept underlying timepos_t. A timecnt_t requires an explicit origin,
which makes no sense in this context (just as it doesn't for the timeline as a whole).
2021-08-13 12:51:34 -06:00
Paul Davis c0343a5a1a get rid of Region _position member, since the _length member has its own position 2021-08-13 12:51:34 -06:00
Paul Davis fbdf06a794 cleanup after timecnt_t API changed (libs edition) 2021-08-13 12:51:31 -06:00
Paul Davis 82e84e6b92 change all Region::nt_*() methods to names without the nt_ prefix (library version) 2021-08-13 12:51:30 -06:00
Paul Davis cdb1972928 continuing timeline type conversions 2021-08-13 12:51:29 -06:00
Paul Davis eae9d276fe libardour: conversion to use timeline types (mega-commit) 2021-08-13 12:51:29 -06:00
Paul Davis 67de08e78d more type changes for various Region related methods, using timepos_t/timeline_t 2021-08-13 12:51:28 -06:00
Paul Davis d26959b8b6 use correct argument types in MidiRegion 2021-08-13 12:51:28 -06:00
Paul Davis d40bdf5e95 first round of changes to use timeline types, here basically for Region position/length/start
UNFINISHED WORK. Does not compile. But region.cc will compile, hence this snapshot
2021-08-13 12:51:28 -06:00
Robin Gareus c8585fce90
Cont'd work to prevent region creation signal-emission
This fixes another deadlock calling send_change with the
Playlist's RegionWriteLock held.

In this case due to "MIDI region copies are independent"
when duplicating MIDI regions.

```
ARDOUR::Region::send_change ()
PBD::Stateful::apply_changes ()
ARDOUR::RegionFactory::create ()
ARDOUR::RegionFactory::create ()
ARDOUR::MidiRegion::clone ()
ARDOUR::RegionFactory::create ()
ARDOUR::Playlist::duplicate ()
```
2021-05-01 16:21:17 +02:00
Robin Gareus 72d45c154a
Do not allow ctrl chars in file (or session) names (1/2) 2020-06-09 20:30:51 +02:00
Paul Davis 0f63b82943 fix error in multiple calls to SourceFactory::createWritable()
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-23 21:47:13 -06:00
Paul Davis 5d99526406 correct location of resolved note-offs after region is rendered 2020-01-27 22:17:07 -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 3c83979a50 further improve debug message 2019-12-18 19:56:38 -07:00
Paul Davis c8b9184956 fix thinko in MidiRegion::render()
MidiSource::read() wants a length, not an end-sample.

This should fix (at least) some cases where notes past the region end
get included/played
2019-12-18 19:50:32 -07:00