13
0
Commit Graph

19738 Commits

Author SHA1 Message Date
Mads Kiilerich
847f4fc93f
Fix bad escaped trailing newline in #define 2022-11-04 19:18:37 +01:00
d23c506088
Add missing bracket to tag MIDI channel splitted files 2022-11-04 18:54:10 +01:00
bed2e23ff6
Fix memory leak when replicating plugins 2022-11-04 17:57:50 +01:00
619d523bbe
Fix state version for copy-construction (1/2)
In some cases copying an instance requires an explicit
set_state() call (e.g. copy internal plugin state). This is
done by calling `set_state(other->get_state())`.

::get_state() produces XML as matching current_state_version.
(not loading_state_version).
2022-11-04 17:51:09 +01:00
0aad0ae464
Copy state when replicating VST3 plugins (#9006) 2022-11-04 17:40:37 +01:00
fe8d2e7695
third time lucky 2022-11-04 16:03:43 +01:00
03d2c8aa95
Fix previous commit strncasecmp() needs strings.h 2022-11-04 16:01:57 +01:00
0b8adbb1cb
Fix compilation on older systems (amend 3fb90523cc)
libs/ardour/sndfile_helpers.cc:67:68: error: 'strncasecmp' was not declared in this scope
2022-11-04 15:52:25 +01:00
Mads Kiilerich
4958c0d666
PulseAudio: fix error message 2022-11-04 13:44:55 +01:00
Mads Kiilerich
c2db9b4606
PulseAudio: just start stream uncorked
There was no reason to cork it when it was uncorked right after.

Playback will start when the buffer is full anyway.
2022-11-04 13:44:55 +01:00
Mads Kiilerich
00d3ce6b62
PulseAudio: remove commented out code 2022-11-04 13:44:55 +01:00
Mads Kiilerich
40f9e0c6a6
PulseAudio: use explicit defaults for tlength and prebuf
These might be the values that PA would have chosen anyway, but make it
clear that Ardour is in control ... and will let the user control
"everything" with the buffer size.
2022-11-04 13:44:55 +01:00
Mads Kiilerich
584ee51ca8
PulseAudio: set buffer attributes where they are used
Just moving code.
2022-11-04 13:44:55 +01:00
Mads Kiilerich
8e7ef0d42c
PulseAudio: use correct casing
This will also change the internal backend name, so it will miss the
previous 'config' setting '<State backend="Pulseaudio" ...'` and the
session file's '<EngineHints backend="Pulseaudio" ...'. But that is no
big deal after upgrading. Especially after the backend has been broken
for some users for a while.
2022-11-04 13:44:55 +01:00
Mads Kiilerich
3fb90523cc Remove unused code in sndfile_helpers
No need to worry about maintaining this code with missing formats like
mp3.
2022-11-04 03:52:45 +01:00
Mads Kiilerich
d2fa78ba95 Fix "Could create output file" error message
In the log output, the error would look like:
  [ERROR]: Export initialization failed: Exception thrown by AudioGrapher::SndfileWriter<short>: Could create output file (.../export/something.wav)

Add the missing negation.

But it would perhaps be better phrase the message differently so it not
just hints so strongly towards a file system error preventing file
creation.

Perhaps something like "Failed to initialize sound export to %s"?
2022-11-04 03:52:45 +01:00
Mads Kiilerich
6fba7f6308 Handle SF_FORMAT_DOUBLE in sndfile_data_width
Many formats use ExportFormatBase::SF_Double which incorrectly would end
up in the default "we don't handle anything else within ardour" branch.

(It happened to work correctly anyway, since ExportGraphBuilder::SFC
handled the "magic" value 1 the same was as the "error" value 0.)

For correctness, use the "magic" value 1 for double.
2022-11-04 03:52:45 +01:00
Mads Kiilerich
652a2aa3ac Fix sndfile_data_width use of low bits of subtype of libsndfile format
The libsndfile format was masked with 0xf instead of the usual
SF_FORMAT_SUBMASK. It seems like the end result generally was correct
anyway, since no supported format used subtypes that used the low bits
for anything else. Most formats use SF_FORMAT_PCM subtypes. (Only Ogg
Vorbis uses a subtype, but that happens to have 0 in the low bits and
ended up in the "this will never happen branch" ... which happened to
work too.)

This could however be a real problem when SF_FORMAT_MPEG_LAYER_III with
value 0x82 is supported ... unless worked around in some way.

I don't see anything anywhere that could stuff anything in the high bits
of the subtype, so this trivially fixed by using SF_FORMAT_SUBMASK
correctly.
2022-11-04 03:52:45 +01:00
Mads Kiilerich
6531b24e9a ExportGraphBuilder: fix invalid use of SF_FORMAT as a bitfield
Apply SF_FORMAT_SUBMASK before comparing with the expected value.

It seems like it accidentally used to work correctly for all supported
libsndfile formats anyway.

But: It seems unfortunate to hardcode Vorbis in this place. Other
formats with quality control would have to be added to the list too. It
would be nice to do use something like has_codec_quality ...
2022-11-04 03:52:45 +01:00
Mads Kiilerich
07c370bdc9 Handle exception from export formats with unknown enum values
Before, an export format with an invalid enum value (for example in the
Encoding id) would crash Ardour with:

	unhandled exception (type std::exception) in signal handler:
	what: unknown enumerator FOO in PBD::EnumWriter

That kind of error can happen if a new type is introduced and users
switch back to versions without it.

Instead, catch such exceptions while loading a format, log an error, and
skip the format - similar to how other format loading errors are
handled.
2022-11-04 03:52:45 +01:00
7b86ef8eff
Fix region gain for various edit operations
When deriving regions (split, cut), the Region Gain curve
must not be inherited as-is.

See also 8b0ab38675 and e40f58c106
2022-11-03 21:22:32 +01:00
2b0e6ec476
NO-OP: clang format 2022-11-03 00:28:24 +01:00
de4840fb9b Register Region::time_domain property
This fixes PropertyChanged signal emissions, previously a property_id of
zero was used instead.
2022-11-02 21:39:37 +01:00
6813884857
Restore custom generic midi settings #9062
DeviceInfo (bindings file) can include explicit motorized
and threshold settings. These values, when specified, are
used during load_bindings() during set_state and overwrote
any user customization.

Furthermore showing the GUI invalidated any prior setting
by explicitly calling binding_changed, which re-applies.
2022-11-02 17:44:00 +01:00
Mads Kiilerich
ef5b29c6dd
PulseAudio: group operations and their verification together
Improves readability a bit. IMO.
2022-11-02 02:24:35 +01:00
Mads Kiilerich
b046ffe395
PulseAudio: drop idempotent dynamic cast 2022-11-02 02:24:35 +01:00
Mads Kiilerich
5bb7336c79
PulseAudio: consistent use of _buffer
For consistency and readability, avoid using high level getter in low
level code.
2022-11-02 02:24:35 +01:00
Mads Kiilerich
51501e5532
PulseAudio: don't set _run = false when stop() already did it 2022-11-02 02:24:35 +01:00
Mads Kiilerich
ba5ca2de05
PulseAudio: always log error reason in error handling
It adds some new strings to translate. These strings might be so rare
and technical that it is a bit pointless to translate them. But let's
stay consistent...
2022-11-02 02:24:35 +01:00
Mads Kiilerich
3fbbef3038
PulseAudio: fix "already active" message emitted when not active
Apparently just a missing fixup after copy-paste.
2022-11-02 02:24:34 +01:00
Mads Kiilerich
2666dfe900
PulseAudio: add missing return in error handling
Don't try to continue if the initial uncorking fails.
2022-11-02 02:24:34 +01:00
Mads Kiilerich
06b3d5ba33
PulseAudio: spin waiting for enough capacity to write
pa_threaded_mainloop_wait might wake up for several reasons. And there
is no point (but possibly harm) in moving on before we have verified
that PA actually is ready to receive our write without overflow.
2022-11-02 02:24:34 +01:00
Mads Kiilerich
27a2bf1f59
PulseAudio: clean up freewheeling transitions
ae3c8b19c6 and 03a17df68c reworked the transitions to and from
freewheeling. Some of it seems to have been experiments that tried
several things out, and generally it seems to have worked. It left some
commented out code. Clean that up.
2022-11-02 02:24:34 +01:00
Mads Kiilerich
04c24be2db
PulseAudio: don't drain the stream right after initial uncorking
The draining was introduced in ae3c8b19c6, apparently as an experiment
doing several changes. But the drain is outside the loop where
freewheeling changes, so the fix must have worked for other reasons.

There doesn't seem to be any benefit from draining at that point. The
stream is already empty. If not, we could have flushed it.

Draining right after uncorking will conceptualy create an intentional
underflow, even though it isn't reported as such. PipeWire seems to
(something like 6-12 months ago) have regressed in handling of that grey
area, causing that *underflow* to cause a request for too much data, and
thus causing constant *overflows* and unusable playback.

This change makes PulseAudio playback work for me again.
2022-11-02 02:24:34 +01:00
c84073e5cf
Print reversible command debug output
Debug builds will assert, the PBD::warning will not
be readable anywhere after that, so long it to stderr.
2022-11-02 00:47:09 +01:00
292cff7cfc
Prevent undo transaction crashes in optimized builds
Worst case this will lead to undo operations not being
saved rather than segfault (debug builds will still assert).
2022-11-02 00:45:06 +01:00
c6dade9484 OSC: implement controls and feedback for a banked trigger grid controller
(first iteration ... API may change)
2022-11-01 13:52:54 -05:00
bdf9cedb0e triggers: implement grid banking in BasicUI so it can be shared (?) 2022-11-01 13:52:54 -05:00
0851d230cd basic_ui: add convenience functions to access an NxM bank of triggers 2022-11-01 13:52:54 -05:00
4f5106ae82 triggers: add convenience function to report # of trigger channels 2022-11-01 13:52:54 -05:00
756e0beb1b triggers: more session:: functions to access Triggers by index 2022-11-01 13:52:54 -05:00
c23210aae8 various fixes to prevent BasicUI diverging from GUI behaviors 2022-11-01 13:52:54 -05:00
Gon Solo
bb27b24596
Fix warning about integer division.
bugprone-integer-division: Result of integer division used in a floating
point context; possible loss of precision.
2022-11-01 15:56:55 +01:00
c9a9f40987
Add API for Lua DSP to directly set Biquad coefficients 2022-11-01 14:51:07 +01:00
62540fb5af tempo map: grid generation, fix use of barmod to insert bar points into return 2022-10-31 17:05:55 -06:00
0ef10e4f5f canvas: ruler never shows marks/text for points too close to display the label 2022-10-31 17:05:55 -06:00
5599e136c0
Implement "vicanek" matched biquad filters 2022-10-31 22:47:30 +01:00
d93c8d64bc MIDI region combine: fix conceptual errors 2022-10-31 14:22:17 -06:00
f4a57f83e6 evoral: Sequence::clear() needs to remove patch changes and sysexes too 2022-10-31 14:22:17 -06:00
fded5063d9
Yet another automation time-domain fix
This issue was fixed in 6a55146fd but resurfaced in 489c9ace9.
2022-10-31 16:23:20 +01:00